Skip to content

Bugfix FXIOS-11782 Missing experiment related image identifiers (backport #25733) #25738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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 @@ -68,7 +68,7 @@ class TabCounterTests: BaseTestCase {
XCTAssertTrue(tabsOpenTabTray.hasSuffix("2"))

app.otherElements["Tabs Tray"].cells
.element(boundBy: 0).buttons[AccessibilityIdentifiers.TabTray.closeButton].waitAndTap()
.element(boundBy: 0).buttons[StandardImageIdentifiers.Large.cross].waitAndTap()
}

app.otherElements["Tabs Tray"].cells.element(boundBy: 0).waitAndTap()
Expand Down
53 changes: 53 additions & 0 deletions firefox-ios/firefox-ios-tests/Tests/XCUITests/TopTabsTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,59 @@ class TopTabsTest: BaseTestCase {
mozWaitForElementToExist(app.otherElements.cells.staticTexts[urlLabelExample])
}

// https://mozilla.testrail.io/index.php?/cases/view/2306867
func testCloseOneTabUndo() {
// Open a few tabs
waitForTabsButton()
navigator.openURL("http://localhost:\(serverPort)/test-fixture/find-in-page-test.html")
waitUntilPageLoad()
navigator.createNewTab()
navigator.openURL("http://localhost:\(serverPort)/test-fixture/test-example.html")
waitUntilPageLoad()
navigator.createNewTab()
navigator.openURL("localhost:\(serverPort)/test-fixture/test-mozilla-org.html")
waitUntilPageLoad()
navigator.goto(TabTray)

// Experiment from #25337: "Undo" button no longer available on iPhone.
if iPad() {
// Tap "x"
app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"].buttons[StandardImageIdentifiers.Large.cross].tap()
mozWaitForElementToNotExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"])
app.buttons["Undo"].waitAndTap()
mozWaitForElementToExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"])

// Long press tab. Tap "Close Tab" from the context menu
app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"].press(forDuration: 2)
mozWaitForElementToExist(app.collectionViews.buttons["Close Tab"])
app.collectionViews.buttons["Close Tab"].waitAndTap()
mozWaitForElementToNotExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"])
app.buttons["Undo"].waitAndTap()
mozWaitForElementToExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"])

// Swipe tab
app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"].swipeLeft()
mozWaitForElementToNotExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"])
app.buttons["Undo"].waitAndTap()
mozWaitForElementToExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"])
} else {
// Tap "x"
app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"]
.buttons[StandardImageIdentifiers.Large.cross].waitAndTap()
mozWaitForElementToNotExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"])

// Long press tab. Tap "Close Tab" from the context menu
app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_1"].press(forDuration: 2)
mozWaitForElementToExist(app.collectionViews.buttons["Close Tab"])
app.collectionViews.buttons["Close Tab"].waitAndTap()
mozWaitForElementToNotExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_2"])

// Swipe tab
app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_0"].swipeLeft()
mozWaitForElementToNotExist(app.cells[AccessibilityIdentifiers.TabTray.tabCell+"_1_0"])
}
}

private func validateToastWhenClosingMultipleTabs() {
// Have multiple tabs opened in the tab tray
navigator.openURL(urlExample)
Expand Down