@@ -379,33 +379,35 @@ class TopTabsTest: BaseTestCase {
379
379
func testTabTrayCloseMultipleTabs( ) {
380
380
navigator. nowAt ( NewTabScreen)
381
381
validateToastWhenClosingMultipleTabs ( )
382
+ // Tab tray UI experiment doesn't have toasts notifications anymore
383
+ // https://github.com/mozilla-mobile/firefox-ios/issues/25343
382
384
// 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])
409
411
}
410
412
411
413
private func validateToastWhenClosingMultipleTabs( ) {
@@ -421,25 +423,27 @@ class TopTabsTest: BaseTestCase {
421
423
}
422
424
navigator. nowAt ( BrowserTab)
423
425
navigator. goto ( TabTray)
426
+ // Tab tray UI experiment doesn't have toasts notifications anymore
427
+ // https://github.com/mozilla-mobile/firefox-ios/issues/25343
424
428
// 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
+ // )
443
447
}
444
448
445
449
private func addTabsAndUndoCloseTabAction( nrOfTabs: Int ) {
@@ -454,7 +458,7 @@ class TopTabsTest: BaseTestCase {
454
458
XCTAssertEqual ( " 4 " , numTab, " The number of counted tabs is not equal to \( String ( describing: numTab) ) " )
455
459
navigator. goto ( TabTray)
456
460
// 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
458
462
app. otherElements [ " Tabs Tray " ] . cells. staticTexts. element ( boundBy: 3 ) . press ( forDuration: 1.6 )
459
463
// Context menu opens
460
464
waitForElementsToExist (
@@ -465,19 +469,21 @@ class TopTabsTest: BaseTestCase {
465
469
)
466
470
// Choose to close the tab
467
471
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
468
474
// 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)
481
487
}
482
488
}
483
489
0 commit comments