![](/img/trans.png)
[英]How can we skip the .after steps in TestCafe if the test itself fails?
[英]skip test based on the environment testcafe
我一直在嘗試根據環境跳過測試。 TestCafe 沒有skipif
功能。 如果 env=qa,這將很容易排除測試。 我嘗試使用.filter
但它沒有解決我的問題。 請將此視為功能請求。
為此,您可以使用常規條件; 例如:
import { Selector } from 'testcafe';
fixture `My fixture`
.page `http://devexpress.github.io/testcafe/example/`;
if (process.env.QA_MODE) {
test('QA_MODE_ON', async t => {
await t.wait(500);
});
}
else {
test('QA_MODE_OFF', async t => {
await t.wait(5000);
});
}
PS StackOverflow 不是提出功能請求的最佳場所。 最好將它們放在 testcafe 存儲庫中。
注冊上面的答案:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.