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

PLANET-7171: Use WP Playwright E2E utils package #2060

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

lithrel
Copy link
Contributor

@lithrel lithrel commented Jul 7, 2023

Ref: https://jira.greenpeace.org/browse/PLANET-7171
Cf. https://www.npmjs.com/package/@wordpress/e2e-test-utils-playwright
Cf. https://github.com/WordPress/gutenberg/tree/trunk/packages/e2e-test-utils-playwright

Related to: greenpeace/planet4-plugin-gutenberg-blocks#1084

Test run on planet4-develop no flaky no fail 💪

Documentation is pretty sparse for @wordpress/e2e-test-utils-playwright, so I made a gist short list

We extend the WP package requestUtils class to avoid the theme setting issue, until this fix is merged and published.

  • Update Playwright to 1.35
  • Change BASE_URL env variable to WP_BASE_URL, to match package constraints
  • Add /playwright/.auth/ as a local authentication state storage
  • removed login(), nonce(), rest()

Main changes

  • replaced multiple login() by centralized test.useAdminLoggedIn()
  • replaced post creation by admin.createNewPost({})
  • replaced block insertion by interaction with editor.canvas and getByRole
  • replaced rest() by requestUtils.createPage(), requestUtils.rest()
  • admin navigation with admin.visitAdminPage
  • using dotenv to set various test timeouts, for default and CI, with local .env file overriding capacity

@lithrel lithrel self-assigned this Jul 7, 2023
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from c404d48 to 6ad6bde Compare July 7, 2023 15:40
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 7, 2023
/unhold 48e6aab3-c4a4-4a01-801a-3158621b4279
@planet-4
Copy link
Contributor

planet-4 commented Jul 7, 2023

Test instance is ready 🚀

🌑 atlas | admin | blocks report | CircleCI | composer-local.json

⌚ 2023.07.18 10:34:10

@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 6ad6bde to 84ccb47 Compare July 7, 2023 15:58
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 7, 2023
/unhold 7dc4a5ff-9b99-40fa-9d5c-245da680ac0e
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 84ccb47 to 297239f Compare July 7, 2023 16:17
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 7, 2023
/unhold b52e944c-68fe-4575-bc6b-0631e573ecc3
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 297239f to f22400d Compare July 7, 2023 16:37
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 7, 2023
/unhold 9a35a1ba-54e4-4d7c-9cbb-4cd79004c831
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from f22400d to 0f46c66 Compare July 7, 2023 16:52
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 7, 2023
/unhold 98330c85-9e2f-4b3e-8583-2218f094c8cf
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 0f46c66 to 2412a95 Compare July 7, 2023 17:15
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 7, 2023
/unhold c8dfac00-0bca-4715-a814-8978b00776b0
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 2412a95 to d9959f0 Compare July 7, 2023 18:52
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 7, 2023
/unhold 225f9791-954b-4bb5-99d5-b6d827458e6e
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from d9959f0 to a6eb55c Compare July 10, 2023 11:09
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 10, 2023
/unhold 57cd3bc3-85ef-4732-a2cf-4bdd644c74d5
@lithrel lithrel marked this pull request as ready for review July 10, 2023 14:02
@lithrel lithrel requested a review from mleray July 10, 2023 14:02
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 10, 2023
/unhold 8c3a8fbe-ff2a-4a81-90a7-e103c8dc88e3
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from a6eb55c to cb6fddb Compare July 11, 2023 12:56
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 11, 2023
/unhold 5ac92794-3f2d-4c98-affb-c0d83f7a9e0b
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch 2 times, most recently from 4ef9aea to 8fea465 Compare July 11, 2023 20:02
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 11, 2023
/unhold 26b7da66-24c5-4349-924b-29ee1f8d1069
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 8fea465 to 9ea9f3d Compare July 11, 2023 20:12
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 11, 2023
/unhold 52c6b6cc-7685-4816-9418-d10b8575abbd
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 9ea9f3d to 75b117f Compare July 11, 2023 20:22
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 11, 2023
/unhold 3b7f1c54-2ec5-4de7-8104-f35f40626955
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 75b117f to 91859c0 Compare July 17, 2023 07:44
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 17, 2023
/unhold 8108959d-179e-4c59-a8f9-bad864e70bfc
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 91859c0 to fa31306 Compare July 17, 2023 09:09
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 17, 2023
/unhold 0dfcd1a9-358e-4642-92ab-9cfe416c0b21
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from fa31306 to 700a785 Compare July 17, 2023 09:31
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 17, 2023
/unhold 90b903af-84cc-4117-a2d3-fa837abde469
@lithrel lithrel requested a review from mleray July 17, 2023 09:44
Copy link
Contributor

@mleray mleray left a comment

Choose a reason for hiding this comment

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

Code looks good to me, and tests pass on local too 👍

@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 700a785 to 17acf4f Compare July 18, 2023 06:53
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 18, 2023
/unhold 3bf37456-6e14-4431-bf5f-5134f75b6e64
@lithrel lithrel force-pushed the feature/use-wp-e2e-utils-7171 branch from 17acf4f to 9925657 Compare July 18, 2023 10:28
planet-4 added a commit to greenpeace/planet4-test-atlas that referenced this pull request Jul 18, 2023
/unhold 676938d3-65e0-4c58-84c9-1857618cfa68
@lithrel lithrel merged commit 0719e80 into main Jul 18, 2023
@lithrel lithrel deleted the feature/use-wp-e2e-utils-7171 branch July 18, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants