Streamline onboarding: Update E2E tests for the conditionally hidden WordPress.com account connection setting #2521
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
See #2487. This is meant to be added to the existing PR prior to final code review/merging. Opening this as a separate PR to ease internal review.
This updates the e2e tests following the removal of the WP.com account.
First, this moves the test for confirming that the WP.com card is not shown after it's connected to a new test described by "Connected WordPress.com account", which mocks the Jetpack connection before loading the page.
Second, one the WP.com account card is no longer shown, many of the following e2e tests that relied on nth-locators to find elements in the DOM needed to be refactored so that they work regardless of whether the WP.com card was present.
To do so, this updates the
getAccountCards()
method to accept options that get passed to the locator locator (see docs) to find a specific account card, which can then be used in other helper methods when trying to locate a specific title or description.Detailed test instructions:
wp-env
locally, runnpm run test:e2e -- setup-mc