Skip to content

Conversation

@andr317c
Copy link
Contributor

This PR focuses on logging all the Console Errors from the frontend while running our E2E test.

It allows us to see any errors we do not see in the UI while running the tests.

Copilot AI review requested due to automatic review settings May 26, 2025 07:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for capturing frontend console errors during E2E runs by initializing a console-errors.json file, wiring up a new CONSOLE_ERRORS_PATH environment variable, and publishing the log as a pipeline artifact.

  • Ensure console-errors.json is created/prepared in the postinstall script
  • Extend .env generation and config.js to include CONSOLE_ERRORS_PATH
  • Update nightly/azure pipelines to capture and publish the console error log

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Umbraco.Tests.AcceptanceTest/postinstall.js Initialize console-errors.json when missing
tests/Umbraco.Tests.AcceptanceTest/config.js Add CONSOLE_ERRORS_PATH to generated .env and cleanup duplicates
tests/Umbraco.Tests.AcceptanceTest/package.json Bump @umbraco/playwright-testhelpers dependency version
build/nightly-E2E-test-pipelines.yml Export CONSOLE_ERRORS_PATH and copy the log as an artifact
build/azure-pipelines.yml Export CONSOLE_ERRORS_PATH and copy the log as an artifact
Files not reviewed (1)
  • tests/Umbraco.Tests.AcceptanceTest/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

tests/Umbraco.Tests.AcceptanceTest/postinstall.js:24

  • Consider adding an automated test to verify that postinstall.js creates console-errors.json when it does not exist, ensuring this new behavior doesn't regress.
fs.writeFileSync(consoleErrorsPath, consoleErrorsFileContent);

Copy link
Contributor

@nhudinh0309 nhudinh0309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good but in the pipeline, where can I view the file which write the console log?

@andr317c
Copy link
Contributor Author

andr317c commented May 27, 2025

The console logs are in the same place as the trace.zips from our failed/flaky tests. In the published artefacts > Anyof the test workers > console-errors.json

Copy link
Contributor

@nhudinh0309 nhudinh0309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andr317c andr317c enabled auto-merge (squash) June 5, 2025 11:08
@andr317c andr317c merged commit c7dcbfe into main Jun 5, 2025
25 checks passed
@andr317c andr317c deleted the v16/QA/publish-console-log-error-e2e branch June 5, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants