Skip to content

Commit 05909ff

Browse files
authoredMar 14, 2025
Removed MTE-4407 - toast notifications validation (#25347)
1 parent 8edf258 commit 05909ff

File tree

3 files changed

+72
-63
lines changed

3 files changed

+72
-63
lines changed
 

‎firefox-ios/firefox-ios-tests/Tests/Smoketest2.xctestplan

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
"TopTabsTest\/testAddTabFromContext()",
153153
"TopTabsTest\/testCloseAllTabs()",
154154
"TopTabsTest\/testCloseAllTabsPrivateMode()",
155+
"TopTabsTest\/testCloseAllTabsUndo()",
155156
"TopTabsTest\/testCloseOneTab()",
156157
"TopTabsTest\/testOpenTabsViewCurrentTabThumbnail()",
157158
"TopTabsTest\/testSwitchBetweenTabs()",

‎firefox-ios/firefox-ios-tests/Tests/XCUITests/PrivateBrowsingTest.swift

+8-6
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,14 @@ class PrivateBrowsingTest: BaseTestCase {
256256
mozWaitForElementToExist(app.staticTexts["Private Browsing"])
257257

258258
// "Undo" toast message is displayed. Tap on "Undo" button
259-
app.buttons["Undo"].waitAndTap()
260-
261-
// All the private tabs are restored
262-
navigator.goto(TabTray)
263-
numTab = app.otherElements["Tabs Tray"].cells.count
264-
XCTAssertEqual(4, numTab, "The number of counted tabs is not equal to \(String(describing: numTab))")
259+
// Tab tray UI experiment doesn't have toasts notifications anymore
260+
// https://github.com/mozilla-mobile/firefox-ios/issues/25343
261+
// app.buttons["Undo"].waitAndTap()
262+
//
263+
// // All the private tabs are restored
264+
// navigator.goto(TabTray)
265+
// numTab = app.otherElements["Tabs Tray"].cells.count
266+
// XCTAssertEqual(4, numTab, "The number of counted tabs is not equal to \(String(describing: numTab))")
265267
}
266268

267269
// https://mozilla.testrail.io/index.php?/cases/view/2307003

‎firefox-ios/firefox-ios-tests/Tests/XCUITests/TopTabsTest.swift

+63-57
Original file line numberDiff line numberDiff line change
@@ -379,33 +379,35 @@ class TopTabsTest: BaseTestCase {
379379
func testTabTrayCloseMultipleTabs() {
380380
navigator.nowAt(NewTabScreen)
381381
validateToastWhenClosingMultipleTabs()
382+
// Tab tray UI experiment doesn't have toasts notifications anymore
383+
// https://github.com/mozilla-mobile/firefox-ios/issues/25343
382384
// Choose to undo the action
383-
app.buttons["Undo"].waitAndTap()
384-
waitUntilPageLoad()
385-
// Only the latest tab closed is restored
386-
navigator.nowAt(BrowserTab)
387-
waitForTabsButton()
388-
navigator.goto(TabTray)
389-
let tabsTrayCell = app.otherElements["Tabs Tray"].cells
390-
if !iPad() {
391-
let numTab = app.buttons.element(boundBy: 3).label
392-
XCTAssertEqual(Int(numTab), tabsTrayCell.count)
393-
} else {
394-
XCTAssertEqual(tabsTrayCell.count, 2)
395-
XCTAssertTrue(app.buttons.elementContainingText("2").exists)
396-
}
397-
mozWaitForElementToExist(app.otherElements.cells.staticTexts[urlLabelExample])
398-
// Repeat for private browsing mode
399-
navigator.performAction(Action.TogglePrivateMode)
400-
validateToastWhenClosingMultipleTabs()
401-
// Choose to undo the action
402-
app.buttons["Undo"].waitAndTap()
403-
// Only the latest tab closed is restored
404-
if !iPad() {
405-
let tabsTrayCell = app.otherElements["Tabs Tray"].cells
406-
XCTAssertEqual(1, tabsTrayCell.count)
407-
}
408-
mozWaitForElementToExist(app.otherElements.cells.staticTexts[urlLabelExample])
385+
// app.buttons["Undo"].waitAndTap()
386+
// waitUntilPageLoad()
387+
// // Only the latest tab closed is restored
388+
// navigator.nowAt(BrowserTab)
389+
// waitForTabsButton()
390+
// navigator.goto(TabTray)
391+
// let tabsTrayCell = app.otherElements["Tabs Tray"].cells
392+
// if !iPad() {
393+
// let numTab = app.buttons.element(boundBy: 3).label
394+
// XCTAssertEqual(Int(numTab), tabsTrayCell.count)
395+
// } else {
396+
// XCTAssertEqual(tabsTrayCell.count, 2)
397+
// XCTAssertTrue(app.buttons.elementContainingText("2").exists)
398+
// }
399+
// mozWaitForElementToExist(app.otherElements.cells.staticTexts[urlLabelExample])
400+
// // Repeat for private browsing mode
401+
// navigator.performAction(Action.TogglePrivateMode)
402+
// validateToastWhenClosingMultipleTabs()
403+
// // Choose to undo the action
404+
// app.buttons["Undo"].waitAndTap()
405+
// // Only the latest tab closed is restored
406+
// if !iPad() {
407+
// let tabsTrayCell = app.otherElements["Tabs Tray"].cells
408+
// XCTAssertEqual(1, tabsTrayCell.count)
409+
// }
410+
// mozWaitForElementToExist(app.otherElements.cells.staticTexts[urlLabelExample])
409411
}
410412

411413
private func validateToastWhenClosingMultipleTabs() {
@@ -421,25 +423,27 @@ class TopTabsTest: BaseTestCase {
421423
}
422424
navigator.nowAt(BrowserTab)
423425
navigator.goto(TabTray)
426+
// Tab tray UI experiment doesn't have toasts notifications anymore
427+
// https://github.com/mozilla-mobile/firefox-ios/issues/25343
424428
// Close multiple tabs by pressing X button
425-
let crossCircleFillLarge = StandardImageIdentifiers.Large.crossCircleFill
426-
for _ in 0...3 {
427-
app.collectionViews.cells["Homepage. Currently selected tab."].buttons[crossCircleFillLarge].waitAndTap()
428-
// A toast notification is displayed with the message "Tab Closed" and the Undo option
429-
waitForElementsToExist(
430-
[
431-
app.buttons["Undo"],
432-
app.staticTexts["Tab Closed"]
433-
]
434-
)
435-
}
436-
app.collectionViews.buttons[crossCircleFillLarge].waitAndTap()
437-
waitForElementsToExist(
438-
[
439-
app.buttons["Undo"],
440-
app.staticTexts["Tab Closed"]
441-
]
442-
)
429+
// let crossCircleFillLarge = StandardImageIdentifiers.Large.crossCircleFill
430+
// for _ in 0...3 {
431+
// app.collectionViews.cells["Homepage. Currently selected tab."].buttons[crossCircleFillLarge].waitAndTap()
432+
// // A toast notification is displayed with the message "Tab Closed" and the Undo option
433+
// waitForElementsToExist(
434+
// [
435+
// app.buttons["Undo"],
436+
// app.staticTexts["Tab Closed"]
437+
// ]
438+
// )
439+
// }
440+
// app.collectionViews.buttons[crossCircleFillLarge].waitAndTap()
441+
// waitForElementsToExist(
442+
// [
443+
// app.buttons["Undo"],
444+
// app.staticTexts["Tab Closed"]
445+
// ]
446+
// )
443447
}
444448

445449
private func addTabsAndUndoCloseTabAction(nrOfTabs: Int) {
@@ -454,7 +458,7 @@ class TopTabsTest: BaseTestCase {
454458
XCTAssertEqual("4", numTab, "The number of counted tabs is not equal to \(String(describing: numTab))")
455459
navigator.goto(TabTray)
456460
// Long press on the tab tray to open the context menu
457-
let tabsTrayCell = app.otherElements["Tabs Tray"].cells
461+
// let tabsTrayCell = app.otherElements["Tabs Tray"].cells
458462
app.otherElements["Tabs Tray"].cells.staticTexts.element(boundBy: 3).press(forDuration: 1.6)
459463
// Context menu opens
460464
waitForElementsToExist(
@@ -465,19 +469,21 @@ class TopTabsTest: BaseTestCase {
465469
)
466470
// Choose to close the tab
467471
app.buttons["Close Tab"].waitAndTap()
472+
// Tab tray UI experiment doesn't have toasts notifications anymore
473+
// https://github.com/mozilla-mobile/firefox-ios/issues/25343
468474
// A toast notification is displayed with the message "Tab Closed" and the Undo option
469-
waitForElementsToExist(
470-
[
471-
app.buttons["Undo"],
472-
app.staticTexts["Tab Closed"]
473-
]
474-
)
475-
app.buttons["Undo"].waitAndTap()
476-
mozWaitForElementToNotExist(app.buttons["Undo"])
477-
mozWaitForElementToNotExist(app.staticTexts["Tab Closed"])
478-
// The tab closed is restored
479-
mozWaitForElementToExist(tabsTrayCell.element(boundBy: 3))
480-
XCTAssertEqual(Int(numTab!), tabsTrayCell.count)
475+
// waitForElementsToExist(
476+
// [
477+
// app.buttons["Undo"],
478+
// app.staticTexts["Tab Closed"]
479+
// ]
480+
// )
481+
// app.buttons["Undo"].waitAndTap()
482+
// mozWaitForElementToNotExist(app.buttons["Undo"])
483+
// mozWaitForElementToNotExist(app.staticTexts["Tab Closed"])
484+
// // The tab closed is restored
485+
// mozWaitForElementToExist(tabsTrayCell.element(boundBy: 3))
486+
// XCTAssertEqual(Int(numTab!), tabsTrayCell.count)
481487
}
482488
}
483489

0 commit comments

Comments
 (0)
Failed to load comments.