选项不适用于跑步者
Options doesn't apply to runner
我正在尝试 运行 隔离模式下的简单测试:
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());
但测试仍然只 运行 一次。我还尝试在 package.json 文件和 运行ner 文件附近添加配置文件,但仍然没有结果。
我将代码复制到运行TestCafe中的'run.js`文件中,然后修改测试代码如下:
fixture `Fixture`;
test.only("test", async t => {
console.log('test');
await t.expect(true).notOk();
});
之后,我在我的终端中 运行 node run.js
命令。我得到了以下测试执行报告。
可以看到test
这个词在测试执行报告中出现了3次。因此,测试将 运行 3 次并且 TestCafe 的 qua运行tine 模式按预期工作。
我正在尝试 运行 隔离模式下的简单测试:
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());
但测试仍然只 运行 一次。我还尝试在 package.json 文件和 运行ner 文件附近添加配置文件,但仍然没有结果。
我将代码复制到运行TestCafe中的'run.js`文件中,然后修改测试代码如下:
fixture `Fixture`;
test.only("test", async t => {
console.log('test');
await t.expect(true).notOk();
});
之后,我在我的终端中 运行 node run.js
命令。我得到了以下测试执行报告。
test
这个词在测试执行报告中出现了3次。因此,测试将 运行 3 次并且 TestCafe 的 qua运行tine 模式按预期工作。