A failed email-verification test leaves a trace.zip in a CI artifact. The trace opens, but the team does not know whether it contains the code or link.
Fastest safe answer: Playwright Trace can include DOM snapshots, screenshots, and network information. A test email verification code may appear if the application or test exposes it in recorded content. Treat traces and related CI reports as potentially sensitive until an isolated run proves what this project actually captures.
This guide is for QA engineers testing their own registration and email-verification flows.
It also helps Playwright maintainers review CI uploads, reports, and access controls.
Technical leads setting test-data and artifact-retention rules can use the same checks.
What Playwright Trace can record about email verification
Playwright’s official Trace Viewer documentation describes a viewer for recorded browser activity, including DOM snapshots, screenshots, and network information. The Tracing API reference also describes trace recording options and the information associated with recorded actions.
That documentation describes what the tooling can present. It does not establish that a particular project’s trace contains a particular email, code, or verification link. That depends on the application’s behavior, the test steps, and the configured recording process.
| Trace evidence | How email-related data could enter it | What to verify |
|---|---|---|
| DOM snapshot | The page displays a test code, address, message preview, or verification link. | Inspect snapshots around the email step and any page that displays the message or code. |
| Screenshot | A visible code, address, or link appears in the captured screen. | Review screenshots from the relevant action. Avoid sharing screenshots that show usable test credentials. |
| Network information | A request or response contains message content, a code, a link, or related identifiers. | Check the recorded requests and responses, including the details shown in the viewer. |
| Test report attachment | A report links to or bundles a trace, screenshot, or other diagnostic file. | Inspect the report package as well as the trace archive. |
A code can be absent from the page and still be present elsewhere in the test workflow. For example, the test may fetch a message through an API and then pass its verification link to the browser. In that case, the trace may show browser-side requests, while the API response or test output may be stored separately. The whole artifact chain matters.
Do not infer absence from a single clean screenshot. A screenshot captures a visible state; it does not answer what the DOM snapshot, network records, test output, or attached report contains.
Local debugging with a controlled inbox
Use an isolated test account and synthetic email content. Do not use a real employee address, a production customer record, or a live account-recovery link as test data. The goal is to learn what this application version records, not to test with a secret that matters outside the test.
Run the registration and verification flow in a controlled environment, then inspect the evidence in context:
- Record the application build or test revision being checked. A conclusion from one build should not be treated as a permanent property of the product.
- Use a synthetic address, code, and verification link. Keep the values unusable outside the test environment.
- Trigger the flow that creates and consumes the message. Include the browser steps that normally display or use the verification data.
- Open the trace in Playwright Trace Viewer. Review the relevant DOM snapshots, screenshots, and network entries.
- Inspect any test output and report attachments produced by the same run. Search for the synthetic address, code, and link without copying real credentials into a ticket or article.
- Write down what was checked, what was present, and which build and recording configuration the result applies to.
- If a value appears, trace how it entered the artifact. If it does not appear, note the exact files and views inspected rather than claiming that Trace can never contain it.
Keep the evidence private during the review. A synthetic code is safer than a live one, but a test address or link can still reveal internal workflows, identifiers, or environment details.
A clean local trace is not proof that a CI report is clean. CI may use a different recording mode, retry flow, reporter, upload step, or artifact store.
For teams deciding where to receive test messages, the choice between a temporary inbox and a persistent secondary account depends on whether the test needs short-lived isolation or ongoing access. The temporary email versus a secondary email account comparison can help frame that choice. It does not replace checking the exact inbox and retention behavior required by the test.
CI retries and uploaded artifacts
A CI failure can leave more than one kind of evidence: the trace itself, screenshots, a test report, runner logs, or an uploaded bundle. These items can have different audiences and retention settings. The project should inspect each destination rather than assuming that a Playwright option also controls the CI provider’s storage.
Playwright documents trace collection settings in its test use options and its test reporter guide. These are separate from a team’s own report publication, artifact-upload, and access policies. A setting that controls whether a trace is recorded does not by itself determine who can download an uploaded archive.
| CI situation | Review in the Playwright project | Review in the CI workflow |
|---|---|---|
| Trace recorded only for selected outcomes | Which run or attempt triggers recording, and what evidence is captured. | Whether the resulting file is uploaded, where it is stored, and who can access it. |
| Trace retained for a retry or failure investigation | Whether the retry produces a trace that includes the email-verification steps. | Whether artifacts from earlier and later attempts are both retained or attached to the report. |
| Report includes downloadable diagnostics | Which files the reporter attaches or links to. | Whether report visibility, downloads, and retention match the intended team boundary. |
| Trace disabled for a run | Whether screenshots, logs, or other test outputs still contain the same data. | Whether another workflow step collects or publishes those files anyway. |
Use the project’s actual configuration as the source of truth. Check the trace mode and the conditions under which the test runner records a trace. Then follow the file through the workflow: report generation, artifact upload, shared storage, and any long-term archive.
The safest review includes a failed test path, because that is often when teams depend on saved diagnostics. It should also include retries if the CI workflow retries failed tests. A passing run alone may not produce the same files or follow the same upload path.
Team access and report sharing
Trace privacy is not only a recording question. It is also an access and retention question. A harmless synthetic test can still expose internal routes, test addresses, environment names, or the structure of a registration flow. A reusable link or credential raises the stakes further.
The OWASP Logging Cheat Sheet advises against directly recording sensitive information such as authentication passwords, access tokens, and sensitive personal data. Apply that principle to test logs and artifacts as well as conventional application logs. Avoid adding codes, full message bodies, or usable links to debug output unless the test specifically requires them and the storage path is controlled.
| Artifact location | Access questions | Practical review |
|---|---|---|
| Local developer machine | Who can access the workspace or copied archive? | Store only what is needed for diagnosis and remove local copies when the review is complete. |
| CI job output | Can anyone with job visibility read logs or download attachments? | Check job permissions and whether output includes message content or secrets. |
| Shared report or artifact storage | Can the report be forwarded, downloaded, or retained beyond the test? | Check the actual access list, sharing behavior, and cleanup process. |
| Issue tracker or chat attachment | Could a wider audience or long-lived history expose the file? | Share a redacted finding or synthetic reproduction instead of a raw trace when possible. |
Do not treat masking as complete protection. A masked value in a report may still exist in the original trace, another attachment, a log line, or a copied archive. The proper review checks the raw artifact and each location where it may have been uploaded.
A team can also document a short artifact-handling rule: who may review a trace, where approved copies may be stored, and when old files are removed. The MXTemp privacy policy is available for reviewing the service’s stated data-handling terms when evaluating an external test inbox. Any external service should be assessed against the team’s own requirements; a policy page does not replace an artifact access review.
Decision conditions for keeping useful evidence
Choose a trace strategy based on the diagnostic value and the sensitivity of the data. The following branches keep that decision tied to the test’s purpose:
- If the code or link is synthetic, unusable outside the test, and the trace is restricted to authorized reviewers, retain the evidence needed to debug the flow. Still confirm that the report and uploaded files follow the same access rules.
- If the test uses a real mailbox, real user data, or a reusable credential, replace those values with synthetic test data before relying on retained traces. If that cannot be done immediately, narrow artifact access and avoid publishing the raw trace.
- If the code must be fetched outside the browser, inspect the message retrieval response, test-runner output, and report attachments as well as browser trace entries. Browser evidence alone cannot establish what the test harness saved.
- If a trace is unnecessary for a passing run, use a recording policy that preserves evidence for the failure scenarios the team actually investigates. Confirm the configured behavior from the project’s documentation and then verify the resulting CI files.
- If restricting or shortening evidence makes the failure impossible to diagnose, restore the smallest useful diagnostic scope for that test and compensate with synthetic data, tighter access, and deliberate cleanup.
- If the test needs long-term access to the same mailbox, choose a controlled persistent test inbox rather than assuming a temporary address will meet the test’s lifetime and recovery needs.
A change is not complete when a configuration file changes. Re-run the controlled flow, inspect the new trace and report, and verify that the assertion still proves the intended behavior. A policy that hides the code but also hides whether the email-verification flow completed is not a useful test result.
A repeatable artifact review
For each meaningful change to the application’s email flow, recording settings, or CI publication process, run the same review procedure:
- Generate a test-only message with synthetic address, code, and link values.
- Execute the browser flow under the recording configuration used by CI.
- Inspect snapshots, screenshots, and network entries in the trace viewer.
- Inspect the report, runner output, and uploaded artifacts separately.
- Check whether access and cleanup rules apply to every copy, not just the original archive.
- Record the revision, configuration, files inspected, and findings.
- Re-run the relevant assertion after any privacy change to confirm that test coverage remains useful.
Keep the review record factual. “The inspected CI archive for this revision contained no synthetic code in the files checked” is a bounded finding. “Playwright never records codes” is not. The former can be repeated after a configuration or application change; the latter overstates what official documentation and a project-specific test can establish.
The most valuable outcome is a clear boundary: which test data can enter the trace, which artifacts are retained, and who can access them. That boundary lets a team preserve failure evidence without treating a trace as harmless by default.
FAQ
Can a Playwright trace show a code displayed on a page?
It can, if the code is present in content captured by the trace, such as a DOM snapshot or screenshot. That does not mean every trace contains a code: the result depends on the application, the steps executed, and the recording configuration. Inspect a controlled run using synthetic values before deciding what your project artifacts expose.
Could a trace archive contain an email verification link?
A verification link may appear in a page snapshot, screenshot, or network information if the test opens it or the application exposes it during the run. A trace is not a guaranteed copy of every email, and it is not guaranteed to omit links. Check the actual archive and any attached report using a test-only link.
What should a team inspect after a CI test fails?
Review the trace recording mode, the failed attempt and retry behavior, the report attachments, and the CI upload destination. Search the resulting files for synthetic codes, verification links, test addresses, authorization headers, and message content. Then check who can view, download, or retain those artifacts; local Playwright settings do not define the entire CI access boundary.
How can email codes stay out of Playwright test reports?
Use synthetic accounts and codes, avoid printing message bodies or secrets to test output, and retain only the evidence needed to diagnose failures. Configure trace collection deliberately, restrict report access, and remove old artifacts under the team's retention rules. Re-run the test and inspect the resulting files; masking alone does not prove that other copies are safe.
After a controlled review, teams that still need a real receiving inbox can assess MXTemp as one option for their own product tests. Check the current service page for the exact receiving and retention behavior before using it in a workflow; do not assume delivery or use a temporary inbox for accounts that require long-term recovery. For a test that only needs a short-lived verification message, review MXTemp’s current inbox options and keep the test data synthetic.
Frequently asked questions
Can a Playwright trace show a code displayed on a page?
It can, if the code is present in content captured by the trace, such as a DOM snapshot or screenshot. That does not mean every trace contains a code: the result depends on the application, the steps executed, and the recording configuration. Inspect a controlled run using synthetic values before deciding what your project artifacts expose.
Could a trace archive contain an email verification link?
A verification link may appear in a page snapshot, screenshot, or network information if the test opens it or the application exposes it during the run. A trace is not a guaranteed copy of every email, and it is not guaranteed to omit links. Check the actual archive and any attached report using a test-only link.
What should a team inspect after a CI test fails?
Review the trace recording mode, the failed attempt and retry behavior, the report attachments, and the CI upload destination. Search the resulting files for synthetic codes, verification links, test addresses, authorization headers, and message content. Then check who can view, download, or retain those artifacts; local Playwright settings do not define the entire CI access boundary.
How can email codes stay out of Playwright test reports?
Use synthetic accounts and codes, avoid printing message bodies or secrets to test output, and retain only the evidence needed to diagnose failures. Configure trace collection deliberately, restrict report access, and remove old artifacts under the team's retention rules. Re-run the test and inspect the resulting files; masking alone does not prove that other copies are safe.