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 Authorization Flow | Editor #400

Merged
merged 30 commits into from
Aug 14, 2019
Merged

Conversation

aaemnnosttv
Copy link
Collaborator

Summary

This PR is the first of the e2e tests that cover users other than the default (admin) user. As such it contains some foundational changes to the environment to install additional users, and utilities which will be useful in similar cases.

Addresses issue #256

Relevant technical choices

  • Adds the following users admin-2, editor, author, contributor
  • Adds mu-plugins for REST endpoints for setting various setup state which greatly decreases the time it takes for the initial (admin) setup before the test can get to the secondary user

Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 4.7 and PHP 5.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

@aaemnnosttv aaemnnosttv marked this pull request as ready for review August 13, 2019 17:34
@aaemnnosttv aaemnnosttv requested a review from swissspidy August 13, 2019 17:34
@aaemnnosttv
Copy link
Collaborator Author

@swissspidy I just updated the plugin reset test here as I've seen it fail a bit randomly due to a short expect timeout on a few other PRs builds. Upon reviewing this test, I found that we could make it much better by using some of these new utility routes to apply the setup in the DB to more accurately test a real reset. Previously when resetting, you would end up on step 4 due to the utility plugins in use forcing the auth/verification state via filters. Now it tests that you end up on step 1 of the set up after resetting and added a waitForSelector as well to eliminate the issue we were having before.

@swissspidy swissspidy mentioned this pull request Aug 14, 2019
6 tasks
@felixarntz felixarntz requested a review from swissspidy August 14, 2019 10:55
@aaemnnosttv
Copy link
Collaborator Author

@swissspidy I just pushed some updates to see how they run on Travis - something weird is happening in my local but it doesn't seem to be related to these changes.

@swissspidy
Copy link
Contributor

While I was not able to reproduce these issues with the tests locally, I noticed that the backstop tests fail on Travis while they pass locally... 🤔

@swissspidy
Copy link
Contributor

Passes now 🤷‍♂

Copy link
Contributor

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

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

Really excited about this change! Not only does it add a nice little e2e test for the auth flow as an editor, it also drastically improves the e2e setup as a whole and introduces a nice set of utilities for these tests as well. 🎉 💪

Oh, and it also fixes the unstable plugin reset test 🙂

Let's merge this, and then see from there.

@swissspidy swissspidy merged commit 012e45b into develop Aug 14, 2019
@swissspidy swissspidy deleted the feature/256-e2e-auth-flow-editor branch August 14, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants