What you get
- Your test command, started from the Quality header and running in the background.
- A live view of the run: which spec runs, what passed, what failed.
- Import of result files into one or more test executions, by hand or right after the run.
- Results mapped to test cases through Automated by, and a list of tests that matched nothing.
1. Link scripts to test cases
The mapping is by file. In each test case, set Automated by to the spec file that checks it, for example e2e/shipping.spec.ts, or link it from the Code view with right-click, Quality, Link to test case…. Every test in that file counts for the test case. See Test cases.
2. Set up the command
Open QA settings (the gear) and pick Automated tests.
- Run all tests: the command for the whole suite, for example
make e2eornpx playwright test. It runs in the project folder. - Run single test: the command for one file.
{file}becomes the test file's path, relative to the project folder; without{file}the path is appended. Example:make e2e spec={file}. - Dry run starts the command once so you can try it. Below the commands you see the last run with its passed, failed and skipped counts and its duration.
Until you enter a command, nothing runs.
3. Tell Sightdeck where the results are
Under Result files, click Set up import.
- Detect looks for a Cypress or Playwright config and for result files already in the project, which you can take with one click.
- Add paths by hand: single files, folders or globs, relative to the project.
- Any JUnit XML report works, and Playwright's JSON reporter too. The setup shows a snippet for the Cypress and the Playwright reporter if yours writes no file yet.
This setup is for the whole project: every test execution imports from these files.
4. Run and import
Click Run automated tests in the Quality header. Choose where the results go afterwards: one or more executions, All active test plans, or Don't import. Then Start.
- Old reports at the result paths are deleted first, so an old failure cannot hide a new pass.
- The run goes on in the background; you can keep working. The button shows the progress and opens the output.
- The live view lists the specs as they run, with Follow the running spec, the Raw output, and for a failure Open spec at line and Create defect.
- A run stops after 60 minutes.
You can also import without running: open a test execution and click Import results. It reads the files at the saved paths into that execution.
How results map to test cases
- A test belongs to every test case whose Automated by points to the test's file.
- If any test of that file failed, the test case is Failed. If tests passed and none failed, it is Passed. If all were skipped, it is Skipped. The note lists every test with its outcome.
- When the same spec shows up in several result files, only the newest file counts.
- Tests that match no test case are listed after the import, so you can link their file. Test cases that got results but are not in the execution are listed too.
Results are recorded as Import, next to the ones you set by hand. A test case whose results keep switching between passed and failed is marked Flaky.
Example: shipping costs in Playwright
- TC-031 to TC-047 are all automated by
e2e/shipping.spec.ts. - In QA settings, Run all tests is
npx playwright test, and the result file is the JUnit report the project's Playwright reporter writes. - Run automated tests, import into the run of "Release 2.7 regression", Start.
- The test for 10 kg fails. TC-038 is set to Failed with the failing test in its note. Create the defect from the live view, and the plan shows No-Go until it passes again.
Related
- QA settings: commands, result files and disabled tests.
- Test plans and runs: where results land.
- Reports: the Automation report and flaky tests.
- Code view: run a single test file.