зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1929837 - Improve running duration time for verifyCopyPDFTextOptionTest and verifyCopyTextOptionTest UI tests r=aaronmt
Based on the [[ https://storage.googleapis.com/mobile-allure-test-reports/Fenix/allure-report/index.html | Allure report ]] these UI tests had a 1m 30s running duration time. To improve the running times, I've removed some unnecessary steps from the UI test, reduced the waiting time in some cases and removed some unnecessary waits. Managed to improve the running durations as it follows: verifyCopyPDFTextOptionTest - From an average of 1m 34s to 41s (**running duration reduced by approx. 53s**) verifyCopyTextOptionTest - From an average of 1m 27s to 42s (**running duration reduced by approx. 45s**) Both UI tests successfully passed 100x on Firebase ✅ All UI tests successfully passed 2x on Firebase ✅ Differential Revision: https://phabricator.services.mozilla.com/D228307
This commit is contained in:
Родитель
788fe8f53a
Коммит
54ea8f28fd
|
@ -71,7 +71,6 @@ class TextSelectionTest : TestSetup() {
|
||||||
longClickPageObject(itemContainingText("content"))
|
longClickPageObject(itemContainingText("content"))
|
||||||
clickContextMenuItem("Copy")
|
clickContextMenuItem("Copy")
|
||||||
}.openNavigationToolbar {
|
}.openNavigationToolbar {
|
||||||
openEditURLView()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
searchScreen {
|
searchScreen {
|
||||||
|
@ -170,7 +169,6 @@ class TextSelectionTest : TestSetup() {
|
||||||
longClickPageObject(itemContainingText("Crossing"))
|
longClickPageObject(itemContainingText("Crossing"))
|
||||||
clickContextMenuItem("Copy")
|
clickContextMenuItem("Copy")
|
||||||
}.openNavigationToolbar {
|
}.openNavigationToolbar {
|
||||||
openEditURLView()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
searchScreen {
|
searchScreen {
|
||||||
|
|
|
@ -1503,7 +1503,7 @@ fun longClickPageObject(item: UiObject) {
|
||||||
fun clickContextMenuItem(item: String) {
|
fun clickContextMenuItem(item: String) {
|
||||||
mDevice.waitNotNull(
|
mDevice.waitNotNull(
|
||||||
Until.findObject(text(item)),
|
Until.findObject(text(item)),
|
||||||
waitingTime,
|
waitingTimeShort,
|
||||||
)
|
)
|
||||||
Log.i(TAG, "clickContextMenuItem: Trying to click context menu item: $item")
|
Log.i(TAG, "clickContextMenuItem: Trying to click context menu item: $item")
|
||||||
mDevice.findObject(text(item)).click()
|
mDevice.findObject(text(item)).click()
|
||||||
|
|
|
@ -304,13 +304,6 @@ class SearchRobot {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun longClickToolbar() {
|
fun longClickToolbar() {
|
||||||
Log.i(TAG, "longClickToolbar: Waiting for $waitingTime ms for $packageName window to be updated")
|
|
||||||
mDevice.waitForWindowUpdate(packageName, waitingTime)
|
|
||||||
Log.i(TAG, "longClickToolbar: Waited for $waitingTime ms for $packageName window to be updated")
|
|
||||||
Log.i(TAG, "longClickToolbar: Waiting for $waitingTime ms for the awesome bar to exist")
|
|
||||||
mDevice.findObject(UiSelector().resourceId("$packageName:id/awesomeBar"))
|
|
||||||
.waitForExists(waitingTime)
|
|
||||||
Log.i(TAG, "longClickToolbar: Waited for $waitingTime ms for the awesome bar to exist")
|
|
||||||
Log.i(TAG, "longClickToolbar: Waiting for $waitingTime ms for the toolbar to exist")
|
Log.i(TAG, "longClickToolbar: Waiting for $waitingTime ms for the toolbar to exist")
|
||||||
mDevice.findObject(UiSelector().resourceId("$packageName:id/toolbar"))
|
mDevice.findObject(UiSelector().resourceId("$packageName:id/toolbar"))
|
||||||
.waitForExists(waitingTime)
|
.waitForExists(waitingTime)
|
||||||
|
@ -321,9 +314,9 @@ class SearchRobot {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clickPasteText() {
|
fun clickPasteText() {
|
||||||
Log.i(TAG, "clickPasteText: Waiting for $waitingTime ms for the \"Paste\" option to exist")
|
Log.i(TAG, "clickPasteText: Waiting for $waitingTimeShort ms for the \"Paste\" option to exist")
|
||||||
mDevice.findObject(UiSelector().textContains("Paste")).waitForExists(waitingTime)
|
mDevice.findObject(UiSelector().textContains("Paste")).waitForExists(waitingTimeShort)
|
||||||
Log.i(TAG, "clickPasteText: Waited for $waitingTime ms for the \"Paste\" option to exist")
|
Log.i(TAG, "clickPasteText: Waited for $waitingTimeShort ms for the \"Paste\" option to exist")
|
||||||
Log.i(TAG, "clickPasteText: Trying to click the \"Paste\" button")
|
Log.i(TAG, "clickPasteText: Trying to click the \"Paste\" button")
|
||||||
mDevice.findObject(By.textContains("Paste")).click()
|
mDevice.findObject(By.textContains("Paste")).click()
|
||||||
Log.i(TAG, "clickPasteText: Clicked the \"Paste\" button")
|
Log.i(TAG, "clickPasteText: Clicked the \"Paste\" button")
|
||||||
|
@ -336,6 +329,7 @@ class SearchRobot {
|
||||||
assertUIObjectExists(
|
assertUIObjectExists(
|
||||||
itemWithResIdAndText("$packageName:id/mozac_browser_toolbar_edit_url_view", expectedText),
|
itemWithResIdAndText("$packageName:id/mozac_browser_toolbar_edit_url_view", expectedText),
|
||||||
exists = exists,
|
exists = exists,
|
||||||
|
waitingTime = waitingTimeShort,
|
||||||
)
|
)
|
||||||
|
|
||||||
fun verifySearchBarPosition(bottomPosition: Boolean) {
|
fun verifySearchBarPosition(bottomPosition: Boolean) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче