【问题标题】:Testcafe: Getting error: Cannot implicitly resolve the test runTestcafe:出现错误:无法隐式解析测试运行
【发布时间】:2020-01-30 12:05:03
【问题描述】:

我正在 testcafe 中编写脚本来解析响应并验证该响应是否包含必需的文本,但出现错误:无法在应执行测试控制器操作的上下文中隐式解析测试运行.请改用测试函数的 't' 参数。

test ('Control server info', async () => {

    await t
      .click(infoserver.serverinfoButton)
      .click(infoserver.getInfoButton)

    await infoserver.resultText.value.then( async (res) => {
        const infoParse = JSON.parse(res);
        console.log(infoParse);

    await t
    .expect(infoParse.username).contains('Google:cloudtester12345@gmail.com');

    });
});

【问题讨论】:

  • 在我对 Testcafe 的短暂体验中,我发现这个错误通常是由于其他一些错误触发的,无论是在测试代码本身还是在被测试的应用程序中。

标签: typescript testing automated-tests e2e-testing testcafe


【解决方案1】:

试试

test ('Control server info', async t => {

//test code
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-19
    • 1970-01-01
    • 2020-03-04
    • 2021-05-26
    • 1970-01-01
    • 1970-01-01
    • 2019-10-03
    相关资源
    最近更新 更多