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

Tests: Extract e2e test utils to their own package #13228

Merged
merged 2 commits into from
Jan 15, 2019

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Jan 7, 2019

Description

Part of #12313.

I did some final tweaks for the code organization related to e2e tests:

  • Extracted e2e test utils to their own package with all utils exposed for general usage as @wordpress/e2e-test-utils;
  • Renamed @wordpress/tests-e2e to @wordpress/e2e-tests to align with the newly extracted package name.
  • Moved all tests that verify the logic that depends on extensibility and test plugins to their own folder: specs/plugins/.
  • Reintroduced a simplified config file for e2e tests to make it easier to use it outside of Gutenberg.

How has this been tested?

npm run test-e2e
or
./node_modules/.bin/wp-scripts test-e2e --config ./packages/e2e-tests/jest.config.js

@gziolo gziolo added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Jan 7, 2019
@gziolo gziolo self-assigned this Jan 7, 2019
@gziolo gziolo added the [Status] In Progress Tracking issues with work in progress label Jan 7, 2019
@gziolo gziolo removed the [Status] In Progress Tracking issues with work in progress label Jan 8, 2019
@gziolo
Copy link
Member Author

gziolo commented Jan 8, 2019

@youknowriad - I haven't found a good way to run those tests from withing node_modules subfolder. We probably will have to use symlink with WordPress core to make it work. See related issues:

@gziolo
Copy link
Member Author

gziolo commented Jan 8, 2019

@gwwar @Copons - not sure if you are still looking into increasing code reuse from core for your e2e tests setup, but this PR tries to expose all test utils as a npm package. We exposed npm scripts which runs the e2e tests setup in one of the previous PRs. Once this code is published to npm, it should be easier to replicate a similar testing workflow.

@gziolo gziolo requested a review from gwwar January 8, 2019 13:13
@gziolo
Copy link
Member Author

gziolo commented Jan 8, 2019

@ryelle and @greatislander - we are close to having all parts of Gutenberg's setup exposed to npm. It may take a few more days (hopefully not weeks) to have it sorted out. It should drastically simplify the way you can use it outside of Gutenberg. I'm going to work on having tooling for a11y included in this setup as my next task.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

Currently, we were not able to execute a single end to end test case (e.g.: executing: npm run test-e2e packages/e2e-tests/specs/sidebar.test.js) this PR fixes that. Although I don't have deep knowledge of the changes they make sense to me 👍

@gziolo gziolo merged commit b786aad into master Jan 15, 2019
@gziolo gziolo deleted the update/expose-tests-e2e branch January 15, 2019 16:30
@gziolo gziolo added this to the 4.9 (Gutenberg) milestone Jan 15, 2019
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Tests: Move e2e tests dependent on plugins to their own folder

* Tests: Extract e2e test utils to their own package
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Tests: Move e2e tests dependent on plugins to their own folder

* Tests: Extract e2e test utils to their own package
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.

2 participants