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

Use username and password from shared config in call to login on @wordpress/e2e-test-utils #42742

Open
rafaelzaleski opened this issue Jul 27, 2022 · 0 comments
Labels
[Package] E2E Test Utils /packages/e2e-test-utils [Type] Bug An existing feature does not function as intended

Comments

@rafaelzaleski
Copy link

Description

E2E tests fail in environments where the default username and password are not admin and password because these values are hardcoded in the login function. We need to use the values from the shared config (because they can be overridden in the env variables) instead of hardcode it in the login function.

Step-by-step reproduction instructions

  1. Try to run tests in an E2E environment with the admin user username and password other than admin and password.
  2. Call the login function from the issue description inside a test case.
  3. There should be an error in your test case: Fetch api call failed for ${ apiFetch.nonceEndpoint }: ${ response.status }

Screenshots, screen recording, code snippet

No response

Environment info

  • @wordpress/e2e-test-utils 7.9.0
  • Latest version of WordPress

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@talldan talldan added [Type] Bug An existing feature does not function as intended [Package] E2E Test Utils /packages/e2e-test-utils labels Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Test Utils /packages/e2e-test-utils [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants