-
Notifications
You must be signed in to change notification settings - Fork 528
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
Tests are failing on Espresso in AddProfileActivityTest #3363
Comments
@rt4914 It looks like a espresso scrolling issue, On testing it manually, it was working fine In case the nestedScrollTo() mentioned didn't work we can perform scrollTo() to the view above the targeted view. |
Tested this again on |
Try to repro the failing test result without emulator. They all ran 3 times and had identical results. Gist for failed test message: https://gist.github.com/XichengSpencer/c6f7b537ef783afc0ac56166f87ad1a4 |
After going through all the tests appear above one by one, I found two tests that were consistently failing while others passed. They are: fun testAddProfileActivity_inputPin_configChange_downloadAccessSwitchIsOn() where it scroll to a switch component. But as the screenshot shows, even our XML preview on the left has the switch component, when the app is running on the right the switch is gone. fun testAddProfileActivity_clickInfo_configChange_infoPopupIsDisplayed() oppia-android.AddProfileActivityTest.kt.oppia-android.app.2023-10-17.12-04-57.mp4This one tests the pop-up dialog will stay after the screens rotate, which I checked the code and didn't see such implementation. |
Here is the attempted code and discussion to fix testAddProfileActivity_configChange_inputShortPin_create_pinLengthError(). It fails to click the button to make the error message on the textinputlayout appears. |
This is the a screen record of test fail oppia-android.AddProfileActivityTest.kt.oppia-android.app.2023-11-15.18-46-22.mp4 |
<!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation Fix part of #3363 Remove testAddProfileActivity_inputPin_configChange_downloadAccessSwitchIsOn() as discussed with Ben and Adhiambo. - The old test failed when testing the checkbox should persevere its state after the screen rotated, which native checkbox doesn't have this ability and we agree that we don't need extra implementation to achieve this. Negate download access logic in AddProfileActivityPresenter so it will correctly set the listener. Improve testAddProfileActivity_configChange_inputShortPin_create_pinLengthError() by adding the swipeup() action to make the create button fully visible during the test but the test is still flaky ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only <!-- Delete these section if this PR does not include UI-related changes. --> If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide)) - For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing ![Screenshot 2023-11-15 160038](https://github.com/oppia/oppia-android/assets/74568012/54670e41-9a41-4368-a9cb-0b47b83abe8b) --------- Co-authored-by: Adhiambo Peres <[email protected]>
Tests are failing on Espresso in AddProfileActivityTest
testAddProfileActivity_inputPin_configChange_downloadAccessSwitchIsOn()
was removed in #5229. The behaviour was deemed not important to the UX.The test failed when testing the checkbox should preserve its state after the screen rotated, which native checkbox doesn't have this ability and we agree that we don't need extra implementation to achieve this.
testAddProfileActivity_configChange_inputShortPin_create_pinLengthError()
was improved in #5229, but it is still flaky. @XichengSpencer left some comments on this issue thread of his attempts to fix it, as well as a link to an external gist.Developers should run the third test multiple times to deterrmine if it is still flaky.
The text was updated successfully, but these errors were encountered: