File tree Expand file tree Collapse file tree 9 files changed +32
-18
lines changed
firefox-ios/firefox-ios-tests/Tests/XCUITests Expand file tree Collapse file tree 9 files changed +32
-18
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,13 @@ let testBLOBFileSize = "35 bytes"
1515class DownloadsTests : BaseTestCase {
1616 var downloadsScreen : DownloadsScreen !
1717 var browserScreen : BrowserScreen !
18- override func tearDown( ) {
19- defer { super. tearDown ( ) }
2018
21- guard let navigator = navigator else {
22- print ( " ⚠️ Navigator is nil in tearDown — skipping cleanup. " )
23- return
24- }
19+ override func tearDown( ) async throws {
20+ guard let navigator = navigator else {
21+ print ( " ⚠️ Navigator is nil in tearDown — skipping cleanup. " )
22+ return
23+ }
24+
2525 // The downloaded file has to be removed between tests
2626 app. terminate ( )
2727 app. launch ( )
@@ -37,7 +37,7 @@ class DownloadsTests: BaseTestCase {
3737 app. tables [ " DownloadsTable " ] . buttons [ " Delete " ] . waitAndTap ( )
3838 }
3939 }
40- super. tearDown ( )
40+ try await super. tearDown ( )
4141 }
4242
4343 private func deleteItem( itemName: String ) {
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ let websiteWithSearchField = "https://developer.mozilla.org/en-US/"
2424let tabTrayCollectionView = AccessibilityIdentifiers . TabTray. collectionView
2525
2626class DragAndDropTests : BaseTestCase {
27- // Disable test suite since in theory it does not make sense with Chron tabs implementation
28- override func tearDown( ) {
27+ // Disable test suite since in theory it does not make sense with Chron tabs implementation
28+ override func tearDown( ) async throws {
2929 XCUIDevice . shared. orientation = UIDeviceOrientation . portrait
30- super. tearDown ( )
30+ try await super. tearDown ( )
3131 }
3232
3333 // https://mozilla.testrail.io/index.php?/cases/view/2362645
Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ extension MMNavigator where T == FxUserState {
292292 performAction ( Action . LoadURLByTyping)
293293 }
294294
295+ @MainActor
295296 func mozWaitForElementToExist( _ element: XCUIElement , timeout: TimeInterval ? = TIMEOUT) {
296297 let startTime = Date ( )
297298
@@ -305,6 +306,7 @@ extension MMNavigator where T == FxUserState {
305306 }
306307
307308 // Opens a URL in a new tab.
309+ @MainActor
308310 func openNewURL( urlString: String ) {
309311 let app = XCUIApplication ( )
310312 mozWaitForElementToExist ( app. buttons [ AccessibilityIdentifiers . Toolbar. tabsButton] , timeout: 10 )
@@ -314,6 +316,7 @@ extension MMNavigator where T == FxUserState {
314316 }
315317
316318 // Add a new Tab from the New Tab option in Browser Tab Menu
319+ @MainActor
317320 func createNewTab( ) {
318321 let app = XCUIApplication ( )
319322 self . goto ( TabTray)
@@ -322,6 +325,7 @@ extension MMNavigator where T == FxUserState {
322325 }
323326
324327 // Add Tab(s) from the Tab Tray
328+ @MainActor
325329 func createSeveralTabsFromTabTray( numberTabs: Int ) {
326330 let app = XCUIApplication ( )
327331 for _ in 1 ... numberTabs {
Original file line number Diff line number Diff line change 55import XCTest
66
77class HomeButtonTests : BaseTestCase {
8- override func tearDown( ) {
8+ override func tearDown( ) async throws {
99 XCUIDevice . shared. orientation = . portrait
10- super. tearDown ( )
10+ try await super. tearDown ( )
1111 }
1212
1313 // https://mozilla.testrail.io/index.php?/cases/view/2306925
Original file line number Diff line number Diff line change @@ -119,13 +119,15 @@ private class TestActions {
119119 static let LoadURLByPasting = " LoadURLByPasting "
120120}
121121
122+ @MainActor
122123public var isTablet : Bool {
123124 // There is more value in a variable having the same name,
124125 // so it can be used in both predicates and in code
125126 // than avoiding the duplication of one line of code.
126127 return UIDevice . current. userInterfaceIdiom == . pad
127128}
128129
130+ @MainActor
129131private func createTestGraph( for test: XCTestCase , with app: XCUIApplication ) -> MMScreenGraph < TestUserState > {
130132 let map = MMScreenGraph ( for: test, with: TestUserState . self)
131133
Original file line number Diff line number Diff line change @@ -16,9 +16,14 @@ protocol WebsiteDataSelectorsSet {
1616 var EXAMPLE_CONTAINS : Selector { get }
1717 var CIRCLE_IMAGE_ANYWHERE : Selector { get }
1818 var STATIC_TEXT_EXAMPLE_IN_CELL : Selector { get }
19+
20+ @MainActor
1921 func clearAllLabel( in app: XCUIApplication ) -> XCUIElement
22+ @MainActor
2023 func circleImageInsideCells( _ app: XCUIApplication ) -> XCUIElement
24+ @MainActor
2125 func anyTableButton( _ app: XCUIApplication ) -> XCUIElement
26+
2227 var all : [ Selector ] { get }
2328}
2429
@@ -102,14 +107,17 @@ struct WebsiteDataSelectors: WebsiteDataSelectorsSet {
102107 groups: [ " settings " , " websitedata " ]
103108 )
104109
110+ @MainActor
105111 func clearAllLabel( in app: XCUIApplication ) -> XCUIElement {
106112 app. tables. cells [ IDs . clearAllCell] . staticTexts [ IDs . clearAllLabel]
107113 }
108114
115+ @MainActor
109116 func circleImageInsideCells( _ app: XCUIApplication ) -> XCUIElement {
110117 return app. cells. images. matching ( identifier: IDs . circleImageId) . firstMatch
111118 }
112119
120+ @MainActor
113121 func anyTableButton( _ app: XCUIApplication ) -> XCUIElement {
114122 return app. tables. buttons. firstMatch
115123 }
Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ import XCTest
77class SettingsTests : FeatureFlaggedTestBase {
88 var settingsScreen : SettingScreen !
99
10- override func tearDown( ) {
10+ override func tearDown( ) async throws {
1111 if name. contains ( " testAutofillPasswordSettingsOptionSubtitles " ) ||
1212 name. contains ( " testBrowsingSettingsOptionSubtitles " ) ||
1313 name. contains ( " testSettingsOptionSubtitlesDarkMode " ) ||
1414 name. contains ( " testSettingsOptionSubtitlesDarkModeLandscape " ) {
1515 switchThemeToDarkOrLight ( theme: " Light " )
1616 }
1717 XCUIDevice . shared. orientation = . portrait
18- super. tearDown ( )
18+ try await super. tearDown ( )
1919 }
2020
2121 private func checkShowImages( showImages: Bool = true ) {
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import Foundation
66import XCTest
77
88class SwipingTabsTests : BaseTestCase {
9- override func tearDown( ) {
9+ override func tearDown( ) async throws {
1010 XCUIDevice . shared. orientation = . portrait
11- super. tearDown ( )
11+ try await super. tearDown ( )
1212 }
1313
1414 let addressBar = XCUIApplication ( ) . textFields [ AccessibilityIdentifiers . Browser. AddressToolbar. searchTextField]
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import Foundation
66import XCTest
77
88class ToolbarMenuTests : BaseTestCase {
9- override func tearDown( ) {
9+ override func tearDown( ) async throws {
1010 XCUIDevice . shared. orientation = . portrait
11- super. tearDown ( )
11+ try await super. tearDown ( )
1212 }
1313
1414 // https://mozilla.testrail.io/index.php?/cases/view/2306840
You can’t perform that action at this time.
0 commit comments