通过Jasmine进行测试-每一步后都有新的生产线



我是Jasmine库的新手。

我的目标是打印每一步的所有标题("it"(,即使它通过了。此外,我想把每一步都写进一行。

我该怎么做?

it('type manager id ', async() => {
await useful.clickAndWait(page, confEditOrder.openSaleToEdit, confMWpos.swipeCardUsrContinue);
await sleep.sleep(confUtility.levelWait.selectorAppears);
isAppear = await useful.isExist(page, confMWpos.swipeCardUsrContinue);
await ta.inputSwipeCard.setText(confSeting.password.shiftsManager[useful.environments().station]);
expect("Swipe card is opening: true").toBe(`Swipe card is opening: ${isAppear}`);
});
it('open menu ', async() => {
// {
// debugger;
await useful.clickAndWait(page, confMWpos.swipeCardUsrContinue, confEditOrder.saveCustomer);
if (customer.subService == "delivery")
await useful.click(page, confEditOrder.saveCustomer);
isAppear = await useful.isExist(page, confEditOrder.dealsButton);
expect("menu is opening: true").toBe(`menu is opening: ${isAppear}`);
// }
});

我的输出是

F

我想把它改成:

类型管理器id-通过
打开菜单-失败

如果希望测试按顺序运行,则需要更改random布尔值。

查看此交换:https://sqa.stackexchange.com/q/36601

尽管如此,为了确保单元测试的可靠性,最好让单元测试按随机顺序运行,以确保它们不依赖于运行顺序。

最新更新