You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 95ddb4d
Browse filesBrowse the repository at this point in the historyBrowse files
In this guide, we will use the endform dashboard to understand the test results.
11
14
@@ -14,6 +17,99 @@ To start from this step, checkout the [`stage-3-endform-integration` branch](htt
14
17
For more information about getting started with the tutorial repository, go [here](/docs/tutorial/playwright-e2e-from-cowboy-to-confidence#getting-started-with-the-tutorial-repository).
15
18
</Aside>
16
19
17
-
<Asidetype="caution">
18
-
This tutorial is a work in progress! More coming soon.
19
-
</Aside>
20
+
Real world tests don't always pass the first time you write them or forever more.
21
+
There is near no point in writing or running end-to-end tests if we don't know how to debug them quickly and easily.
22
+
23
+
We covered in part one of the tutorial how to use the debug flag with Playwright `pnpm playwright test --debug`.
24
+
This is a great option for understanding what's going on in a test while you're developing it.
25
+
26
+
In many cases we want to be able to look at test runs after they've completed.
27
+
Let's take a look at the most powerful options we have available to us to debug Playwright end to end tests after they've completed.
28
+
29
+
30
+
## Playwright traces
31
+
32
+
Start by setting the `trace` option to `on` in your `playwright.config.ts` file.
33
+
34
+
```ts
35
+
exportdefaultdefineConfig({
36
+
// Create a HTML report of the test run
37
+
reporter: [["html", { open: "never" }]],
38
+
use: {
39
+
// Always create a trace of the test run even if the test passes.
40
+
trace: "on",
41
+
},
42
+
});
43
+
```
44
+
45
+
Then kick off a run of your suite. `pnpm playwright test` and boot the html report server `pnpm playwright show-report`
46
+
47
+
<Imagesrc={HtmlReportTrace}alt="Playwright HTML reporter with trace"width={900} />
48
+
49
+
We now click on one of the tests since we had trace set to on we should have a full trace file for each of the successful tests in our suite.
0 commit comments