mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
34 lines
862 B
TypeScript
34 lines
862 B
TypeScript
import { browser, ElementFinder } from 'protractor/built';
|
|
|
|
import { AlertPage } from './alert.po';
|
|
import { sleep } from './utils/helpers';
|
|
|
|
describe('Alert Page', () => {
|
|
let page: AlertPage;
|
|
|
|
beforeEach(() => {
|
|
page = new AlertPage();
|
|
});
|
|
|
|
it('should open page', async (done) => {
|
|
await page.navigateTo();
|
|
done();
|
|
});
|
|
|
|
it('should open the alert, then close it using the close button', async (done) => {
|
|
const button = await page.getButton();
|
|
await sleep(100);
|
|
await button.click();
|
|
await sleep(500);
|
|
let alert = await page.getAlert();
|
|
expect(await alert.isPresent()).toBeTruthy();
|
|
const closeButton = await page.getCloseButton();
|
|
await closeButton.click();
|
|
await sleep(500);
|
|
alert = null;
|
|
alert = await page.getAlert();
|
|
expect(await alert.isPresent()).toBeFalsy();
|
|
done();
|
|
});
|
|
});
|