Skip to content

Commit c1504f3

Browse files
committed
Add additional main actor isolation.
1 parent c032bba commit c1504f3

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DownloadsTests: BaseTestCase {
2121
print("⚠️ Navigator is nil in tearDown — skipping cleanup.")
2222
return
2323
}
24-
24+
2525
// The downloaded file has to be removed between tests
2626
app.terminate()
2727
app.launch()

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,15 @@ private class TestActions {
119119
static let LoadURLByPasting = "LoadURLByPasting"
120120
}
121121

122+
@MainActor
122123
public 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
129131
private func createTestGraph(for test: XCTestCase, with app: XCUIApplication) -> MMScreenGraph<TestUserState> {
130132
let map = MMScreenGraph(for: test, with: TestUserState.self)
131133

firefox-ios/firefox-ios-tests/Tests/XCUITests/Selectors/WebsiteDataSelectorSet.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)