mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
28 lines
809 B
TypeScript
28 lines
809 B
TypeScript
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');
|
|
});
|
|
});
|