Cypress 简明教程
Cypress - Dashboards
必须设置Cypress Dashboard服务,才能创建运行在我们系统中的Cypress测试与托管在云中的控制面板之间的链接。
Cypress Dashboard Service has to be set up to create a link between Cypress tests running in our system and the dashboard which is hosted on the cloud.
Features
Cypress Dashboard的功能解释如下:
The features of Cypress Dashboard are explained below −
-
It provides data on the total number of passed, failed and skipped test cases.
-
The stack trace and screenshots of the failed tests are available.
-
The video of test execution is available.
-
Management of test data, framework and their access is possible.
-
The usage trends in the organization is provided.
Setup Cypress Dashboard
要设置流程,首先,我们应该转到Cypress Test Runner窗口中的Runs选项卡。然后单击Connect to Dashboard。将出现以下屏幕:
To set up the process, first, we should go to the Runs tab in the Cypress Test Runner window. Then, click on Connect to Dashboard. The following screen will appear −
我们将获得各种登录仪表板的选项,如下所示:
We shall get various options of logging on to the Dashboard, as shown below −
成功登录后,我们将收到成功消息。单击Continue。
After successful sign in, we shall get the success message. Click on Continue.
输入项目名称、所有者和可以看到该项目的用户。
Enter the project name, owner and users, who can see the project.
然后,单击Set up project。
Then, click on Set up project.
Cypress将给出以下建议:
Cypress shall then give the following suggestions −
-
project Id
-
unique project key (in form of command to be executed in terminal)
从 Cypress 建议获取的 projectId 应与项目文件夹中的 cypress.json 文件中可用的项目 ID 匹配。
The projectId obtained from the Cypress suggestion should match with the project id available in the cypress.json file within the project folder.
接下来,我们必须按 Cypress 建议运行下面提到的命令 -
Next, we have to run the below mentioned command as suggested by Cypress −
node_modules/cypress/bin/cypress run --record --key <project key>
下面给出的屏幕将会出现 -
The screen given below will appear −
执行完成后,我们必须打开测试运行器的运行选项卡。它包含有关平台、浏览器和测试持续时间的信息。
Once the execution is done, we have to open the Runs tab of the Test Runner. It has the information on platform, browser, and duration of the tests.
测试记录应该可见。单击记录。
The test records shall be visible. Click on a record.
记录在浏览器中打开,其中带有测试结果概述(已通过、失败、待处理、跳过的数量),如下所示。
The record is opened in a browser, with the test result Overview (count of passed, failed, pending, skipped), as shown below.
在 Specs 选项卡中,我们应该有每项测试及其结果的详细信息。
In the Specs tab, we should have the details of each test and its result.
此外,还有输出、失败的测试截图、视频等功能。
Additionally, there are features like output, failed test screenshot, videos, and so on.