From 54be740419f5c3320b8a41fa1bc8b6321354c9a0 Mon Sep 17 00:00:00 2001 From: dragosb01 Date: Tue, 22 Oct 2024 09:43:19 +0300 Subject: [PATCH] Preliminary changes for toolbar redesign --- .../AccessibilityIdentifiers.swift | 4 +- .../Tests/XCUITests/BaseTestCase.swift | 7 +++- .../Tests/XCUITests/BrowsingPDFTests.swift | 4 +- .../Tests/XCUITests/ClipBoardTests.swift | 9 ++-- .../XCUITests/DomainAutocompleteTests.swift | 4 +- .../Tests/XCUITests/FxScreenGraph.swift | 4 +- .../Tests/XCUITests/HistoryTests.swift | 2 +- .../Tests/XCUITests/HomeButtonTests.swift | 21 ++++------ .../XCUITests/HomePageSettingsUITest.swift | 21 ++++++++-- .../Tests/XCUITests/JumpBackInTests.swift | 2 +- .../Tests/XCUITests/MultiWindowTests.swift | 17 +++----- .../Tests/XCUITests/NavigationTest.swift | 14 +++---- .../Tests/XCUITests/OnboardingTests.swift | 10 +++-- .../Tests/XCUITests/OpeningScreenTests.swift | 4 +- .../XCUITests/PhotonActionSheetTests.swift | 2 +- .../Tests/XCUITests/PrivateBrowsingTest.swift | 4 +- .../Tests/XCUITests/ReadingListTests.swift | 31 +++++++++++++- .../Tests/XCUITests/SearchTest.swift | 17 ++++---- .../XCUITests/ThirdPartySearchTest.swift | 12 +++--- .../Tests/XCUITests/TodayWidgetTests.swift | 20 ++++----- .../Tests/XCUITests/ToolbarMenuTests.swift | 25 +++-------- .../Tests/XCUITests/ToolbarTest.swift | 24 ++++------- .../Tests/XCUITests/TopTabsTest.swift | 17 ++++---- .../XCUITests/TrackingProtectionTests.swift | 19 +++++---- .../Tests/XCUITests/URLValidationTests.swift | 10 +---- .../Tests/XCUITests/UrlBarTests.swift | 41 ++++--------------- .../toolbarRefactorFeature.yaml | 12 +++--- 27 files changed, 167 insertions(+), 190 deletions(-) diff --git a/firefox-ios/Client/Application/AccessibilityIdentifiers.swift b/firefox-ios/Client/Application/AccessibilityIdentifiers.swift index 5958bf6e680c8..f6a83b02fade5 100644 --- a/firefox-ios/Client/Application/AccessibilityIdentifiers.swift +++ b/firefox-ios/Client/Application/AccessibilityIdentifiers.swift @@ -19,7 +19,7 @@ public struct AccessibilityIdentifiers { static let urlBarBorder = "TabToolbar.urlBarBorder" static let settingsMenuButton = "TabToolbar.menuButton" static let homeButton = "TabToolbar.homeButton" - static let trackingProtection = "TabLocationView.trackingProtectionButton" + static let trackingProtection = "AddressToolbar.lockIcon" static let readerModeButton = "TabLocationView.readerModeButton" static let reloadButton = "TabLocationView.reloadButton" static let shareButton = "TabLocationView.shareButton" @@ -44,7 +44,7 @@ public struct AccessibilityIdentifiers { static let scanQRCodeButton = "urlBar-scanQRCode" static let cancelButton = "urlBar-cancel" static let searchTextField = "address" - static let url = "url" + static let url = "AddressToolbar.address" } struct KeyboardAccessory { diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift index 6bc8fcbdd1cc5..2ef48f2d8f315 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift @@ -9,7 +9,7 @@ import XCTest let page1 = "http://localhost:\(serverPort)/test-fixture/find-in-page-test.html" let page2 = "http://localhost:\(serverPort)/test-fixture/test-example.html" let serverPort = ProcessInfo.processInfo.environment["WEBSERVER_PORT"] ?? "\(Int.random(in: 1025..<65000))" -let urlBarAddress = XCUIApplication().textFields[AccessibilityIdentifiers.Browser.UrlBar.searchTextField] +let urlBarAddress = XCUIApplication().textFields[AccessibilityIdentifiers.Browser.UrlBar.url] func path(forTestPage page: String) -> String { return "http://localhost:\(serverPort)/test-fixture/\(page)" @@ -270,8 +270,10 @@ class BaseTestCase: XCTestCase { func checkBookmarksUpdated() { waitForTabsButton() - let numberOfRecentlyVisitedBookmarks = app.scrollViews + let bookmarksCell = app.scrollViews .cells[AccessibilityIdentifiers.FirefoxHomepage.Bookmarks.itemCell] + scrollToElement(bookmarksCell) + let numberOfRecentlyVisitedBookmarks = bookmarksCell .otherElements .otherElements .otherElements @@ -408,6 +410,7 @@ class BaseTestCase: XCTestCase { let result = XCTWaiter().wait(for: [expectation], timeout: timeout) XCTAssertEqual(result, .completed, "Element did not become hittable in time.") } + func switchThemeToDarkOrLight(theme: String) { mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.settingsMenuButton]) navigator.nowAt(BrowserTab) diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift index 5fd44eb934899..760b415d6f1fe 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift @@ -7,8 +7,8 @@ import Common let PDF_website = [ "url": "https://storage.googleapis.com/mobile_test_assets/public/pdf-test.pdf", - "pdfValue": "storage.googleapis.com/mobile_test_assets/public/pdf-test.pdf", - "urlValue": "yukon.ca/en/education-and-schools", + "pdfValue": "storage.googleapis.com", + "urlValue": "yukon.ca", "bookmarkLabel": "https://storage.googleapis.com/mobile_test_assets/public/pdf-test.pdf", "longUrlValue": "http://www.education.gov.yk.ca/" ] diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/ClipBoardTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/ClipBoardTests.swift index 90e35ad26d867..f044f00580afe 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/ClipBoardTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/ClipBoardTests.swift @@ -10,7 +10,7 @@ class ClipBoardTests: BaseTestCase { // Check for test url in the browser func checkUrl() { let urlTextField = app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url] - mozWaitForValueContains(urlTextField, value: "www.example") + mozWaitForValueContains(urlTextField, value: "example.com") } // Copy url from the browser @@ -18,7 +18,6 @@ class ClipBoardTests: BaseTestCase { navigator.goto(URLBarOpen) urlBarAddress.waitAndTap() if iPad() { - urlBarAddress.press(forDuration: 1) app.menuItems["Select All"].tap() } app.menuItems["Copy"].waitAndTap() @@ -64,8 +63,8 @@ class ClipBoardTests: BaseTestCase { navigator.nowAt(NewTabScreen) navigator.goto(URLBarOpen) urlBarAddress.press(forDuration: 3) - app.menuItems["Paste"].tap() - mozWaitForValueContains(urlBarAddress, value: "www.example.com") + app.otherElements["Paste"].tap() + mozWaitForValueContains(urlBarAddress, value: "http://www.example.com/") } // https://mozilla.testrail.io/index.php?/cases/view/2307051 @@ -84,7 +83,7 @@ class ClipBoardTests: BaseTestCase { app.otherElements[AccessibilityIdentifiers.Photon.pasteAndGoAction].tap() // The URL is pasted and the page is correctly loaded mozWaitForElementToExist(urlBar) - waitForValueContains(urlBar, value: "test-example.html") + waitForValueContains(urlBar, value: "localhost") mozWaitForElementToExist(app.staticTexts["Example Domain"]) } diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift index ad80db2826486..03d0818b0de5a 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift @@ -109,7 +109,7 @@ class DomainAutocompleteTests: BaseTestCase { // Check that the address field is empty and that the home panels are shown let value = urlBarAddress.value - XCTAssertEqual(value as? String, "", "The url has not been removed correctly") + XCTAssertEqual(value as? String, "Search or enter address", "The url has not been removed correctly") mozWaitForElementToExist(app.cells[AccessibilityIdentifiers.FirefoxHomepage.TopSites.itemCell]) } @@ -122,7 +122,7 @@ class DomainAutocompleteTests: BaseTestCase { navigator.goto(URLBarOpen) urlBarAddress.typeText("ex") if #available(iOS 16, *) { - mozWaitForValueContains(app.otherElements.textFields["Address Bar"], value: "www.example.com/") + mozWaitForValueContains(urlBarAddress, value: "example.com") let value = urlBarAddress.value XCTAssertEqual(value as? String, "example.com", "Wrong autocompletion") } diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/FxScreenGraph.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/FxScreenGraph.swift index 122dc681d194d..de16c2519223c 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/FxScreenGraph.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/FxScreenGraph.swift @@ -911,7 +911,7 @@ func createScreenGraph(for test: XCTestCase, with app: XCUIApplication) -> MMScr transitionTo: HomePanelsScreen ) screenState.tap( - app.otherElements[StandardImageIdentifiers.Large.tab], + app.otherElements[StandardImageIdentifiers.Large.privateMode], forAction: Action.OpenPrivateTabLongPressTabsButton, transitionTo: NewTabScreen ) { userState in @@ -960,7 +960,7 @@ func createScreenGraph(for test: XCTestCase, with app: XCUIApplication) -> MMScr ) screenState.tap( - app.buttons[AccessibilityIdentifiers.Toolbar.homeButton], + app.buttons[AccessibilityIdentifiers.Toolbar.addNewTabButton], forAction: Action.GoToHomePage ) { userState in } diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift index e948454679944..b4e2f2ee4ca27 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift @@ -426,7 +426,7 @@ class HistoryTests: BaseTestCase { urlBarForwardButton.press(forDuration: 1) app.tables.staticTexts["The Book of Mozilla"].waitAndTap() let url = app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url] - mozWaitForValueContains(url, value: "test-fixture/test-mozilla-book.html") + mozWaitForValueContains(url, value: "localhost") } // Private function created to select desired option from the "Clear Recent History" list diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/HomeButtonTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/HomeButtonTests.swift index c3ad7bd52c59b..077bc2a1e2b11 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/HomeButtonTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/HomeButtonTests.swift @@ -12,35 +12,30 @@ class HomeButtonTests: BaseTestCase { // https://mozilla.testrail.io/index.php?/cases/view/2306925 func testGoHome() throws { - if iPad() { - waitForTabsButton() - navigator.nowAt(NewTabScreen) - } navigator.openURL(path(forTestPage: "test-mozilla-org.html"), waitForLoading: true) - app.buttons[AccessibilityIdentifiers.Toolbar.homeButton].waitAndTap() + app.buttons[AccessibilityIdentifiers.Toolbar.addNewTabButton].waitAndTap() navigator.nowAt(NewTabScreen) waitForTabsButton() - XCTAssertEqual(app.buttons[AccessibilityIdentifiers.Toolbar.searchButton].label, "Search") - if iPad() { - navigator.nowAt(NewTabScreen) + if !iPad() { + XCTAssertEqual(app.buttons[AccessibilityIdentifiers.Toolbar.searchButton].label, "Search") } navigator.openURL(path(forTestPage: "test-mozilla-book.html"), waitForLoading: true) - mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.homeButton]) + mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.addNewTabButton]) XCUIDevice.shared.orientation = .landscapeRight - XCTAssertTrue(app.buttons["Home"].exists) - app.buttons["Home"].tap() + mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.addNewTabButton]) + app.buttons[AccessibilityIdentifiers.Toolbar.addNewTabButton].tap() navigator.nowAt(NewTabScreen) } // https://mozilla.testrail.io/index.php?/cases/view/2306883 - func testSwitchHomepageKeyboardNotRaisedUp() { + func testSwitchHomepageKeyboardRaisedUp() { // Open a new tab and load a web page navigator.openURL("http://localhost:\(serverPort)/test-fixture/find-in-page-test.html") waitUntilPageLoad() // Switch to Homepage by taping the home button - app.buttons[AccessibilityIdentifiers.Toolbar.homeButton].waitAndTap() + app.buttons[AccessibilityIdentifiers.Toolbar.addNewTabButton].waitAndTap() validateHomePageAndKeyboardNotRaisedUp() } diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift index 5fee77800a682..63185b25db66f 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift @@ -92,7 +92,7 @@ class HomePageSettingsUITests: BaseTestCase { waitUntilPageLoad() // Now check open home page should load the previously saved home page - let homePageMenuItem = app.buttons[AccessibilityIdentifiers.Toolbar.homeButton] + let homePageMenuItem = app.buttons[AccessibilityIdentifiers.Toolbar.addNewTabButton] homePageMenuItem.waitAndTap() waitUntilPageLoad() mozWaitForValueContains(app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url], value: "example") @@ -138,11 +138,16 @@ class HomePageSettingsUITests: BaseTestCase { mozWaitForElementToExist(app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url]) // Now after setting History, make sure FF home is set + app.buttons[AccessibilityIdentifiers.Browser.UrlBar.cancelButton].tap() navigator.goto(SettingsScreen) navigator.goto(NewTabSettings) navigator.performAction(Action.SelectHomeAsFirefoxHomePage) - navigator.performAction(Action.GoToHomePage) - mozWaitForElementToExist(app.cells[AccessibilityIdentifiers.FirefoxHomepage.TopSites.itemCell]) + if iPad() { + let homepage = AccessibilityIdentifiers.Settings.Homepage.self + mozWaitForElementToExist(app.cells[homepage.CustomizeFirefox.Shortcuts.settingsPage]) + } else { + mozWaitForElementToExist(app.cells[AccessibilityIdentifiers.FirefoxHomepage.TopSites.itemCell]) + } } // https://mozilla.testrail.io/index.php?/cases/view/2307031 @@ -258,8 +263,16 @@ class HomePageSettingsUITests: BaseTestCase { // Preconditons: Create 6 bookmarks & add 1 items to reading list bookmarkPages() addContentToReaderView() - navigator.performAction(Action.GoToHomePage) + if iPad() { + mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.tabsButton]) + app.buttons[AccessibilityIdentifiers.Toolbar.tabsButton].tap() + mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.TabTray.newTabButton]) + app.buttons[AccessibilityIdentifiers.TabTray.newTabButton].tap() + } else { + navigator.performAction(Action.GoToHomePage) + } mozWaitForElementToExist(app.staticTexts["Bookmarks"]) + app.buttons[AccessibilityIdentifiers.Browser.UrlBar.cancelButton].tap() navigator.performAction(Action.ToggleRecentlySaved) // On iPad we have the homepage button always present, // on iPhone we have the search button instead when we're on a new tab page diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/JumpBackInTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/JumpBackInTests.swift index 74716dd145837..3c4fcb855f983 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/JumpBackInTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/JumpBackInTests.swift @@ -108,7 +108,7 @@ class JumpBackInTests: BaseTestCase { // The view is switched to the twitter tab let url = app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url].value as! String - XCTAssertEqual(url, "www.wikipedia.org/") + XCTAssertEqual(url, "wikipedia.org") // Open a new tab in normal browsing navigator.goto(TabTray) diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/MultiWindowTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/MultiWindowTests.swift index 63cdb3733b551..45a7b5a6ec820 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/MultiWindowTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/MultiWindowTests.swift @@ -38,26 +38,19 @@ class MultiWindowTests: IpadOnlyTestCase { if skipPlatform { return } splitViewFromHomeScreen() // Access hamburger menu and tap on "new tab" - let menuButton = AccessibilityIdentifiers.Toolbar.settingsMenuButton - let newTab = StandardImageIdentifiers.Large.plus let tabsButtonIdentifier = AccessibilityIdentifiers.Toolbar.tabsButton let topSites = AccessibilityIdentifiers.FirefoxHomepage.TopSites.itemCell - let homeButtom = AccessibilityIdentifiers.Toolbar.homeButton + let homeButtom = AccessibilityIdentifiers.Toolbar.addNewTabButton // A new tab is opened in the same window app.collectionViews.cells.matching(identifier: topSites).firstMatch.waitAndTap() - mozWaitForElementToExist(app.buttons[homeButtom]) - app.buttons.matching(identifier: menuButton).element(boundBy: 0).tap() - mozWaitForElementToExist(app.tables.otherElements[newTab]) - app.tables.otherElements[newTab].tap() - app.buttons[AccessibilityIdentifiers.Browser.UrlBar.cancelButton].tap() + app.buttons[homeButtom].firstMatch.tap() + app.buttons[AccessibilityIdentifiers.Browser.UrlBar.cancelButton].firstMatch.tap() let tabButtonSecondWindow = app.buttons.matching(identifier: tabsButtonIdentifier).element(boundBy: 0) XCTAssertEqual(tabButtonSecondWindow.value as? String, "2", "Number of tabs opened should be equal to 2") // A new tab is opened in the same window app.collectionViews.cells.matching(identifier: topSites).element(boundBy: 6).waitAndTap() - mozWaitForElementToExist(app.buttons[homeButtom]) - app.buttons.matching(identifier: menuButton).element(boundBy: 1).tap() - app.tables.otherElements[newTab].tap() - app.buttons[AccessibilityIdentifiers.Browser.UrlBar.cancelButton].tap() + app.buttons[homeButtom].firstMatch.tap() + app.buttons[AccessibilityIdentifiers.Browser.UrlBar.cancelButton].firstMatch.tap() let tabButtonFirstWindow = app.buttons.matching(identifier: tabsButtonIdentifier).element(boundBy: 1) XCTAssertEqual(tabButtonFirstWindow.value as? String, "2", "Number of tabs opened should be equal to 2") } diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/NavigationTest.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/NavigationTest.swift index db9bf9ee6545d..a2c4a69b1c061 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/NavigationTest.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/NavigationTest.swift @@ -41,21 +41,21 @@ class NavigationTest: BaseTestCase { navigator.openURL(path(forTestPage: "test-example.html")) waitUntilPageLoad() let url = app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url] - mozWaitForValueContains(url, value: "test-example.html") + mozWaitForValueContains(url, value: "localhost") XCTAssertTrue(app.buttons[AccessibilityIdentifiers.Toolbar.backButton].isEnabled) XCTAssertFalse(app.buttons[AccessibilityIdentifiers.Toolbar.forwardButton].isEnabled) // Once a second url is open, back button is enabled but not the forward one till we go back to url_1 navigator.openURL(path(forTestPage: "test-mozilla-org.html")) waitUntilPageLoad() - mozWaitForValueContains(url, value: "test-mozilla-org.html") + mozWaitForValueContains(url, value: "localhost") XCTAssertTrue(app.buttons[AccessibilityIdentifiers.Toolbar.backButton].isEnabled) XCTAssertFalse(app.buttons[AccessibilityIdentifiers.Toolbar.forwardButton].isEnabled) // Go back to previous visited web site app.buttons[AccessibilityIdentifiers.Toolbar.backButton].tap() waitUntilPageLoad() - mozWaitForValueContains(url, value: "test-example.html") + mozWaitForValueContains(url, value: "localhost") if iPad() { app.buttons[AccessibilityIdentifiers.Toolbar.forwardButton].tap() @@ -64,7 +64,7 @@ class NavigationTest: BaseTestCase { app.buttons[AccessibilityIdentifiers.Toolbar.forwardButton].waitAndTap() } waitUntilPageLoad() - mozWaitForValueContains(url, value: "test-mozilla-org") + mozWaitForValueContains(url, value: "localhost") } // https://mozilla.testrail.io/index.php?/cases/view/2441489 @@ -351,7 +351,7 @@ class NavigationTest: BaseTestCase { // Check that there are no pop ups navigator.openURL(popUpTestUrl) - mozWaitForValueContains(app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url], value: "blocker.html") + mozWaitForValueContains(app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url], value: "localhost") mozWaitForElementToExist(app.webViews.staticTexts["Blocked Element"]) let numTabs = app.buttons["Show Tabs"].value @@ -445,7 +445,7 @@ class NavigationTest: BaseTestCase { XCTAssert(app.keyboards.count > 0, "The keyboard is not shown") app.typeText("example.com\n") - mozWaitForValueContains(urlBar, value: "example.com/") + mozWaitForValueContains(urlBar, value: "example.com") XCTAssertFalse(app.keyboards.count > 0, "The keyboard is shown") // swiftlint:enable empty_count } @@ -516,7 +516,7 @@ class NavigationTest: BaseTestCase { waitUntilPageLoad() if #available(iOS 16, *) { let url = app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url] - mozWaitForValueContains(url, value: "test-example.html") + mozWaitForValueContains(url, value: "localhost") XCTAssertTrue(backButton.isHittable, "Back button is not hittable") XCTAssertTrue(backButton.isEnabled, "Back button is disabled") backButton.tap() diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift index c5b1a9d5c5339..d5335538c69e2 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift @@ -191,12 +191,13 @@ class OnboardingTests: BaseTestCase { navigator.goto(BrowserTabMenu) navigator.performAction(Action.OpenWhatsNewPage) waitUntilPageLoad() + app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url].tap() // Extract version number from url let url = app.textFields[AccessibilityIdentifiers.Browser.UrlBar.url].value let textUrl = String(describing: url) - let start = textUrl.index(textUrl.startIndex, offsetBy: 43) - let end = textUrl.index(textUrl.startIndex, offsetBy: 48) + let start = textUrl.index(textUrl.startIndex, offsetBy: 51) + let end = textUrl.index(textUrl.startIndex, offsetBy: 56) let range = start.. 0, "The keyboard is not shown") - if iPad() { - XCTAssertTrue(iPadSearchIcon.exists) - XCTAssertTrue(iPadSearchIcon.isLeftOf(rightElement: urlBarAddress)) - } else { - XCTAssertTrue(iPhoneSearchIcon.exists) - XCTAssertTrue(iPhoneSearchIcon.isLeftOf(rightElement: urlBarAddress)) - } + let searchEngineLogo = app.images[AccessibilityIdentifiers.Browser.AddressToolbar.searchEngine] + mozWaitForElementToExist(searchEngineLogo) + XCTAssertTrue(searchEngineLogo.isLeftOf(rightElement: urlBarAddress)) } private func typeSearchTermAndHitGo(searchTerm: String) { diff --git a/firefox-ios/nimbus-features/toolbarRefactorFeature.yaml b/firefox-ios/nimbus-features/toolbarRefactorFeature.yaml index aa2e47f83e894..90f1971e57848 100644 --- a/firefox-ios/nimbus-features/toolbarRefactorFeature.yaml +++ b/firefox-ios/nimbus-features/toolbarRefactorFeature.yaml @@ -28,14 +28,14 @@ features: defaults: - channel: beta value: - enabled: false + enabled: true unified_search: false - one_tap_new_tab: false - navigation_hint: false + one_tap_new_tab: true + navigation_hint: true - channel: developer value: - enabled: false + enabled: true unified_search: false - one_tap_new_tab: false - navigation_hint: false + one_tap_new_tab: true + navigation_hint: true