柏树在所有块完成后退出测试执行环境
我对嵌套的描述有一个很大的描述,并且它阻止了它。 我想在其描述中将每个IT块。问题在于,在运行所有测试后,柏树存在测试跑者。我想保留那些IT阻止测试以查看历史记录条目。
describe("Move timetable until the specified event is executed", () => {
describe("Login", () => {
it("should log in and retrive the timetable related info", () => {
cy.login()
});
});
describe("Access dedicated menu leaf", () => {
it("should access the Maintenance menu and click on Execute", () => {
executeCurrentTimetable.accessMenuLeafAndClickExecute();
});
describe("Execute events until specified event is executed", () => {
it("should execute the timetable until a specified event is reached", () => {
// get the event based on eventsList array
executeCurrentTimetable.executeEvents(eventKeyObj.SoBD);
});
});
只有将所有命令包裹在相同的描述中并堵塞时,只有
describe("Execute events until last event of the day", () => {
it.only("should execute the timetable until a specified event is reached", () => {
cy.login()
executeCurrentTimetable.accessMenuLeafAndClickExecute();
executeCurrentTimetable.executeLastEvent();
});
});
在测试完成后自动进入菜单后(请参阅图片)。 任何帮助都将不胜感激。 谢谢你!
I have one big describe with nested describes and it blocks.
I wanted to have each it block within its describe. The issue is that cypress exists the tests runner after all tests are run. I want to preserve those it blocks tests in order to see the history entries.
describe("Move timetable until the specified event is executed", () => {
describe("Login", () => {
it("should log in and retrive the timetable related info", () => {
cy.login()
});
});
describe("Access dedicated menu leaf", () => {
it("should access the Maintenance menu and click on Execute", () => {
executeCurrentTimetable.accessMenuLeafAndClickExecute();
});
describe("Execute events until specified event is executed", () => {
it("should execute the timetable until a specified event is reached", () => {
// get the event based on eventsList array
executeCurrentTimetable.executeEvents(eventKeyObj.SoBD);
});
});
Only if all commands are wrapped within the same describe and it block works:
describe("Execute events until last event of the day", () => {
it.only("should execute the timetable until a specified event is reached", () => {
cy.login()
executeCurrentTimetable.accessMenuLeafAndClickExecute();
executeCurrentTimetable.executeLastEvent();
});
});
After the tests are completed cypress automatically goes to the menu (see picture).
Any help would be much appreciated.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
- 无exit
标志来防止执行后退出。有关更多信息,请参见NPX Cypress运行-Help
。这是问题 。示例:
NPX柏树运行-NO-EXIT
You can use the
--no-exit
flag to prevent an exit after execution. Seenpx cypress run --help
for more information. Here is the issue of the feature.Example:
npx cypress run --no-exit