Testcafe:出现错误:无法隐式解决测试运行

问题描述 投票:0回答:1

我正在用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:[email protected]');

    });
});
typescript automated-tests testcafe
1个回答
0
投票

尝试

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

//test code
});
© www.soinside.com 2019 - 2024. All rights reserved.