From 406e56c4ff01fe4604362c3e5af4a9035764e514 Mon Sep 17 00:00:00 2001 From: dragosb01 Date: Tue, 9 Dec 2025 14:14:58 +0200 Subject: [PATCH 1/2] [MTE-5047] - auto tests improvements --- .../Tests/AccessibilityTestPlan.xctestplan | 1 - .../Tests/Smoketest.xctestplan | 1 - .../Tests/TAESmokeTestPlan.xctestplan | 1 - .../Tests/XCUITests/BaseTestCase.swift | 1 + .../Tests/XCUITests/OnboardingTests.swift | 53 ++++--------------- .../Tests/XCUITests/ShareLongPressTests.swift | 5 +- 6 files changed, 14 insertions(+), 48 deletions(-) diff --git a/firefox-ios/firefox-ios-tests/Tests/AccessibilityTestPlan.xctestplan b/firefox-ios/firefox-ios-tests/Tests/AccessibilityTestPlan.xctestplan index d57e282705d54..78a69588cc5c0 100644 --- a/firefox-ios/firefox-ios-tests/Tests/AccessibilityTestPlan.xctestplan +++ b/firefox-ios/firefox-ios-tests/Tests/AccessibilityTestPlan.xctestplan @@ -277,7 +277,6 @@ "OnboardingTests\/testOnboardingSignIn()", "OnboardingTests\/testSelectBottomPlacement()", "OnboardingTests\/testSelectTopPlacement()", - "OnboardingTests\/testWhatsNewPage()", "OpeningScreenTests", "OpeningScreenTests\/testLastOpenedTab()", "PerformanceTests", diff --git a/firefox-ios/firefox-ios-tests/Tests/Smoketest.xctestplan b/firefox-ios/firefox-ios-tests/Tests/Smoketest.xctestplan index 87c29f1846d66..96a5c787e1a0e 100644 --- a/firefox-ios/firefox-ios-tests/Tests/Smoketest.xctestplan +++ b/firefox-ios/firefox-ios-tests/Tests/Smoketest.xctestplan @@ -425,7 +425,6 @@ "OnboardingTests\/testOnboardingSignIn_TAE()", "OnboardingTests\/testSelectBottomPlacement()", "OnboardingTests\/testSelectTopPlacement()", - "OnboardingTests\/testWhatsNewPage()", "OpeningScreenTests", "PerformanceTests", "PhotonActionSheetTests\/testPinToShortcuts_TAE()", diff --git a/firefox-ios/firefox-ios-tests/Tests/TAESmokeTestPlan.xctestplan b/firefox-ios/firefox-ios-tests/Tests/TAESmokeTestPlan.xctestplan index e7e94ea3d24a2..eb27e4fd5dcdc 100644 --- a/firefox-ios/firefox-ios-tests/Tests/TAESmokeTestPlan.xctestplan +++ b/firefox-ios/firefox-ios-tests/Tests/TAESmokeTestPlan.xctestplan @@ -439,7 +439,6 @@ "OnboardingTests\/testOnboardingSignIn()", "OnboardingTests\/testSelectBottomPlacement()", "OnboardingTests\/testSelectTopPlacement()", - "OnboardingTests\/testWhatsNewPage()", "OpeningScreenTests", "OpeningScreenTests\/testLastOpenedTab()", "PerformanceTests", diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift index 6f1d0a5ecaa3d..07cdf477786fa 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift @@ -468,6 +468,7 @@ class BaseTestCase: XCTestCase { urlBar.pressWithRetry(duration: 2.0, element: pasteAction) mozWaitForElementToExist(app.tables["Context Menu"]) pasteAction.waitAndTap() + springboard.buttons["Allow Paste"].tapIfExists(timeout: 1.5) mozWaitForElementToExist(urlBar) mozWaitForValueContains(urlBar, value: url) } diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift index 2583d75699550..1b18fd6539fdc 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift @@ -26,7 +26,12 @@ class OnboardingTests: BaseTestCase { override func tearDown() async throws { if #available(iOS 17.0, *) { - switchThemeToDarkOrLight(theme: "Light") + if self.name.contains("testSelectBottomPlacement") && iPad() { + // Toolbar option not available for iPad, so the theme is not changed there. + return + } else { + switchThemeToDarkOrLight(theme: "Light") + } } app.terminate() try await super.tearDown() @@ -287,44 +292,6 @@ class OnboardingTests: BaseTestCase { firefoxHomePageScreen.assertTopSitesItemCellExist() } - // https://mozilla.testrail.io/index.php?/cases/view/2306815 - func testWhatsNewPage() throws { - throw XCTSkip("Skipping. The option whats new page is not available on the new menu") - /* - app.buttons["\(AccessibilityIdentifiers.Onboarding.closeButton)"].waitAndTap() - // Dismiss new changes pop up if exists - app.buttons["Close"].tapIfExists() - navigator.goto(BrowserTabMenu) - navigator.performAction(Action.OpenWhatsNewPage) - waitUntilPageLoad() - app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField].waitAndTap() - - // Extract version number from url - let url = app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField].value - let textUrl = String(describing: url) - let start = textUrl.index(textUrl.startIndex, offsetBy: 51) - let end = textUrl.index(textUrl.startIndex, offsetBy: 56) - let range = start.. Date: Sun, 25 Jan 2026 12:08:59 +0200 Subject: [PATCH 2/2] update pr --- .../firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift | 2 +- .../firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift | 2 +- .../Tests/XCUITests/ShareLongPressTests.swift | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift index 07cdf477786fa..da2b3414a80b5 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift @@ -468,7 +468,7 @@ class BaseTestCase: XCTestCase { urlBar.pressWithRetry(duration: 2.0, element: pasteAction) mozWaitForElementToExist(app.tables["Context Menu"]) pasteAction.waitAndTap() - springboard.buttons["Allow Paste"].tapIfExists(timeout: 1.5) + springboard.buttons["Allow Paste"].tapIfExists(timeout: 0.5) mozWaitForElementToExist(urlBar) mozWaitForValueContains(urlBar, value: url) } diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift index 1b18fd6539fdc..9841c9e8a1644 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift @@ -26,7 +26,7 @@ class OnboardingTests: BaseTestCase { override func tearDown() async throws { if #available(iOS 17.0, *) { - if self.name.contains("testSelectBottomPlacement") && iPad() { + if self.name.contains("testSelectBottomPlacement") || iPad() { // Toolbar option not available for iPad, so the theme is not changed there. return } else { diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/ShareLongPressTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/ShareLongPressTests.swift index e136619f60be0..71a82ea157c17 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/ShareLongPressTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/ShareLongPressTests.swift @@ -44,7 +44,7 @@ class ShareLongPressTests: FeatureFlaggedTestBase { } // https://mozilla.testrail.io/index.php?/cases/view/2864380 - func testBookmarksShareNormalWebsiteReminders() { + func verifyBookmarksShareNormalWebsiteReminders() { app.launch() if #available(iOS 17, *) { longPressBookmarkAndReachShareOptions(option: "Reminders") @@ -244,7 +244,7 @@ class ShareLongPressTests: FeatureFlaggedTestBase { navigator.goto(LibraryPanel_Bookmarks) // Long-press on a bookmarked website let contextMenu = app.tables["Context Menu"] - app.tables.cells.staticTexts["Example Domain"].pressWithRetry(duration: 1.5, element: contextMenu) + app.tables.cells.staticTexts["Example Domain"].pressWithRetry(duration: 0.5, element: contextMenu) // Tap the Share button in the context menu contextMenu.buttons["shareLarge"].waitAndTap() // Tap the Reminders button in the menu