mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-26 08:13:34 +08:00
test(react): add react e2e app
This commit is contained in:
@ -0,0 +1,27 @@
|
||||
describe('IonAlert', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/overlay-components/alert');
|
||||
});
|
||||
|
||||
it('display alert', () => {
|
||||
//show alert
|
||||
cy.get('ion-button').contains('Show Alert').click();
|
||||
cy.get('ion-alert').contains('Alert');
|
||||
cy.get('ion-alert').get('button').contains('Ok');
|
||||
cy.get('ion-alert').get('button').contains('Cancel');
|
||||
|
||||
//click ok
|
||||
cy.get('ion-alert').get('button:contains("Ok")').click();
|
||||
cy.get('div').contains('Ok clicked');
|
||||
cy.get('ion-alert').should('not.exist');
|
||||
});
|
||||
|
||||
it('display alert and call dismiss to close it', () => {
|
||||
//show alert
|
||||
cy.get('ion-button').contains('Show Alert, hide after 250 ms').click();
|
||||
cy.get('ion-alert').contains('Alert');
|
||||
|
||||
//verify alert is gone
|
||||
cy.get('ion-alert').should('not.exist');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user