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

Better e2e tests #789

Closed
ecgan opened this issue Jun 15, 2021 · 0 comments · Fixed by #801
Closed

Better e2e tests #789

ecgan opened this issue Jun 15, 2021 · 0 comments · Fixed by #801
Assignees
Labels
type: technical debt - external devX This issue/PR suffers from the ergonomics of external tools/dependencies type: technical debt This issue/PR represents/solves the technical debt of the project.

Comments

@ecgan
Copy link
Member

ecgan commented Jun 15, 2021

User story

This issue is to document the findings and effort to make e2e tests work for our plugin.

Previously in issue #42, we've put in a very minimal e2e test using @wordpress/env. Currently, when I check out the trunk branch and try to run npm run wp-env start, I'm encountering an error that says:

> wp-env "start"

✖ Error while running docker-compose command.
Creating 8c576243de2ac8c64a62d6e894aaf428_cli_run ... 
Creating 8c576243de2ac8c64a62d6e894aaf428_cli_run ... done
mysqlcheck: Got error: 1045: Access denied for user 'example username'@'172.18.0.5' (using password: YES) when trying to connect
2

The above error is documented and fixed in issue WordPress/gutenberg#29752.

I've also looked into e2e test in https://github.com/woocommerce/woocommerce and https://github.com/woocommerce/woocommerce-admin. They both uses @woocommerce/e2e-environment and @woocommerce/e2e-utils packages. There is also a @woocommerce/e2e-core-tests package that can be used to run e2e test for WooCommerce. I am able to run the e2e tests for https://github.com/woocommerce/woocommerce-admin successfully (although there is one failed test, due to programming error I believe).

So for our plugin here, the next step would be to remove the existing e2e tests based on @wordpress/env and @wordpress/e2e-test-utils, and instead rely on @woocommerce/e2e-environment and @woocommerce/e2e-utils.

The first iteration should cover basic "get started" things like the following:

  • Install and activate the plugin
  • Display the get started page
  • Display the Setup MC Step 1 page

We can cover account connections in the Setup MC Step 1 page in the next iteration. That would require us to mock API calls to WordPress.com and Google.

With the above foundation in place, it would be easier for us to incrementally add more e2e tests in the future.

@ecgan ecgan self-assigned this Jun 15, 2021
@jconroy jconroy added the type: technical debt This issue/PR represents/solves the technical debt of the project. label Jun 16, 2021
@tomalec tomalec added the type: technical debt - external devX This issue/PR suffers from the ergonomics of external tools/dependencies label Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: technical debt - external devX This issue/PR suffers from the ergonomics of external tools/dependencies type: technical debt This issue/PR represents/solves the technical debt of the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants