为什么 testcafe 运行测试两次?

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

我只是不明白,为什么 testcafe 在我的例子中运行这个测试两次:

MainApp.ts:

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
  );
typescript testing automated-tests e2e-testing testcafe
1个回答
0
投票

您的代码运行良好,无需运行两次,只需更新节点并安装 testcafe 即可

类型

npx testcafe <browser> <path>

© www.soinside.com 2019 - 2024. All rights reserved.