Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[UITests] BrowserRobot verifyPageContent() fails on random tests #10642

Closed
sv-ohorvath opened this issue May 14, 2020 · 14 comments · Fixed by #10928
Closed

[UITests] BrowserRobot verifyPageContent() fails on random tests #10642

sv-ohorvath opened this issue May 14, 2020 · 14 comments · Fixed by #10928
Assignees
Labels
eng:automation Build automation, Continuous integration, .. eng:intermittent-test Evil test failures that only happen now-and-then and are a productivity killer

Comments

@sv-ohorvath sv-ohorvath added eng:automation Build automation, Continuous integration, .. eng:intermittent-test Evil test failures that only happen now-and-then and are a productivity killer labels May 14, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label May 14, 2020
@sv-ohorvath sv-ohorvath removed the needs:triage Issue needs triage label May 14, 2020
@sv-ohorvath sv-ohorvath self-assigned this May 14, 2020
@sv-ohorvath
Copy link
Contributor Author

enterURLAndEnterToBrowser() was failing because the notification shade was open covering the app :| Will be fixed in #10649

@sv-ohorvath
Copy link
Contributor Author

verifyPageContent() was fixed by 32e74aa

@TejaswiKarasani
Copy link
Contributor

@sv-ohorvath sv-ohorvath changed the title [UITests] BrowserRobot verifyPageContent() and enterURLAndEnterToBrowser() fail random tests [UITests] BrowserRobot verifyPageContent() fails on random tests May 22, 2020
@isabelrios
Copy link
Contributor

@TejaswiKarasani I may be wrong but I don't think is the same issue. I understood from the test and the video of the failure that it is failing on Homscreen trying to open the menu. I don't see that open in the video.. Once you fix that robot transition commented on the PR, let's see if it keeps failing and where...thanks!

@TejaswiKarasani
Copy link
Contributor

@TejaswiKarasani I may be wrong but I don't think is the same issue. I understood from the test and the video of the failure that it is failing on Homscreen trying to open the menu. I don't see that open in the video.. Once you fix that robot transition commented on the PR, let's see if it keeps failing and where...thanks!

Yeah I will fix that and re-test it again🙌.

@sv-ohorvath
Copy link
Contributor Author

@AaronMT I can't reproduce locally any of these failing tests. Do you have any suggestions on how to prevent it from failing? Or, do you think we need a developer looking into it?

@AaronMT
Copy link
Contributor

AaronMT commented May 25, 2020

Yes, ideally we should be using SessionLoadedIdlingResource but these pages load so fast from local server that the timing of the idling resource count is not ideal

https://github.com/mozilla-mobile/fenix/blob/bc11bfae96b90a639aba3dccf34a766f41cf7df3/app/src/androidTest/java/org/mozilla/fenix/helpers/SessionLoadedIdlingResource.kt

@AaronMT
Copy link
Contributor

AaronMT commented May 28, 2020

I also think it might be simple as By.textContains instead of text() call, I have a change in my draft PR #10928

@AaronMT
Copy link
Contributor

AaronMT commented Jun 3, 2020

This still seems to be problematic despite the change. Some thoughts in my head (I don't know enough about UI Automator about why this function is hitting a timeout so often):

Here's the problematic function

fun verifyPageContent(expectedText: String) {
        val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
        mDevice.waitNotNull(Until.findObject(By.textContains(expectedText)), waitingTime)
    }

Depending on what the test is doing can this declaration of UIDevice get the wrong instance? Should mDevice be defined earlier? It seems like mDevice is never not null so perhaps something is going awry here. Why this function in particular?

Should we just kill this function entirely?

@AaronMT AaronMT reopened this Jun 3, 2020
@AaronMT AaronMT assigned AaronMT and unassigned sv-ohorvath Jun 5, 2020
@AaronMT
Copy link
Contributor

AaronMT commented Jun 12, 2020

My only guess is that the layout tree at the time of the waitNotNull tree check does not reflect the current layout tree at the time of idle page content. You can see this in the video, the page is fully loaded but the waitNotNull check still fails. The snapshot at the time is wrong. I don't know how to proceed here. I'm in favor of removing the function.

@rpappalax
Copy link
Contributor

rpappalax commented Jun 12, 2020

@AaronMT OK, fair enough. @AaronMT @sv-ohorvath So if we remove the verify content, do we have an alternative verify or if we skip it, does that weaken the validity of the test?

@sv-ohorvath
Copy link
Contributor Author

Disabled for now the most frequent failures:
HistoryTest: deleteMultipleSelectionTest, openHistoryInPrivateTabTest
TabbedBrowsingTest: openNewPrivateTabTest, openNewTabTest
NavToolbarTest: refreshPageTest

sv-ohorvath pushed a commit that referenced this issue Jun 18, 2020
* for #11642: disables tests crashing

* for #10642: disables frequently failing  tests
AaronMT added a commit that referenced this issue Jun 18, 2020
fix: expectedText not called warning
rpappalax pushed a commit that referenced this issue Jun 18, 2020
fix: expectedText not called warning
@liuche liuche mentioned this issue Jun 27, 2020
12 tasks
@sv-ohorvath
Copy link
Contributor Author

Fixed in #12499 I think this can be closed.

@data-sync-user data-sync-user changed the title [UITests] BrowserRobot verifyPageContent() fails on random tests FNX-4612 ⁃ [UITests] BrowserRobot verifyPageContent() fails on random tests Aug 10, 2020
@data-sync-user data-sync-user changed the title FNX-4612 ⁃ [UITests] BrowserRobot verifyPageContent() fails on random tests FNX3-14046 ⁃ [UITests] BrowserRobot verifyPageContent() fails on random tests Aug 10, 2020
@data-sync-user data-sync-user changed the title FNX3-14046 ⁃ [UITests] BrowserRobot verifyPageContent() fails on random tests FNX-4612 ⁃ [UITests] BrowserRobot verifyPageContent() fails on random tests Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX-4612 ⁃ [UITests] BrowserRobot verifyPageContent() fails on random tests FNX2-13226 ⁃ [UITests] BrowserRobot verifyPageContent() fails on random tests Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX2-13226 ⁃ [UITests] BrowserRobot verifyPageContent() fails on random tests [UITests] BrowserRobot verifyPageContent() fails on random tests May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
eng:automation Build automation, Continuous integration, .. eng:intermittent-test Evil test failures that only happen now-and-then and are a productivity killer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants