Skip to content

[UI Tests] - Update click element on image library#17323

Merged
pachlava merged 2 commits intotrunkfrom
uitii-publish-full-post-flaky-fix
Oct 13, 2022
Merged

[UI Tests] - Update click element on image library#17323
pachlava merged 2 commits intotrunkfrom
uitii-publish-full-post-flaky-fix

Conversation

@jostnes
Copy link
Copy Markdown
Contributor

@jostnes jostnes commented Oct 13, 2022

What

The e2ePublishFullPost test is flaky, most recently, it failed twice on this build before passing without any change on the third try. This PR is an attempt to fix that flakiness.

Why is the test failing

Looks like the test is failing because the supposed click sometimes acted like a long press, changing the flow of the test and making it fail (failing test video) From the video, it looks like the screen jumps from the image media gallery to a full-screen photo view:

From this:
image

To this:
image

The only way to get to that view is by long-pressing the image from the gallery.

How can this (potentially) be fixed

There are two elements that we can choose to click from that view to select the image, the element used currently is image_thumbnail, and there is another element text_selection_count. The difference between the two is image_thumbnail has the attribute longClickable set to true. The same attribute for text_selection_count is false, by updating the element, the long-press should no longer happen on this test.

Screenshot 2022-10-13 at 1 36 27 PM

Screenshot 2022-10-13 at 1 36 45 PM

Testing

The test should work locally and in CI

@jostnes jostnes added [Type] Task UI Tests Anything related to automated UI Tests. labels Oct 13, 2022
@jostnes jostnes added this to the 21.0 milestone Oct 13, 2022
@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Oct 13, 2022

WordPress📲 You can test these changes on WordPress by downloading wordpress-installable-build-pr17323-e148fd1.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppWordPress
Build FlavorJalapeno
Build TypeDebug
Commite148fd1
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Oct 13, 2022

Jetpack📲 You can test these changes on Jetpack by downloading jetpack-installable-build-pr17323-e148fd1.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppJetpack
Build FlavorJalapeno
Build TypeDebug
Commite148fd1
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

}

public void openPostSetting() {
waitForElementToBeDisplayed(R.id.toolbar_main);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this wait because, during testing, this step failed once when the test wasn't able to click on the menu item (see: failing test video).

@jostnes jostnes marked this pull request as ready for review October 13, 2022 10:07
@jostnes jostnes requested a review from a team as a code owner October 13, 2022 10:07
Copy link
Copy Markdown
Contributor

@pachlava pachlava left a comment

Choose a reason for hiding this comment

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

Thank you for coming up with an alternative way of selecting an image @jostnes! 🤞 it will finally solve the flakiness. I have no review notes for this one - it all looks good 👍

@pachlava
Copy link
Copy Markdown
Contributor

I'm going to take a liberty of merging this one, because I think it's better to have the fix as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Task UI Tests Anything related to automated UI Tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants