小编Mak*_*sim的帖子

夹具或测试的隔离模式

是否可以在隔离模式下运行某些测试,而在不使用该模式的情况下运行其他测试?例如,我们有一些轻量级测试,我们不需要进行3次尝试,但对于其他测试则可能是必要的

testing automated-tests web-testing e2e-testing testcafe

4
推荐指数
1
解决办法
91
查看次数

选项不适用于跑步者

我正在尝试在隔离模式下运行一个简单的测试:

test.only("test", async t => { await t.expect(true).notOk(); });

这是我的跑步者

const createTestCafe = require("testcafe");

let testcafe = null;

const runTests = (testFiles) => {
const runner = testcafe.createRunner();
  return runner
  .src(testFiles)
  .browsers(["chrome"])
  .run({
    quarantineMode: true
  });
};

createTestCafe("localhost", 1337, 1338)
  .then(tc => {
   testcafe = tc;
   return runTests(["src/tests/"])
})
.then(() => testcafe.close());
Run Code Online (Sandbox Code Playgroud)

但测试仍然只运行一次。我还尝试在我的 package.json 文件附近添加配置文件,并在我的 runner 文件附近添加配置文件,但仍然没有结果。

testing automation automated-tests e2e-testing testcafe

3
推荐指数
1
解决办法
60
查看次数