为什么testcafe运行两次测试



我只是不明白,为什么testcafe在我的情况下运行两次这个测试:

主要应用程序:

const getUrl = ClientFunction(() => window.location.href);
class MainApp {
async login(url:string) {
await t.expect(getUrl()).eql(url);
}} 
export default new MainApp();

测试.ts:

import MailosaurClient from "mailosaur";
import { Selector, t } from "testcafe";
import MainApp from "./MainApp";
const testUrl = `https://www.google.com/`;
fixture("fixture")
.page("https://www.google.com/")
.beforeEach(async (t) => {
console.log("test");
})
.disablePageCaching("fixture");
test("Test", async (t) => {
console.log("Starting test");
await MainApp.login(
testUrl
);

您的代码运行良好,没有运行两次,只更新节点并安装testcafe和

npx testcafe <browser> <path>

最新更新