Skip to content

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 29, 2026

Benchmark PR from agentic-review-benchmarks#13

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced paste permission handling in URL bar to gracefully manage system paste-allow alerts.
  • Tests

    • Updated test execution plans to enable previously skipped tests.
    • Improved test stability with enhanced context menu interactions and UI synchronization for iOS 16+.
    • Refined onboarding test behavior for iPad and specific test scenarios.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Walkthrough

The pull request enables a previously skipped test (OnboardingTests/testWhatsNewPage()) across three test plans and refactors test implementations to improve robustness and add conditional logic for platform-specific behavior.

Changes

Cohort / File(s) Summary
Test Plan Configuration
AccessibilityTestPlan.xctestplan, Smoketest.xctestplan, TAESmokeTestPlan.xctestplan
Removed OnboardingTests/testWhatsNewPage() from skipped test lists, enabling the test to execute as part of regular test runs.
Onboarding Test Logic
OnboardingTests.swift
Removed testWhatsNewPage() test method entirely; refactored tearDown() to conditionally skip theme switching on iPad and for specific tests; replaced post-setup skip guard in testSelectBottomPlacement with early XCTSkipIf at test start.
Base Test Infrastructure
BaseTestCase.swift
Added optional system paste-allow alert handling in openNewTabAndValidateURLisPaste() by tapping springboard.buttons["Allow Paste"] if present.
Share Long Press Tests
ShareLongPressTests.swift
Renamed testBookmarksShareNormalWebsiteReminders() to verifyBookmarksShareNormalWebsiteReminders(); enhanced longPressBookmarkAndReachShareOptions() with context menu refactoring using pressWithRetry() and added iOS 16+ synchronization waits.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A test awakens from its slumber deep,
No longer skipped, it's time to leap!
Robust alerts and iPad care,
Context menus tuned with flair—
Testing flows refined anew! 🎉

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title '[MTE-5047] - auto tests improvements' is vague and generic, using the non-descriptive term 'improvements' without conveying specific details about what was changed. Consider making the title more specific by highlighting the main changes, such as 'Re-enable testWhatsNewPage and improve test robustness' or 'Refactor onboarding and share tests for better reliability'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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: 1

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/BaseTestCase.swift (1)

463-472: Define springboard before using it.

springboard isn’t defined in this file or this method, so this will not compile unless a global exists elsewhere. Safer to define it locally here.

Proposed fix
     pasteAction.waitAndTap()
-    springboard.buttons["Allow Paste"].tapIfExists(timeout: 0.5)
+    let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
+    springboard.buttons["Allow Paste"].tapIfExists(timeout: 0.5)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ShareLongPressTests.swift (1)

47-58: Renaming drops XCTest discovery.

Methods without the test prefix won’t run. If this is meant to stay as a test, rename it back or ensure test plans reference the new name explicitly.

Proposed fix
-    func verifyBookmarksShareNormalWebsiteReminders() {
+    func testBookmarksShareNormalWebsiteReminders() {
🤖 Fix all issues with AI agents
In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift`:
- Around line 28-35: The tearDown currently returns early under iOS 17 and skips
essential cleanup; instead of returning, only skip the theme change: inside
tearDown keep the availability check and the condition using
self.name.contains("testSelectBottomPlacement") || iPad() to decide whether to
call switchThemeToDarkOrLight(theme: "Light"), but do not return — always call
app.terminate() and super.tearDown() after that block so cleanup runs regardless
of the theme gate.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68a9007 and 2c0230e.

📒 Files selected for processing (6)
  • firefox-ios/firefox-ios-tests/Tests/AccessibilityTestPlan.xctestplan
  • firefox-ios/firefox-ios-tests/Tests/Smoketest.xctestplan
  • firefox-ios/firefox-ios-tests/Tests/TAESmokeTestPlan.xctestplan
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift
  • firefox-ios/firefox-ios-tests/Tests/XCUITests/ShareLongPressTests.swift
💤 Files with no reviewable changes (3)
  • firefox-ios/firefox-ios-tests/Tests/Smoketest.xctestplan
  • firefox-ios/firefox-ios-tests/Tests/AccessibilityTestPlan.xctestplan
  • firefox-ios/firefox-ios-tests/Tests/TAESmokeTestPlan.xctestplan
🧰 Additional context used
🧬 Code graph analysis (2)
firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift (1)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (2)
  • iPad (357-362)
  • switchThemeToDarkOrLight (439-461)
firefox-ios/firefox-ios-tests/Tests/XCUITests/ShareLongPressTests.swift (2)
firefox-ios/Client/Frontend/Library/LibraryPanelContextMenu.swift (1)
  • contextMenu (35-47)
firefox-ios/firefox-ios-tests/Tests/XCUITests/BaseTestCase.swift (2)
  • pressWithRetry (651-669)
  • waitAndTap (628-631)
🔇 Additional comments (2)
firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift (1)

347-352: LGTM: explicit iPad skip for bottom placement.

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

246-250: Nice stability improvement with context menu + retry.

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

Comment on lines 28 to 35
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")
}
}
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

Avoid early return in tearDown that skips cleanup.

On iOS 17, this returns before app.terminate() and super.tearDown(), which can leak state across tests. Gate only the theme switch, not the full teardown.

Proposed fix
     override func tearDown() async throws {
         if `#available`(iOS 17.0, *) {
-            if self.name.contains("testSelectBottomPlacement") || iPad() {
-                // Toolbar option not available for iPad, so the theme is not changed there.
-                return
-            } else {
-                switchThemeToDarkOrLight(theme: "Light")
-            }
+            if !(self.name.contains("testSelectBottomPlacement") || iPad()) {
+                switchThemeToDarkOrLight(theme: "Light")
+            }
         }
         app.terminate()
         try await super.tearDown()
     }
🤖 Prompt for AI Agents
In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/OnboardingTests.swift` around
lines 28 - 35, The tearDown currently returns early under iOS 17 and skips
essential cleanup; instead of returning, only skip the theme change: inside
tearDown keep the availability check and the condition using
self.name.contains("testSelectBottomPlacement") || iPad() to decide whether to
call switchThemeToDarkOrLight(theme: "Light"), but do not return — always call
app.terminate() and super.tearDown() after that block so cleanup runs regardless
of the theme gate.

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