Skip to content

Add block editor tests#15741

Merged
tiagomar merged 6 commits intodevelopfrom
ui-test-post-preview
Dec 30, 2021
Merged

Add block editor tests#15741
tiagomar merged 6 commits intodevelopfrom
ui-test-post-preview

Conversation

@tiagomar
Copy link
Contributor

@tiagomar tiagomar commented Dec 21, 2021

Description

After the classic editor was made unavailable for new posts a couple of tests covering post creation were disabled.
Since the ability to create a post is considered critical to be automated, this PR adds a few tests to the new block editor covering the disabled scenarios and a new scenario covering the HTML mode.

  • publishSimplePost: checks that a simple post with only title and text can be published.
  • publishFullPost: checks that a post with title, text, image, category and tag can be published.
  • blockEditorCanDisplayElementAddedInHtmlMode: checks that an element aded in HTML Mode can be displayed in Visual mode.

Testing Instructions

  • The Connected Tests-2 CI job is green, and you can see publishSimplePost,publishFullPost and blockEditorCanDisplayElementAddedInHtmlMode tests included.
  • Associated Firebase execution is also green (Firebase console access is needed to check this).
  • Tests run locally on Pixel 2 API 28 (this is the model used on CI).

Regression Notes

  1. Potential unintended areas of impact
    Changes would only affect ui tests.

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Checked that all tests are passing locally an on CI.

  3. What automated tests I added (or what prevented me from doing so)

  • publishSimplePost
  • publishFullPost
  • blockEditorCanDisplayElementAddedInHtmlMode

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Dec 21, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Dec 21, 2021

You can test the changes on this Pull Request by downloading the APKs:

@tiagomar tiagomar changed the title Test PR: Re-enable block editor test Add block editor tests Dec 27, 2021
@tiagomar tiagomar added the UI Tests Anything related to automated UI Tests. label Dec 27, 2021
@tiagomar tiagomar added this to the Future milestone Dec 27, 2021
@tiagomar tiagomar marked this pull request as ready for review December 27, 2021 20:34
Comment on lines +119 to +120
assertTrue("'Post published' toast was not displayed",
waitForElementToBeDisplayedWithoutFailure(onView(withText(R.string.post_published))));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 Having the assertion failure message as the first argument makes the code a bit confusing. assertTrue(boolean condition, String message) would make it better to read. ¯\_(ツ)_/¯

Copy link
Contributor

Choose a reason for hiding this comment

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

Completely agree with that, I needed a second look to see that that was supposed to be the error message.

@tiagomar tiagomar requested review from a team, jostnes and pachlava December 28, 2021 20:34
Copy link
Contributor

@jostnes jostnes left a comment

Choose a reason for hiding this comment

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

Added a curious question and a comment on the verification point for one of the test cases.

I don't understand the framework enough to give constructive comments, but the tests looks good to me!

Comment on lines +119 to +120
assertTrue("'Post published' toast was not displayed",
waitForElementToBeDisplayedWithoutFailure(onView(withText(R.string.post_published))));
Copy link
Contributor

Choose a reason for hiding this comment

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

Completely agree with that, I needed a second look to see that that was supposed to be the error message.

Copy link
Contributor

@jostnes jostnes left a comment

Choose a reason for hiding this comment

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

The tests look good to me! Tested this locally and tests are working as expected. CI runs are green as well.

@tiagomar tiagomar merged commit e917d48 into develop Dec 30, 2021
@tiagomar tiagomar deleted the ui-test-post-preview branch December 30, 2021 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI Tests Anything related to automated UI Tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants