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 Test Utils: Add new openPreviewPage utility #21678

Closed
aduth opened this issue Apr 17, 2020 · 1 comment
Closed

E2E Test Utils: Add new openPreviewPage utility #21678

aduth opened this issue Apr 17, 2020 · 1 comment
Labels
Needs Dev Ready for, and needs developer efforts [Tool] E2E Test Utils /packages/e2e-test-utils [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@aduth
Copy link
Member

aduth commented Apr 17, 2020

Previously: #21467 (comment)

Context:

In end-to-end tests, it can often be useful to make assertions against the actual front-end content display of a published or previewed post.

This already occurs in two tests:

Task:

  1. Create a new openPreviewPage utility in @wordpress/e2e-test-utils
  2. Update existing tests above to use this utility

Implementation Notes:

The utility may or may not make sense to port directly from these implementations.

Notably, managing an extra preview page tab adds some additional overhead in managing tabs, especially "bring to front" and "close" clean-up tasks. These are not particularly difficult to implement using Puppeteer APIs, but they must be known to be performed, and as such introduce a risk for human error. A good utility may seek to try to remove the need for these considerations.

For example, one of the following may be an improvement:

  • Refactor to preview the page in the same tab.
  • Create some convention for "scoping" evaluation, in a way similar to Puppeteer's page.evaluate, which has the advantage of: The utility can manage clean-up tasks after the evaluation has completed.
@aduth aduth added [Type] Task Issues or PRs that have been broken down into an individual action to take Good First Issue An issue that's suitable for someone looking to contribute for the first time [Tool] E2E Test Utils /packages/e2e-test-utils and removed Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Apr 17, 2020
@gziolo gziolo added the Needs Dev Ready for, and needs developer efforts label May 9, 2020
@Mamaduka
Copy link
Member

This was fixed via #26355.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Dev Ready for, and needs developer efforts [Tool] E2E Test Utils /packages/e2e-test-utils [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

3 participants