Skip to content

Commit b462134

Browse files
authored
[MTE-5019] - multiple fixes on flaky tests (#31090)
1 parent 973826c commit b462134

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ class BaseTestCase: XCTestCase {
466466
urlBar.pressWithRetry(duration: 2.0, element: pasteAction)
467467
mozWaitForElementToExist(app.tables["Context Menu"])
468468
pasteAction.waitAndTap()
469+
mozWaitForElementToExist(urlBar)
469470
mozWaitForValueContains(urlBar, value: url)
470471
}
471472

@@ -647,6 +648,7 @@ extension XCUIElement {
647648
func pressWithRetry(duration: TimeInterval, timeout: TimeInterval = TIMEOUT, element: XCUIElement) {
648649
BaseTestCase().mozWaitForElementToExist(self, timeout: timeout)
649650
self.press(forDuration: duration)
651+
sleep(1)
650652
var attempts = 5
651653
while !element.exists && attempts > 0 {
652654
self.press(forDuration: duration)

firefox-ios/firefox-ios-tests/Tests/XCUITests/NavigationTest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ class NavigationTest: BaseTestCase {
203203
// https://mozilla.testrail.io/index.php?/cases/view/2441496
204204
func testCopyLink() {
205205
longPressLinkOptions(optionSelected: "Copy Link")
206-
app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField].press(forDuration: 2)
206+
let searchBar = app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField]
207+
searchBar.pressWithRetry(duration: 2, element: app.tables["Context Menu"])
207208

208209
mozWaitForElementToExist(app.tables["Context Menu"])
209210
app.tables.buttons[AccessibilityIdentifiers.Photon.pasteAction].waitAndTap()

firefox-ios/firefox-ios-tests/Tests/XCUITests/StoryTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class StoryTests: BaseTestCase {
8484
waitForElementsToExist(
8585
[
8686
contextMenuTable.otherElements.staticTexts.firstMatch,
87-
contextMenuTable.otherElements.staticTexts.elementContainingText(".com"),
8887
contextMenuTable.cells.buttons[StandardImageIdentifiers.Large.plus],
8988
contextMenuTable.cells.buttons[StandardImageIdentifiers.Large.privateMode],
9089
contextMenuTable.cells.buttons[StandardImageIdentifiers.Large.bookmark],

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerSettingsNavigation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func registerSettingsNavigation(in map: MMScreenGraph<FxUserState>, app: XCUIApp
178178
let pasteAction = app.staticTexts["Paste"]
179179
sleep(1)
180180
UIPasteboard.general.string = searchEngineUrl
181-
customengineurlTextView.pressWithRetry(duration: 1.0, element: pasteAction)
181+
customengineurlTextView.pressWithRetry(duration: 1.5, element: pasteAction)
182182
pasteAction.waitAndTap()
183183
}
184184
screenState.backAction = navigationControllerBackAction(for: app)

0 commit comments

Comments
 (0)