Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E: Cross-platform support for Playwright E2E tests #39765

Merged
merged 1 commit into from
Apr 16, 2022

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Mar 25, 2022

Fix: #39721, #40352

What?

This PR ensures that cross-platform valid absolute path strings are generated in configuration file path definitions.

Why?

In testDir and globalSetup, new URL().pathname is used to set the path, but it generates an invalid path string on some platforms.

How?

I followed the node documentation and wrapped new URL().href with url.fileURLToPath to generate a platform independent path.

The writing may be a little tricky, so please advise if you have a better solution.

Testing Instructions

  • npm run test-e2e:playwright
  • One test should run correctly as follows:
> playwright test --config test/e2e/playwright.config.ts

Running 1 test using 1 worker

  ✓  [chromium] › sanity.spec.js:8:2 › Sanity check › Expect site loaded (6s)


  1 passed (13s)

@t-hamano t-hamano added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Mar 25, 2022
Copy link
Member

@kevin940726 kevin940726 left a comment

Choose a reason for hiding this comment

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

Nice catch! Thanks for fixing this! 🧡

@kevin940726 kevin940726 merged commit 7c35f5f into trunk Apr 16, 2022
@kevin940726 kevin940726 deleted the e2e/playwright-cross-platform branch April 16, 2022 08:55
@github-actions github-actions bot added this to the Gutenberg 13.1 milestone Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Playwright config path issue in Git Bash on Windows
2 participants