Skip to content
Snippets Groups Projects
Commit 2b44e37f authored by oana.horvath's avatar oana.horvath Committed by mergify[bot]
Browse files

Bug 1809609: adds UI test page content assertion and retries

parent 74d23bed
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html dir="ltr" xml:lang="en-US" lang="en-US">
<meta name="viewport" content="width=device-width">
<head>
<meta charset="UTF-8">
<title>adsTrackers</title>
......
......@@ -3,6 +3,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html dir="ltr" xml:lang="en-US" lang="en-US">
<meta name="viewport" content="width=device-width">
<head>
<meta charset="UTF-8">
<title>analyticsTrackers</title>
......
......@@ -3,6 +3,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html dir="ltr" xml:lang="en-US" lang="en-US">
<meta name="viewport" content="width=device-width">
<head>
<meta charset="UTF-8">
<title>otherTrackers</title>
......
......@@ -3,6 +3,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html dir="ltr" xml:lang="en-US" lang="en-US">
<meta name="viewport" content="width=device-width">
<head>
<meta charset="UTF-8">
<title>socialTrackers</title>
......
<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width">
<body>
<h1>Storage check</h1>
......
......@@ -50,7 +50,24 @@ class BrowserRobot {
)
fun verifyPageContent(expectedText: String) {
mDevice.wait(Until.findObject(By.textContains(expectedText)), waitingTime)
sessionLoadedIdlingResource = SessionLoadedIdlingResource()
runWithIdleRes(sessionLoadedIdlingResource) {
for (i in 1..RETRY_COUNT) {
try {
assertTrue(
webPageItemContainingText(expectedText).waitForExists(pageLoadingTime),
)
break
} catch (e: AssertionError) {
if (i == RETRY_COUNT) {
throw e
} else {
refreshPageIfStillLoading(expectedText)
}
}
}
}
}
fun verifyTrackingProtectionAlert(expectedText: String) {
......@@ -59,7 +76,7 @@ class BrowserRobot {
for (i in 1..RETRY_COUNT) {
try {
assertTrue(
mDevice.findObject(UiSelector().textContains(expectedText))
webPageItemContainingText(expectedText)
.waitForExists(pageLoadingTime),
)
// close the JavaScript alert
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment