Skip to content

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 29, 2026

Benchmark PR from agentic-review-benchmarks#2

Summary by CodeRabbit

Release Notes

  • Tests
    • Modernized test infrastructure with improved concurrency patterns for enhanced reliability and error handling.
    • Applied thread-safety improvements to UI testing operations across all test suites.
    • Updated test lifecycle methods to support better error propagation and asynchronous operation management.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Walkthrough

This pull request systematically updates the Firefox iOS test suite for Swift concurrency compliance. It converts test lifecycle methods (setUp/tearDown) across 30+ test files from synchronous to asynchronous throwing variants, and adds @MainActor annotations to test classes, registration functions, and UI helper functions to ensure main-thread execution.

Changes

Cohort / File(s) Summary
Test Lifecycle Methods (Async/Throws)
A11yOnboardingTests.swift, ActivityStreamTest.swift, BookmarksTests.swift, BrowsingPDFTests.swift, C_AddressesTests.swift, CookiePersistenceTests.swift, DatabaseFixtureTest.swift, DesktopModeTests.swift, DisplaySettingsTests.swift, DomainAutocompleteTests.swift, DragAndDropTests.swift, EngagementNotificationTests.swift, FeatureFlaggedTestBase.swift, HistoryTests.swift, HomePageSettingsUITest.swift, InactiveTabsTest.swift, IntegrationTests.swift, LoginsTests.swift, MicrosurveyTests.swift, MultiWindowTests.swift, OnboardingTests.swift, PerformanceTests.swift, PhotonActionSheetTests.swift, PrivateBrowsingTest.swift, ReadingListTests.swift, TabsTests.swift, ToolbarTest.swift, URLValidationTests.swift, ZoomingTests.swift
Convert setUp/tearDown methods from synchronous to async throws, updating super calls to use try await. Enables asynchronous setup/teardown operations and error propagation in test lifecycle.
Test Classes with MainActor
A11yUtils.swift, BaseTestCase.swift, ScreenGraphTest.swift
Add @MainActor attribute to test classes; BaseTestCase also annotates urlBarAddress and homepageSearchBar properties with @MainActor for thread-safe UI access.
Navigation Registration Functions
NavigationRegistry.swift, registerCommonNavigation.swift, registerContextMenuNavigation.swift, registerFxAccountNavigation.swift, registerHomePanelNavigation.swift, registerLibraryPanelNavigation.swift, registerMiscellanousActions.swift, registerMiscellanousNavigation.swift, registerMobileNavigation.swift, registerOnboardingNavigation.swift, registerSettingsNavigation.swift, registerTabMenuNavigation.swift, registerTabTrayNavigation.swift, registerToolbarNavigation.swift, registerTrackingProtection.swift, registerUrlBarNavigation.swift, registerZoomNavigation.swift
Add @MainActor annotation to navigation registration functions, constraining execution to main thread for UI interactions.
Screen Graph & Widget Helpers
FxScreenGraph.swift, TodayWidgetTests.swift
Add @MainActor to createScreenGraph factory function and introduce new @MainActor helper functions and constants (iOS_Settings, springboard, navigation actions, UI selection/typing utilities, widget existence checks).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 From sync to async, with throws so bright,
MainActor threads now guard the light,
Fifty files dance in concurrency's embrace,
Swift safety wins the testing race!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the main change: Swift 6 migration work to fix main actor isolation warnings/errors in XCUITests (Batch 2).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DatabaseFixtureTest.swift (1)

15-22: Guard against unexpected test names and missing fixtures.

parts[1] and fixtures[key]! can crash if the test name format changes or a fixture key is missing. Since setUp() now throws, fail gracefully instead of force-unwrapping.

🔧 Suggested fix
-        let parts = name.replacingOccurrences(of: "]", with: "").split(separator: " ")
-        let key = String(parts[1])
+        let parts = name.replacingOccurrences(of: "]", with: "").split(separator: " ")
+        guard parts.count > 1 else {
+            throw XCTSkip("Unexpected test name format: \(name)")
+        }
+        let key = String(parts[1])
+        guard let fixture = fixtures[key] else {
+            throw XCTSkip("Missing fixture for test: \(key)")
+        }
         launchArguments = [LaunchArguments.SkipIntro,
                            LaunchArguments.SkipWhatsNew,
                            LaunchArguments.SkipETPCoverSheet,
-                           LaunchArguments.LoadDatabasePrefix + fixtures[key]!,
+                           LaunchArguments.LoadDatabasePrefix + fixture,
                            LaunchArguments.SkipContextualHints,
                            LaunchArguments.DisableAnimations]
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (1)

139-142: Make forceRestartApp() async and await the overridden methods.

The custom setUp() async throws and tearDown() async throws overrides (which contain critical setup/teardown logic like setUpApp(), setUpScreenGraph(), and app.terminate()) are being skipped. Since forceRestartApp() is sync and calls these methods without await, it invokes the parent XCTestCase sync overloads instead. Update forceRestartApp() to async throws and await both calls, then update the call sites in AuthenticationTest.swift (line 52) and BookmarksTests.swift (line 401) to handle the async method.

Suggested fix
-    func forceRestartApp() {
-        tearDown()
-        setUp()
-    }
+    func forceRestartApp() async throws {
+        try await tearDown()
+        try await setUp()
+    }
🤖 Fix all issues with AI agents
In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift`:
- Around line 508-512: The overridden async test setup calls super.setUp()
without the required try; update the call in override func setUp() async throws
so the throwing async call uses try await (i.e., replace await super.setUp()
with try await super.setUp()) to properly propagate errors from the superclass
setup.

In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/FeatureFlaggedTestBase.swift`:
- Around line 46-50: The setup ordering is incorrect: move the call to
setUpExperimentVariables() to run before setUpApp() and setUpLaunchArguments()
inside override func setUp() so the implicitly unwrapped optionals jsonFileName
and featureName are initialized prior to being used by setUpApp() (and before
building launch arguments in setUpLaunchArguments()); update the sequence in
setUp() to call setUpExperimentVariables() first, then setUpApp(), then
setUpLaunchArguments() to prevent crashes or missing arguments.
- Around line 46-52: The override of setUp() in FeatureFlaggedTestBase
duplicates parent initialization; change it to call try await super.setUp() at
the top of FeatureFlaggedTestBase.setUp(), keep continueAfterFailure = false if
needed, then only perform test-specific setup like setUpExperimentVariables()
and setUpScreenGraph(); remove the direct calls to setUpApp() and
setUpLaunchArguments() here since the base class (and FeatureFlaggedTestBase's
setUpApp override) should manage app launch timing and launch args.
🧹 Nitpick comments (1)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)

10-15: Remove duplicate setup calls after super.setUp().
BaseTestCase already runs setUpApp() and setUpScreenGraph(), so calling them again here is redundant and can cause extra app launches or graph rebuilds.

♻️ Proposed cleanup
 override func setUp() async throws {
     try await super.setUp()
-    continueAfterFailure = false
-    setUpApp() // prepares launch arguments
-    setUpScreenGraph() // builds the MappaMundi navigator
     zoomBar = ZoomBarScreen(app: app)
 }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4257f9a and 81d28b8.

📒 Files selected for processing (51)
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/A11yOnboardingTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/A11yUtils.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/BookmarksTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/C_AddressesTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/DatabaseFixtureTest.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/DisplaySettingsTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/EngagementNotificationTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/FeatureFlaggedTestBase.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/FxScreenGraph.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/InactiveTabsTest.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/IntegrationTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/LoginsTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/MicrosurveyTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/MultiWindowTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/NavigationRegistry.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/PerformanceTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/PhotonActionSheetTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/ReadingListTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/ScreenGraphTest.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/TabsTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/TodayWidgetTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/ToolbarTest.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/URLValidationTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerCommonNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerContextMenuNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerFxAccountNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerHomePanelNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerLibraryPanelNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerMiscellanousActions.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerMiscellanousNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerMobileNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerOnboardingNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerSettingsNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerTabMenuNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerTabTrayNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerToolbarNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerTrackingProtection.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerUrlBarNavigation.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/registerZoomNavigation.swift
🧰 Additional context used
🧬 Code graph analysis (16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (11)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (4)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
  • iPad (357-362)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift (1)
  • setUp (31-51)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (1)
  • setUp (294-308)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)
  • setUp (46-65)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift (1)
  • setUp (25-39)
firefox-ios/firefox-ios-tests/Tests/XCUITests/InactiveTabsTest.swift (1)
  • setUp (9-29)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PhotonActionSheetTests.swift (1)
  • setUp (14-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)
  • setUp (301-306)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ReadingListTests.swift (1)
  • setUp (13-18)
firefox-ios/firefox-ios-tests/Tests/XCUITests/TabsTests.swift (1)
  • setUp (635-644)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)
  • setUp (10-16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/InactiveTabsTest.swift (15)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (2)
  • setUp (112-117)
  • setUp (508-513)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift (1)
  • setUp (31-51)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BookmarksTests.swift (1)
  • setUp (21-29)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (1)
  • setUp (96-104)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (1)
  • setUp (294-308)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)
  • setUp (46-65)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift (1)
  • setUp (25-39)
firefox-ios/firefox-ios-tests/Tests/XCUITests/IntegrationTests.swift (1)
  • setUp (23-44)
firefox-ios/firefox-ios-tests/Tests/XCUITests/LoginsTests.swift (1)
  • setUp (36-52)
firefox-ios/firefox-ios-tests/Tests/XCUITests/MicrosurveyTests.swift (1)
  • setUp (9-16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)
  • setUp (301-306)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ReadingListTests.swift (1)
  • setUp (13-18)
firefox-ios/firefox-ios-tests/Tests/XCUITests/TabsTests.swift (1)
  • setUp (635-644)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ToolbarTest.swift (1)
  • setUp (16-19)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)
  • setUp (10-16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/IntegrationTests.swift (6)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift (1)
  • setUp (31-51)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (1)
  • setUp (96-104)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (1)
  • setUp (294-308)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)
  • setUp (46-65)
firefox-ios/firefox-ios-tests/Tests/XCUITests/LoginsTests.swift (1)
  • setUp (36-52)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)
  • setUp (301-306)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ToolbarTest.swift (8)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (4)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
  • tearDown (119-122)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)
  • setUp (301-306)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ReadingListTests.swift (1)
  • setUp (13-18)
firefox-ios/firefox-ios-tests/Tests/XCUITests/TabsTests.swift (1)
  • setUp (635-644)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (2)
  • setUp (10-16)
  • tearDown (18-21)
firefox-ios/firefox-ios-tests/Tests/XCUITests/A11yOnboardingTests.swift (1)
  • tearDown (22-25)
firefox-ios/firefox-ios-tests/Tests/XCUITests/C_AddressesTests.swift (1)
  • tearDown (38-45)
firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift (1)
  • tearDown (27-33)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (4)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (6)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
  • setUpApp (95-102)
  • setUpScreenGraph (87-90)
  • tearDown (119-122)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)
  • setUp (301-306)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ToolbarTest.swift (2)
  • setUp (16-19)
  • tearDown (21-24)
firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift (1)
  • tearDown (27-33)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PerformanceTests.swift (4)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (3)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift (1)
  • setUp (11-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DatabaseFixtureTest.swift (1)
  • setUp (14-25)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DisplaySettingsTests.swift (1)
  • setUp (8-18)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift (13)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (3)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift (1)
  • setUp (31-51)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BookmarksTests.swift (1)
  • setUp (21-29)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift (1)
  • setUp (24-32)
firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift (1)
  • setUp (11-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (1)
  • setUp (96-104)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (1)
  • setUp (294-308)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)
  • setUp (46-65)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift (1)
  • setUp (25-39)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PhotonActionSheetTests.swift (1)
  • setUp (14-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)
  • setUp (301-306)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ReadingListTests.swift (1)
  • setUp (13-18)
firefox-ios/firefox-ios-tests/Tests/XCUITests/TabsTests.swift (1)
  • setUp (635-644)
firefox-ios/firefox-ios-tests/Tests/XCUITests/FeatureFlaggedTestBase.swift (12)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (4)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
  • setUpApp (95-102)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ScreenGraphTest.swift (1)
  • setUp (34-47)
firefox-ios/firefox-ios-tests/Tests/XCUITests/A11yOnboardingTests.swift (1)
  • setUp (14-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BookmarksTests.swift (1)
  • setUp (21-29)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift (1)
  • setUp (24-32)
firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift (1)
  • setUp (11-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DatabaseFixtureTest.swift (1)
  • setUp (14-25)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (1)
  • setUp (96-104)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DisplaySettingsTests.swift (1)
  • setUp (8-18)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift (1)
  • setUp (31-45)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (1)
  • setUp (294-308)
firefox-ios/firefox-ios-tests/Tests/XCUITests/EngagementNotificationTests.swift (1)
  • setUp (8-16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift (14)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (4)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
  • removeApp (72-85)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift (1)
  • setUp (31-51)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BookmarksTests.swift (1)
  • setUp (21-29)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift (1)
  • setUp (24-32)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (1)
  • setUp (96-104)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift (1)
  • setUp (31-45)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (1)
  • setUp (294-308)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)
  • setUp (46-65)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift (1)
  • setUp (25-39)
firefox-ios/firefox-ios-tests/Tests/XCUITests/LoginsTests.swift (1)
  • setUp (36-52)
firefox-ios/firefox-ios-tests/Tests/XCUITests/MultiWindowTests.swift (1)
  • setUp (13-19)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PhotonActionSheetTests.swift (1)
  • setUp (14-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)
  • setUp (301-306)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ToolbarTest.swift (1)
  • setUp (16-19)
firefox-ios/firefox-ios-tests/Tests/XCUITests/MicrosurveyTests.swift (5)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (3)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (1)
  • setUp (96-104)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)
  • setUp (46-65)
firefox-ios/firefox-ios-tests/Tests/XCUITests/InactiveTabsTest.swift (1)
  • setUp (9-29)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)
  • setUp (10-16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BookmarksTests.swift (4)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (4)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
  • tearDown (119-122)
firefox-ios/firefox-ios-tests/Tests/XCUITests/C_AddressesTests.swift (2)
  • setUp (16-36)
  • tearDown (38-45)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (3)
  • setUp (294-308)
  • tearDown (28-31)
  • tearDown (310-313)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)
  • tearDown (18-21)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ReadingListTests.swift (14)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (3)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift (1)
  • setUp (31-51)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BookmarksTests.swift (1)
  • setUp (21-29)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (1)
  • setUp (96-104)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (1)
  • setUp (294-308)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)
  • setUp (46-65)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift (1)
  • setUp (25-39)
firefox-ios/firefox-ios-tests/Tests/XCUITests/LoginsTests.swift (1)
  • setUp (36-52)
firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift (1)
  • setUp (16-25)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PhotonActionSheetTests.swift (1)
  • setUp (14-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)
  • setUp (301-306)
firefox-ios/firefox-ios-tests/Tests/XCUITests/TabsTests.swift (1)
  • setUp (635-644)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ToolbarTest.swift (1)
  • setUp (16-19)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)
  • setUp (10-16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DatabaseFixtureTest.swift (5)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (3)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ScreenGraphTest.swift (1)
  • setUp (34-47)
firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift (1)
  • setUp (11-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DisplaySettingsTests.swift (1)
  • setUp (8-18)
firefox-ios/firefox-ios-tests/Tests/XCUITests/EngagementNotificationTests.swift (1)
  • setUp (8-16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ScreenGraphTest.swift (9)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (3)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift (1)
  • setUp (31-51)
firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift (1)
  • setUp (11-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift (1)
  • setUp (31-45)
firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (1)
  • setUp (294-308)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)
  • setUp (46-65)
firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift (1)
  • setUp (25-39)
firefox-ios/firefox-ios-tests/Tests/XCUITests/PhotonActionSheetTests.swift (1)
  • setUp (14-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)
  • setUp (10-16)
firefox-ios/firefox-ios-tests/Tests/XCUITests/FxScreenGraph.swift (1)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (2)
  • waitAndTap (626-629)
  • tap (532-541)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift (4)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (3)
  • setUp (112-117)
  • setUp (508-513)
  • setUp (517-522)
firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift (1)
  • setUp (11-20)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ReadingListTests.swift (1)
  • setUp (13-18)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)
  • setUp (10-16)
🔇 Additional comments (64)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BrowsingPDFTests.swift (1)

24-26: Async setUp conversion looks correct.

Matches the async lifecycle pattern and properly awaits super.setUp().

firefox-ios/firefox-ios-tests/Tests/XCUITests/InactiveTabsTest.swift (1)

9-21: LGTM: async setUp alignment.
Matches the async/throws lifecycle pattern used elsewhere, and try await super.setUp() is correctly chained.

firefox-ios/firefox-ios-tests/Tests/XCUITests/LoginsTests.swift (1)

36-52: LGTM!

The Swift 6 migration changes are correctly applied:

  • setUp() is properly converted to async throws variant
  • The super.setUp() call correctly uses try await
  • The conditional removeApp() logic before super.setUp() is appropriately placed to ensure fresh install before the parent class initializes the app
firefox-ios/firefox-ios-tests/Tests/XCUITests/CookiePersistenceTests.swift (1)

11-20: LGTM!

The conversion to async throws setUp with try await super.setUp() is correct and consistent with the Swift 6 migration pattern applied across other test files in the suite (e.g., LoginsTests.swift, BookmarksTests.swift, HistoryTests.swift). The conditional removeApp() logic is appropriately placed before the super call.

firefox-ios/firefox-ios-tests/Tests/XCUITests/A11yUtils.swift (1)

3-4: LGTM! Appropriate @MainActor annotation for Swift 6 concurrency.

Adding @MainActor to A11yUtils is the correct approach since the class methods interact with XCUIElement and XCTest APIs (XCTContext.runActivity, XCTAttachment) that require main actor isolation in Swift 6.

firefox-ios/firefox-ios-tests/Tests/XCUITests/TabsTests.swift (1)

635-639: LGTM: async/throws setUp migration is consistent.
The async super call is properly awaited and scoped to the non‑iPad path.

firefox-ios/firefox-ios-tests/Tests/XCUITests/DragAndDropTests.swift (2)

294-307: Async setUp update looks correct.

The async/throwing signature and try await super.setUp() call align with Swift 6 concurrency expectations.


310-312: Async tearDown update looks correct.

try await super.tearDown() is the right adjustment for the async lifecycle method.

firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift (1)

300-306: LGTM! Correct Swift 6 async/await migration for setUp.

The conversion to async throws and using try await super.setUp() is the correct pattern for Swift 6 concurrency compliance in XCTest.

One observation on pre-existing logic: the conditional if !iPad() means super.setUp() is skipped on iPad devices. This appears intentional given the class name and specificForPlatform = .phone, but if this class is ever inadvertently run on iPad, base class initialization won't occur. The existing if skipPlatform { return } guards in test methods provide a safety net for this.

firefox-ios/firefox-ios-tests/Tests/XCUITests/C_AddressesTests.swift (2)

16-18: LGTM!

The conversion of setUp() to async throws with try await super.setUp() correctly aligns with Swift 6 concurrency requirements. The super call is appropriately placed at the beginning of the method.


38-45: LGTM!

The conversion of tearDown() to async throws with try await super.tearDown() is correct. The super call is appropriately placed at the end, ensuring subclass cleanup (theme switch, orientation reset, app termination) completes before the base class teardown.

firefox-ios/firefox-ios-tests/Tests/XCUITests/TodayWidgetTests.swift (6)

15-22: LGTM! Appropriate @MainActor annotations for Swift 6 compliance.

The @MainActor annotations correctly isolate these mutable global variables that access springboard.buttons, ensuring thread-safe access in Swift 6 strict concurrency mode. The existing TODO comment (line 14) appropriately tracks the technical debt of using global mutable state.


25-41: LGTM! Coordinate and screen size constants properly isolated.

The @MainActor annotations correctly handle the dependency chain (screenSizecenterRightX/centerRightYcoordinate). Swift's lazy initialization of global constants ensures these are evaluated in the correct order on the main actor when first accessed.


49-58: LGTM!

The @MainActor annotation is appropriate since the function accesses springboard.buttons which requires main actor isolation.


60-72: LGTM!

The @MainActor annotation correctly isolates this function that interacts with springboard UI elements (textFields, icons, swipeRight).


74-96: LGTM!

The @MainActor annotation is correct since this function calls widgetExist() (now @MainActor) and accesses springboard.buttons.


98-122: LGTM!

The @MainActor annotation is appropriate for this function that accesses springboard.buttons and springboard.swipeUp().

firefox-ios/firefox-ios-tests/Tests/XCUITests/URLValidationTests.swift (1)

14-15: LGTM!

The conversion to async throws setUp with try await super.setUp() correctly aligns with the Swift 6 migration pattern established in BaseTestCase and other test files in this PR.

firefox-ios/firefox-ios-tests/Tests/XCUITests/MicrosurveyTests.swift (1)

9-16: LGTM!

The async throws conversion maintains the correct operation order: setting launchArguments before super.setUp(), then launching the app. This matches the pattern used in other test files like InactiveTabsTest.swift.

firefox-ios/firefox-ios-tests/Tests/XCUITests/DesktopModeTests.swift (1)

96-104: LGTM!

The conditional setUp pattern for phone-only tests is correctly implemented, matching the established pattern in PrivateBrowsingTest.swift and TabsTests.swift. Screen objects are appropriately initialized after the conditional super call.

firefox-ios/firefox-ios-tests/Tests/XCUITests/IntegrationTests.swift (1)

23-44: LGTM!

The async throws conversion correctly follows the established pattern for test-specific database fixtures. The order of operations is preserved: parse test name → conditionally set launchArguments → append common arguments → call super.setUp().

firefox-ios/firefox-ios-tests/Tests/XCUITests/PerformanceTests.swift (1)

24-43: LGTM!

The async throws conversion maintains the correct setup flow for performance tests: initialize default launch arguments, conditionally append test-specific fixtures, then call super.setUp(). This aligns with the pattern in DatabaseFixtureTest.swift.

firefox-ios/firefox-ios-tests/Tests/XCUITests/ScreenGraphTest.swift (2)

10-11: LGTM!

The @MainActor annotation is appropriate for this test class since it directly interacts with XCUIApplication and UI elements. This ensures Swift 6 concurrency compliance for main-thread UI operations.


34-35: LGTM!

The async throws setUp conversion is correctly implemented and follows the same pattern applied across the test suite in this PR.

firefox-ios/firefox-ios-tests/Tests/XCUITests/ReadingListTests.swift (1)

13-14: Async setUp migration looks correct.
try await super.setUp() ensures base setup completes before screen initialization. Please confirm the test target’s minimum Xcode/Swift toolchain supports async/throws XCTest lifecycle methods.

firefox-ios/firefox-ios-tests/Tests/XCUITests/HomePageSettingsUITest.swift (1)

25-38: Async setUp update is consistent with the suite.
Keeping launch-argument setup before try await super.setUp() preserves the existing flow. Please confirm async XCTest lifecycle methods are supported by the minimum toolchain used in CI.

firefox-ios/firefox-ios-tests/Tests/XCUITests/MultiWindowTests.swift (2)

13-18: setUp async/throws migration looks good.
try await super.setUp() before per-test setup aligns with Swift 6 XCTest expectations. Please confirm CI’s toolchain supports async setUp/tearDown for UI tests.


21-25: tearDown async/throws migration looks good.
Cleaning up the split view before try await super.tearDown() preserves cleanup ordering. Please confirm async XCTest lifecycle methods are supported by the minimum toolchain used.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerTabTrayNavigation.swift (1)

9-10: Main-actor isolation here is appropriate.
This keeps UI navigation registration on the main thread, which matches XCTest UI constraints. Please confirm the Swift concurrency model/version for this target supports the @MainActor annotation.

firefox-ios/firefox-ios-tests/Tests/XCUITests/NavigationRegistry.swift (1)

9-10: Main-actor annotation on the registry entry point is consistent.
Constraining registration to the main actor aligns with UI-test threading requirements. Please confirm the Swift toolchain used in CI supports @MainActor on static methods.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerMiscellanousActions.swift (1)

8-9: Main-actor isolation is a good fit here.
Keeping action registration on the main thread aligns with XCTest UI constraints. Please confirm the Swift concurrency model/version for this test target supports @MainActor.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerZoomNavigation.swift (1)

8-9: Main-actor isolation for UI registration looks correct.
Good alignment with Swift 6 UI test requirements.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerContextMenuNavigation.swift (1)

8-9: Main-actor isolation for context menu navigation is appropriate.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerOnboardingNavigation.swift (1)

8-9: @mainactor on onboarding navigation registration is a good fit.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerToolbarNavigation.swift (1)

8-55: Consistent main-actor isolation for toolbar helpers and registration is solid.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerHomePanelNavigation.swift (1)

8-9: Main-actor isolation for home panel navigation looks good.

firefox-ios/firefox-ios-tests/Tests/XCUITests/DisplaySettingsTests.swift (1)

8-17: Async/throws lifecycle update is correctly applied.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerMobileNavigation.swift (1)

8-9: LGTM!

Adding @MainActor to this navigation registration function is the correct approach for Swift 6 compliance. The function interacts with XCUIApplication and registers UI gestures, which should execute on the main thread.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerTabMenuNavigation.swift (1)

8-9: LGTM!

The @MainActor annotation correctly ensures main-thread execution for this navigation registration function that configures UI test states.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerFxAccountNavigation.swift (1)

8-9: LGTM!

The @MainActor annotation is correctly applied to ensure Firefox Account navigation registration runs on the main thread, consistent with the broader Swift 6 migration across the test suite.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerCommonNavigation.swift (1)

8-9: LGTM!

The @MainActor annotation appropriately constrains this common navigation registration function to the main actor for Swift 6 compliance.

firefox-ios/firefox-ios-tests/Tests/XCUITests/PhotonActionSheetTests.swift (1)

14-20: LGTM!

The async/throws lifecycle migration is correctly implemented. The try await super.setUp() ensures proper async initialization and error propagation from the base class before initializing screen objects.

firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift (2)

30-51: LGTM!

The setUp() method is correctly migrated to async/throws. The launch arguments configuration before try await super.setUp() is appropriate, and screen object initialization after the parent setup is correct.


52-56: LGTM!

The tearDown() method is correctly migrated to async/throws. Setting device orientation before try await super.tearDown() ensures cleanup happens in the correct order.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerMiscellanousNavigation.swift (1)

8-9: LGTM — main-actor isolation fits UI navigation helpers.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerLibraryPanelNavigation.swift (1)

8-9: LGTM — appropriate main-actor annotation for UI navigation registration.

firefox-ios/firefox-ios-tests/Tests/XCUITests/HistoryTests.swift (1)

46-60: LGTM — async setUp with try await super is correctly wired.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerTrackingProtection.swift (1)

8-9: LGTM — main-actor isolation is appropriate here.

firefox-ios/firefox-ios-tests/Tests/XCUITests/BookmarksTests.swift (2)

21-22: LGTM — async setUp with try await super aligns with XCTest async lifecycle.


31-33: LGTM — async tearDown with try await super is consistent.

firefox-ios/firefox-ios-tests/Tests/XCUITests/ZoomingTests.swift (1)

18-20: LGTM — async tearDown with try await super is consistent.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerUrlBarNavigation.swift (1)

10-11: LGTM!

The @MainActor annotation is appropriate for this UI test helper function that interacts with XCUIApplication and UIPasteboard.general, ensuring thread-safe UI operations consistent with Swift 6 concurrency requirements.

firefox-ios/firefox-ios-tests/Tests/XCUITests/A11yOnboardingTests.swift (1)

14-25: LGTM!

The setUp and tearDown methods are correctly converted to async throws variants with proper try await calls to the superclass methods, consistent with the BaseTestCase contract and other test files in this migration.

firefox-ios/firefox-ios-tests/Tests/XCUITests/registerSettingsNavigation.swift (1)

8-9: LGTM!

The @MainActor annotation is correctly applied to this UI test navigation helper that performs extensive UI interactions with tables, cells, switches, and UIPasteboard. This aligns with the Swift 6 migration pattern applied to other register* functions in this PR.

firefox-ios/firefox-ios-tests/Tests/XCUITests/EngagementNotificationTests.swift (1)

8-16: LGTM!

The setUp method is correctly converted to async throws with proper try await super.setUp() invocation. The pattern matches CookiePersistenceTests.swift which handles the same iOS 17 removeApp() workaround.

firefox-ios/firefox-ios-tests/Tests/XCUITests/DomainAutocompleteTests.swift (1)

31-45: LGTM!

The setUp method is correctly converted to async throws with proper try await super.setUp() invocation after the conditional launchArguments configuration. This pattern is consistent with similar test files like HistoryTests.swift and ActivityStreamTest.swift.

firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift (1)

16-33: LGTM!

The setUp and tearDown methods are correctly converted to async throws variants. The initialization order is correct: launchArguments are set before super.setUp(), screen objects are initialized after (when app is available), and tearDown performs cleanup before calling super.tearDown().

firefox-ios/firefox-ios-tests/Tests/XCUITests/ToolbarTest.swift (1)

16-24: Lifecycle async migration looks good.
No concerns with the async/throws overrides and super calls.

firefox-ios/firefox-ios-tests/Tests/XCUITests/FxScreenGraph.swift (3)

10-25: Main-actor isolation on screen graph creation looks good.


132-163: Helper actions’ main-actor annotations look good.


127-130: No action required. Verification confirms these are the only module-level declarations of springboard and iOS_Settings in the test target. All other occurrences are function-scoped or class-scoped, which do not cause symbol collisions with module-level names.

firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (3)

13-16: Main‑actor UI element globals look good.


112-122: Async setUp/tearDown override looks good.


517-521: iPhone‑only async setup looks good.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +508 to 512
override func setUp() async throws {
specificForPlatform = .pad
if iPad() {
super.setUp()
await super.setUp()
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, find and read the specific file
find . -name "BaseTestCase.swift" -path "*XCUITests*" | head -5

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 156


🏁 Script executed:

# Check file size first
wc -l firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift 2>/dev/null || find . -name "BaseTestCase.swift" -type f | xargs wc -l

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 158


🏁 Script executed:

# Read the relevant section around lines 508-512
sed -n '500,520p' firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift 2>/dev/null || find . -name "BaseTestCase.swift" -type f -exec sed -n '500,520p' {} \;

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 639


🏁 Script executed:

# Search for the setUp method definition and its class hierarchy
rg -A 5 "override func setUp\(\) async throws" firefox-ios/firefox-ios-tests/Tests/XCUITests/ 2>/dev/null || rg -A 5 "func setUp.*async.*throws"

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 22447


🏁 Script executed:

# Check the parent class to verify setUp() signature
rg -B 5 "class BaseTestCase" firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift 2>/dev/null || rg "class BaseTestCase"

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 219


Add missing try keyword on throwing async super call.
super.setUp() is async throws; the call requires try.

Suggested fix
-        if iPad() {
-            await super.setUp()
-        }
+        if iPad() {
+            try await super.setUp()
+        }
🤖 Prompt for AI Agents
In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift` around
lines 508 - 512, The overridden async test setup calls super.setUp() without the
required try; update the call in override func setUp() async throws so the
throwing async call uses try await (i.e., replace await super.setUp() with try
await super.setUp()) to properly propagate errors from the superclass setup.

Comment on lines +46 to 50
override func setUp() async throws {
continueAfterFailure = false
setUpExperimentVariables()
setUpApp()
setUpExperimentVariables()
setUpLaunchArguments()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Initialize experiment variables before building launch arguments.

setUpApp() uses jsonFileName/featureName (Line 42–44), but setUpExperimentVariables() now runs after it (Line 49). Since those are IUOs meant to be set in setUpExperimentVariables(), this can crash or miss arguments.

💡 Suggested fix (restore safe ordering)
 override func setUp() async throws {
     continueAfterFailure = false
-    setUpApp()
-    setUpExperimentVariables()
+    setUpExperimentVariables()
+    setUpApp()
     setUpLaunchArguments()
     setUpScreenGraph()
 }
🤖 Prompt for AI Agents
In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/FeatureFlaggedTestBase.swift`
around lines 46 - 50, The setup ordering is incorrect: move the call to
setUpExperimentVariables() to run before setUpApp() and setUpLaunchArguments()
inside override func setUp() so the implicitly unwrapped optionals jsonFileName
and featureName are initialized prior to being used by setUpApp() (and before
building launch arguments in setUpLaunchArguments()); update the sequence in
setUp() to call setUpExperimentVariables() first, then setUpApp(), then
setUpLaunchArguments() to prevent crashes or missing arguments.

Comment on lines +46 to 52
override func setUp() async throws {
continueAfterFailure = false
setUpExperimentVariables()
setUpApp()
setUpExperimentVariables()
setUpLaunchArguments()
setUpScreenGraph()
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "*.swift" | head -20

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 1292


🏁 Script executed:

git ls-files | grep -i test | grep -i swift | head -20

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 1296


🏁 Script executed:

cat -n firefox-ios/firefox-ios-tests/Tests/XCUITests/FeatureFlaggedTestBase.swift | head -80

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 2901


🏁 Script executed:

# Find the parent class of FeatureFlaggedTestBase
rg "class FeatureFlaggedTestBase" -A 2

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 472


🏁 Script executed:

# Search for BaseTestCase definition
rg "class BaseTestCase" -A 20

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 6392


🏁 Script executed:

cat -n firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift | head -150

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 7051


🏁 Script executed:

# Check how XCTestCase.setUp is typically used
rg "override func setUp" firefox-ios/firefox-ios-tests/Tests/XCUITests/ -A 5 | head -100

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 9898


🏁 Script executed:

# Look for other test classes that extend BaseTestCase
rg "class.*: BaseTestCase" firefox-ios/firefox-ios-tests/Tests/XCUITests/

Repository: qodo-benchmark/firefox-ios-combined-coderabbit

Length of output: 6767


Refactor to call try await super.setUp() rather than duplicating parent setup logic.

FeatureFlaggedTestSuite.setUp() bypasses the entire parent initialization chain, inconsistent with BaseTestCase and the broader test codebase. While the intentional delay of app.launch() (via FeatureFlaggedTestBase's setUpApp override) is valid, this should not require skipping XCTestCase.setUp(). Refactor to call try await super.setUp() first, then override only what's needed for experiment setup.

🤖 Prompt for AI Agents
In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/FeatureFlaggedTestBase.swift`
around lines 46 - 52, The override of setUp() in FeatureFlaggedTestBase
duplicates parent initialization; change it to call try await super.setUp() at
the top of FeatureFlaggedTestBase.setUp(), keep continueAfterFailure = false if
needed, then only perform test-specific setup like setUpExperimentVariables()
and setUpScreenGraph(); remove the direct calls to setUpApp() and
setUpLaunchArguments() here since the base class (and FeatureFlaggedTestBase's
setUpApp override) should manage app launch timing and launch args.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants