-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vue): switching between tabs and going back resolves to correct r…
- Loading branch information
1 parent
2fbd621
commit b4ba70e
Showing
7 changed files
with
296 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
describe('Hardware Back Button', () => { | ||
it('should correctly go back to Tab 1', () => { | ||
cy.visit('http://localhost:8080/tabs'); | ||
|
||
cy.get('ion-tab-button#tab-button-tab2').click(); | ||
cy.ionPageHidden('tab1'); | ||
cy.ionPageVisible('tab2'); | ||
|
||
cy.get('#add-tab').click(); | ||
|
||
cy.get('ion-tab-button#tab-button-tab4').click(); | ||
cy.ionPageHidden('tab2'); | ||
cy.ionPageVisible('tab4'); | ||
|
||
cy.get('ion-tab-button#tab-button-tab1').click(); | ||
cy.ionPageHidden('tab4'); | ||
cy.ionPageVisible('tab1'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageHidden('tab1'); | ||
cy.ionPageVisible('tab4'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageHidden('tab4'); | ||
cy.ionPageVisible('tab2'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageHidden('tab2'); | ||
cy.ionPageVisible('tab1'); | ||
}); | ||
|
||
it('should correctly go back to the root tab from child pages', () => { | ||
cy.visit('http://localhost:8080'); | ||
|
||
cy.routerPush('/tabs'); | ||
cy.ionPageHidden('home'); | ||
cy.ionPageVisible('tab1'); | ||
|
||
cy.routerPush('/tabs/tab1/childone'); | ||
cy.ionPageHidden('tab1'); | ||
cy.ionPageVisible('tab1childone'); | ||
|
||
cy.routerPush('/tabs/tab1/childtwo'); | ||
cy.ionPageHidden('tab1childone'); | ||
cy.ionPageVisible('tab1childtwo'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageDoesNotExist('tab1childtwo'); | ||
cy.ionPageVisible('tab1childone'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageDoesNotExist('tab1childone'); | ||
cy.ionPageVisible('tab1'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageDoesNotExist('tab1'); | ||
cy.ionPageVisible('home'); | ||
}); | ||
|
||
// TODO FW-1389 | ||
it.skip('should correctly go back to the root tab after switching pages', () => { | ||
cy.visit('http://localhost:8080'); | ||
|
||
cy.routerPush('/tabs'); | ||
cy.ionPageHidden('home'); | ||
cy.ionPageVisible('tab1'); | ||
|
||
cy.routerPush('/tabs/tab1/childone'); | ||
cy.ionPageHidden('tab1'); | ||
cy.ionPageVisible('tab1childone'); | ||
|
||
cy.routerPush('/tabs/tab1/childtwo'); | ||
cy.ionPageHidden('tab1childone'); | ||
cy.ionPageVisible('tab1childtwo'); | ||
|
||
cy.get('ion-tab-button#tab-button-tab2').click(); | ||
cy.ionPageHidden('tab1childtwo'); | ||
cy.ionPageVisible('tab2'); | ||
|
||
cy.get('ion-tab-button#tab-button-tab1').click(); | ||
cy.ionPageHidden('tab2'); | ||
cy.ionPageVisible('tab1childtwo'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageDoesNotExist('tab1childtwo'); | ||
cy.ionPageVisible('tab1childone'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageDoesNotExist('tab1childone'); | ||
cy.ionPageVisible('tab1'); | ||
|
||
cy.hardwareBackButton(); | ||
cy.ionPageDoesNotExist('tab1'); | ||
cy.ionPageVisible('home'); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters