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

Make reusable block e2e tests independent. #21985

Closed
wants to merge 5 commits into from

Conversation

sainthkh
Copy link
Contributor

Description

Made reusable block e2e tests independent.

How has this been tested?

e2e tested with code.

Screenshots

N/A

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • [N/A] My code follows the WordPress code style.
  • [N/A] My code follows the accessibility standards.
  • [N/A] My code has proper inline documentation.
  • [N/A] I've included developer documentation if appropriate.
  • [N/A] I've updated all React Native files affected by any refactorings/renamings in this PR.

@@ -165,40 +209,19 @@ describe( 'Reusable blocks', () => {
} );

it( 'can be inserted after refresh', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After investigating, I learned that can be inserted and edited and can be inserted after refresh are different tests.

  • can be inserted and edited focuses on testing creating and editing in one writing session.
  • can be inserted after refresh focuses on testing the reusable block is saved correctly to the database and loaded without fail when writing a new post or editing existing ones.

@sainthkh sainthkh requested a review from noisysocks April 30, 2020 03:39
@sainthkh sainthkh marked this pull request as draft April 30, 2020 04:07
@sainthkh sainthkh force-pushed the fix/reusable-block-test branch from ebd5aa5 to 8d0d9a9 Compare May 1, 2020 00:48
@sainthkh sainthkh force-pushed the fix/reusable-block-test branch from a40bf8c to 0f11258 Compare May 1, 2020 02:31
@sainthkh sainthkh marked this pull request as ready for review May 1, 2020 02:47
Comment on lines +23 to +26
// When no reusable block is registered, return
if ( ( await page.$x( '//td[text()="No blocks found."]' ) ) !== null ) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a bit hard to find that this case was failing the tests.

@sainthkh
Copy link
Contributor Author

sainthkh commented May 1, 2020

@noisysocks It's ready for review. This PR:

  • removes reusable blocks if any.
  • creates new reusable block for each test.

@sainthkh sainthkh added the [Package] E2E Tests /packages/e2e-tests label May 1, 2020
@youknowriad
Copy link
Contributor

Thanks for your work here. For some reason, I missed this PR :(

I did an extensive refactor to this test a few weeks ago and I believe it's now based on independent tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Tests /packages/e2e-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reusable Blocks: Move E2E tests setup logic to a beforeAll()
2 participants