【问题标题】:Cypress exits the tests execution environment after all it blocks are finished赛普拉斯在所有块完成后退出测试执行环境
【发布时间】:2022-10-22 03:50:48
【问题描述】:

我有一个带有嵌套描述的大描述,它会阻塞。 我想让每个 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();
      });
    });

测试完成后,cypress 自动进入菜单(见图)。 任何帮助将非常感激。 谢谢!

【问题讨论】:

    标签: testing cypress reload


    【解决方案1】:

    您可以使用--no-exit 参数来防止执行后退出。有关更多信息,请参阅npx cypress run --help。这是该功能的issue

    【讨论】:

      猜你喜欢
      • 2019-10-24
      • 1970-01-01
      • 1970-01-01
      • 2021-11-14
      • 2022-06-10
      • 1970-01-01
      • 2023-03-23
      • 2021-05-28
      • 2022-07-21
      相关资源
      最近更新 更多