Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"ClipBoardTests",
"ClipBoardTests\/testClipboard()",
"ClipBoardTests\/testClipboardPasteAndGo()",
"ClipBoardTests\/testCopyLink()",
"CookiePersistenceTests",
"CookiePersistenceTests\/testCookiePersistenceBasic()",
"CookiePersistenceTests\/testCookiePersistenceOpenNewTab()",
Expand Down Expand Up @@ -189,7 +188,6 @@
"HomePageSettingsUITests\/testDisableTopSitesSettingsRemovesSection()",
"HomePageSettingsUITests\/testJumpBackIn()",
"HomePageSettingsUITests\/testRecentlySaved()",
"HomePageSettingsUITests\/testSetCustomURLAsHome()",
"HomePageSettingsUITests\/testSetFirefoxHomeAsHome()",
"HomePageSettingsUITests\/testShortcutsRows()",
"HomePageSettingsUITests\/testTyping()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
"HomePageSettingsUITests\/testCustomizeHomepage()",
"HomePageSettingsUITests\/testCustomizeHomepage_TAE()",
"HomePageSettingsUITests\/testRecentlyVisited()",
"HomePageSettingsUITests\/testSetCustomURLAsHome()",
"HomePageSettingsUITests\/testTyping()",
"HomePageUITest",
"HomepageSearchBarTests",
Expand Down
2 changes: 0 additions & 2 deletions firefox-ios/firefox-ios-tests/Tests/Smoketest.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
"C_AddressesTests\/testUpdateAddressFieldZIP()",
"C_AddressesTests\/testUpdateAllAddressFields()",
"ClipBoardTests\/testClipboard()",
"ClipBoardTests\/testCopyLink()",
"CookiePersistenceTests",
"CookiePersistenceTests\/testCookiePersistenceBasic()",
"CookiePersistenceTests\/testCookiePersistenceOpenNewTab()",
Expand Down Expand Up @@ -301,7 +300,6 @@
"HomePageSettingsUITests\/testDisableTopSitesSettingsRemovesSection()",
"HomePageSettingsUITests\/testJumpBackIn()",
"HomePageSettingsUITests\/testRecentlySaved()",
"HomePageSettingsUITests\/testSetCustomURLAsHome()",
"HomePageSettingsUITests\/testSetFirefoxHomeAsHome()",
"HomePageSettingsUITests\/testShortcutsRows()",
"HomePageSettingsUITests\/testTopSitesCustomNumberOfRows()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
"ClipBoardTests",
"ClipBoardTests\/testClipboard()",
"ClipBoardTests\/testClipboardPasteAndGo()",
"ClipBoardTests\/testCopyLink()",
"CookiePersistenceTests",
"CookiePersistenceTests\/testCookiePersistenceBasic()",
"CookiePersistenceTests\/testCookiePersistenceOpenNewTab()",
Expand Down Expand Up @@ -263,7 +262,6 @@
"HomePageSettingsUITests\/testJumpBackIn_tabTrayExperimentOn()",
"HomePageSettingsUITests\/testRecentlySaved()",
"HomePageSettingsUITests\/testRecentlySaved_tabTrayExperimentOff()",
"HomePageSettingsUITests\/testSetCustomURLAsHome()",
"HomePageSettingsUITests\/testSetFirefoxHomeAsHome()",
"HomePageSettingsUITests\/testShortcutsRows()",
"HomePageSettingsUITests\/testShortcutsRows_tabTrayExperimentOff()",
Expand Down
30 changes: 3 additions & 27 deletions firefox-ios/firefox-ios-tests/Tests/XCUITests/ClipBoardTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ class ClipBoardTests: BaseTestCase {
let url = "www.example.com"

// Check for test url in the browser
func checkUrl() {
public func checkUrl() {
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for usages of these methods outside of ClipBoardTests.swift
echo "=== Searching for checkUrl() usage ==="
rg -n --type swift '\bcheckUrl\s*\(' -g '!*ClipBoardTests.swift'

echo -e "\n=== Searching for copyUrl() usage ==="
rg -n --type swift '\bcopyUrl\s*\(' -g '!*ClipBoardTests.swift'

echo -e "\n=== Searching for checkCopiedUrl() usage ==="
rg -n --type swift '\bcheckCopiedUrl\s*\(' -g '!*ClipBoardTests.swift'

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

Length of output: 213


Remove public visibility from helper methods—they are not used outside this class.

These three methods (checkUrl(), copyUrl(), checkCopiedUrl()) should remain internal. They are only used within ClipBoardTests and have no external usages across the codebase. Making them public unnecessarily exposes internal test helpers and violates encapsulation. Revert them to the default internal visibility.

🤖 Prompt for AI Agents
In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/ClipBoardTests.swift` at line
11, Remove the unnecessary public visibility on the test helper methods in
ClipBoardTests by changing the declarations of public func checkUrl(), public
func copyUrl(), and public func checkCopiedUrl() to the default internal
visibility (i.e., remove the `public` keyword) so they remain internal to the
ClipBoardTests class.

let urlTextField = app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField]
mozWaitForValueContains(urlTextField, value: "example.com")
}

// Copy url from the browser
func copyUrl() {
public func copyUrl() {
urlBarAddress.waitAndTap()
if iPad() {
var attemptsiPad = 2
Expand All @@ -38,7 +38,7 @@ class ClipBoardTests: BaseTestCase {
}

// Check copied url is same as in browser
func checkCopiedUrl() {
public func checkCopiedUrl() {
if #unavailable(iOS 16.0) {
if let myString = UIPasteboard.general.string {
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
Expand Down Expand Up @@ -68,7 +68,6 @@ class ClipBoardTests: BaseTestCase {
waitUntilPageLoad()
checkUrl()
copyUrl()
checkCopiedUrl()

navigator.createNewTab()
mozWaitForElementToNotExist(app.staticTexts["XCUITests-Runner pasted from Fennec"])
Expand All @@ -88,29 +87,6 @@ class ClipBoardTests: BaseTestCase {
}
}

// https://mozilla.testrail.io/index.php?/cases/view/2307051
func testCopyLink() {
// Tap on "Copy Link
navigator.openURL(url_3)
waitForTabsButton()
// Menu Refactor: No "Copy Link" from browser tab menu
/*
navigator.performAction(Action.CopyAddressPAM)
// The Link is copied to clipboard
mozWaitForElementToExist(app.staticTexts["URL Copied To Clipboard"])
// Open a new tab. Long tap on the URL and tap "Paste & Go"
navigator.performAction(Action.OpenNewTabFromTabTray)
let urlBar = app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField]
mozWaitForElementToExist(urlBar)
urlBar.press(forDuration: 1.5)
app.otherElements[AccessibilityIdentifiers.Photon.pasteAndGoAction].waitAndTap()
// The URL is pasted and the page is correctly loaded
mozWaitForElementToExist(urlBar)
waitForValueContains(urlBar, value: "localhost")
mozWaitForElementToExist(app.staticTexts["Example Domain"])
*/
}

// https://mozilla.testrail.io/index.php?/cases/view/2325691
// Smoketest
func testClipboardPasteAndGo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ class DisplaySettingTests: BaseTestCase {
XCTAssertEqual(darkThemeValue as? String, "0")
}

// https://mozilla.testrail.io/index.php?/cases/view/2337487
// https://mozilla.testrail.io/index.php?/cases/view/3298823
func testCheckSystemThemeChanges() {
navigator.nowAt(NewTabScreen)
navigator.goto(DisplaySettings)

// Select Light mode
navigator.performAction(Action.SelectLightTheme)
let lightIsSelected = app.buttons[AccessibilityIdentifiers.Settings.Appearance.lightThemeView].value
let lightIsSelected = app.buttons[AccessibilityIdentifiers.Settings.Appearance.darkThemeView].value
XCTAssertEqual(lightIsSelected as? String, "1")
Comment on lines +46 to 54
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

Fix the light-theme assertion target.

After selecting Light mode, the assertion checks darkThemeView, which likely makes the test fail or pass incorrectly. It should validate lightThemeView.

🛠️ Suggested fix
-        let lightIsSelected = app.buttons[AccessibilityIdentifiers.Settings.Appearance.darkThemeView].value
+        let lightIsSelected = app.buttons[AccessibilityIdentifiers.Settings.Appearance.lightThemeView].value
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// https://mozilla.testrail.io/index.php?/cases/view/3298823
func testCheckSystemThemeChanges() {
navigator.nowAt(NewTabScreen)
navigator.goto(DisplaySettings)
// Select Light mode
navigator.performAction(Action.SelectLightTheme)
let lightIsSelected = app.buttons[AccessibilityIdentifiers.Settings.Appearance.lightThemeView].value
let lightIsSelected = app.buttons[AccessibilityIdentifiers.Settings.Appearance.darkThemeView].value
XCTAssertEqual(lightIsSelected as? String, "1")
// https://mozilla.testrail.io/index.php?/cases/view/3298823
func testCheckSystemThemeChanges() {
navigator.nowAt(NewTabScreen)
navigator.goto(DisplaySettings)
// Select Light mode
navigator.performAction(Action.SelectLightTheme)
let lightIsSelected = app.buttons[AccessibilityIdentifiers.Settings.Appearance.lightThemeView].value
XCTAssertEqual(lightIsSelected as? String, "1")
🤖 Prompt for AI Agents
In `@firefox-ios/firefox-ios-tests/Tests/XCUITests/DisplaySettingsTests.swift`
around lines 46 - 54, In testCheckSystemThemeChanges, after invoking
navigator.performAction(Action.SelectLightTheme) the assertion is checking the
wrong accessibility identifier (darkThemeView); update the assertion to read the
value from AccessibilityIdentifiers.Settings.Appearance.lightThemeView instead
so testCheckSystemThemeChanges validates the light-theme button state correctly.


// Select Dark mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,28 +140,6 @@ class HomePageSettingsUITests: FeatureFlaggedTestBase {
mozWaitForElementToExist(app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField])
}

// https://mozilla.testrail.io/index.php?/cases/view/2307031
func testSetCustomURLAsHome() throws {
let shouldSkipTest = true
try XCTSkipIf(shouldSkipTest,
"Skipping test based on https://github.com/mozilla-mobile/firefox-ios/issues/28117.")
waitForTabsButton()
navigator.nowAt(NewTabScreen)
navigator.goto(HomeSettings)
// Enter a webpage
enterWebPageAsHomepage(text: websiteUrl1)

// Open a new tab and tap on Home option
navigator.performAction(Action.OpenNewTabFromTabTray)
navigator.openURL(path(forTestPage: "test-mozilla-org.html"))
waitForTabsButton()
navigator.nowAt(BrowserTab)
navigator.performAction(Action.GoToHomePage)
mozWaitForElementToExist(app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField])
mozWaitForValueContains(app.textFields[AccessibilityIdentifiers.Browser.AddressToolbar.searchTextField],
value: "mozilla.org")
}

// https://mozilla.testrail.io/index.php?/cases/view/2339489
func testDisableTopSitesSettingsRemovesSection() {
app.launch()
Expand All @@ -174,8 +152,8 @@ class HomePageSettingsUITests: FeatureFlaggedTestBase {
XCTAssertTrue(app.switches["Shortcuts"].exists)
app.switches["Shortcuts"].waitAndTap()

navigator.goto(NewTabScreen)
app.buttons["Done"].waitAndTap()
navigator.goto(NewTabScreen)

mozWaitForElementToNotExist(app.links[AccessibilityIdentifiers.FirefoxHomepage.TopSites.itemCell])
mozWaitForElementToNotExist(app.collectionViews.cells.staticTexts["YouTube"])
Expand Down