w3resource

Runs


In this tutorial, we will show you how you can monitor and control your runs. We will look at what a run contains and where to find information about your run’s status.

Recorded run will capture the results from your test runs.

Run details

The details that will be displayed for each run includes:

  • The number of tests that have the status of skipped, pending, passing or failing.
  • The GitHub branch, the pull request, the commit sha and the commit message that is associated with the run (if any)
  • The time taken for the run, each of the spec file, and the time it started and the time it ended.
  • The continuous integration that the run ran in (if there is any) and the CI’s id and url.
  • The operating system and version
  • The Cypress version
  • The browser and version
cypress: runs image

Spec files

The result of each spec file that ran can be seen within the Specs. You also have the option of switching between Timeline View and Bar Chart View.

Timeline View

The Timeline view will chart your spec file based on the way they ran relative to each other. This is helpful when you want to visualize how the tests ran in parallel.

cypress: runs image

Bar Chart View

The Bar Chart view will chart the length of each spec file. This view will help you to determine which spec files ore tests are running longer than others.

cypress: runs image

Jump to failed tests

If there is a failed test in your Spec, hover over that test chart to reveal a link which when clicked will lead you directly to the error message and stack trace of the test. An example is shown below:

cypress: runs image

</> Standard output

The standard output includes the details and summaries of the tests for each spec file based on the reporter that you have set. By default, the reporter will be the spec reporter.

You will also see a summary at the bottom indicating the screenshots, or videos that were uploaded while the test is recorded.

cypress: runs image

Screenshots

All the screenshots that are taken during your test run can be found in the Screenshots of the spec. Both the screenshots taken during failures and the once taken using the cy.screenshot() command will show up here.

Videos

The videos that are recorded during the test run can be found under the video of the spec, this videos can be downloaded.

cypress: runs image

Test failures

If test that fails during a test run can be found under the Failure tab, each of the failure will be listed under its test title.

Every failure will display:

  • Test title: The title of the failed test.
  • Error: The stack trace of the error.
  • Screenshot: Any screenshots taken during the test.
  • Video: The recorded video scrubbed to the point of failure in the test.

Cancel run

You can decide to cancel a run that is in progress from the Dashboard. This can only be done by members of the project.

In order to cancel a run, you will have to:

  • Click on a run in progress from the list of runs.
  • Click on the Cancel run that is in the upper-right corner of the run details page.
  • Click Yes, cancel this run to confirm. Note: this action cannot be undone

Here is a list of what will happen if you cancel a run:

  • The run status will be updated to canceled.
  • A message appears on the run details page showing the time of cancellation and the user that canceled the run.
  • The run displays as Canceled in the associated GitHub pull request if GitHub Integration is enabled.
  • Any tests that is recorded to completion will be available to view in the run details page.
  • Any tests recorded to completion will still count towards your monthly test recording limit.
  • If you have Analytics enabled, canceled runs will appear in the Runs over time chart.
  • Any incomplete calls to cypress run --record for the run will be marked as canceled and not run.
  • Any existing calls to cypress run --record for the run will exit with an error like below.

Archive run

All the runs that have been canceled or are in errored state can be archived from the Dashboard. To archive a run, you will have to click Archive this run in the cancellation or error message.

This is what will happen when you archive a run:

  • The archived run will no longer be displayed in the runs list or Analytics reporting.
  • Archived runs can still be accessed by the URL to that run. The format is as follows: https://dashboard.cypress.io/projects/{project ID}/runs/{run number}
  • Any test that is recorded to the Dashboard will still count towards your monthly test recording limit, even though it has been archived.

If you want to restore an archived run, you will need to:

  • Visit the archived run, using the run's URL, which is usually in this format: https://dashboard.cypress.io/projects/{project ID}/runs/{run number}
  • Then click on  Restore from archive