test(angular): tabs sibling page test is no longer flaky (#25906)

This commit is contained in:
Liam DeBeasi
2022-09-09 12:00:13 -05:00
committed by GitHub
parent 725b13fa60
commit 634f928541

View File

@ -115,6 +115,16 @@ describe('Tabs', () => {
]); ]);
cy.get('#tab-button-account').click(); cy.get('#tab-button-account').click();
/**
* Wait for the leaving view to
* be unmounted otherwise testTabTitle
* may get the leaving view before it
* is unmounted.
*/
cy.ionPageVisible('app-tabs-tab1');
cy.ionPageDoesNotExist('app-tabs-tab1-nested');
testTabTitle('Tab 1 - Page 1'); testTabTitle('Tab 1 - Page 1');
cy.testStack('ion-tabs ion-router-outlet', [ cy.testStack('ion-tabs ion-router-outlet', [
'app-tabs-tab1', 'app-tabs-tab1',
@ -280,33 +290,33 @@ describe('Tabs', () => {
describe('entry url - /', () => { describe('entry url - /', () => {
it('should pop to the root outlet from the tabs outlet', () => { it('should pop to the root outlet from the tabs outlet', () => {
cy.visit('/'); cy.visit('/');
cy.get('ion-title').should('contain.text', 'Test App'); cy.get('ion-title').should('contain.text', 'Test App');
cy.get('ion-item').contains('Tabs test').click(); cy.get('ion-item').contains('Tabs test').click();
cy.get('ion-title').should('contain.text', 'Tab 1 - Page 1'); cy.get('ion-title').should('contain.text', 'Tab 1 - Page 1');
cy.get('#goto-tab1-page2').click(); cy.get('#goto-tab1-page2').click();
cy.get('ion-title').should('contain.text', 'Tab 1 - Page 2 (1)'); cy.get('ion-title').should('contain.text', 'Tab 1 - Page 2 (1)');
cy.get('#goto-global').click(); cy.get('#goto-global').click();
cy.get('ion-title').should('contain.text', 'Global Page'); cy.get('ion-title').should('contain.text', 'Global Page');
cy.get('#goto-prev-pop').click(); cy.get('#goto-prev-pop').click();
cy.get('ion-title').should('contain.text', 'Tab 1 - Page 2 (1)'); cy.get('ion-title').should('contain.text', 'Tab 1 - Page 2 (1)');
cy.get('#goto-prev').click(); cy.get('#goto-prev').click();
cy.get('ion-title').should('contain.text', 'Tab 1 - Page 1'); cy.get('ion-title').should('contain.text', 'Tab 1 - Page 1');
cy.get('#goto-previous-page').click(); cy.get('#goto-previous-page').click();
cy.get('ion-title').should('contain.text', 'Test App'); cy.get('ion-title').should('contain.text', 'Test App');
}); });
}); });