mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
@ -1,19 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const { By, until } = require('selenium-webdriver');
|
||||
const { register, Page, platforms } = require('../../../../../scripts/e2e');
|
||||
|
||||
class E2ETestPage extends Page {
|
||||
constructor(driver, platform) {
|
||||
super(driver, `http://localhost:3333/src/components/modal/test/basic?ionic:mode=${platform}`);
|
||||
}
|
||||
}
|
||||
|
||||
platforms.forEach(platform => {
|
||||
describe('modal/basic', () => {
|
||||
register('should init', driver => {
|
||||
const page = new E2ETestPage(driver, platform);
|
||||
return page.navigate('#presentModal');
|
||||
});
|
||||
});
|
||||
});
|
||||
14
core/src/components/modal/test/basic/e2e.ts
Normal file
14
core/src/components/modal/test/basic/e2e.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
it('modal: basic', async () => {
|
||||
const page = await newE2EPage({
|
||||
url: '/src/components/modal/test/basic?ionic:animated=false'
|
||||
});
|
||||
|
||||
await page.click('.e2ePresentModal');
|
||||
const popover = await page.find('ion-modal');
|
||||
expect(popover).not.toBeNull();
|
||||
|
||||
const compare = await page.compareScreenshot();
|
||||
expect(compare).toMatchScreenshot();
|
||||
});
|
||||
@ -1,31 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const { By, until } = require('selenium-webdriver');
|
||||
const { register, Page, platforms } = require('../../../../../scripts/e2e');
|
||||
|
||||
class E2ETestPage extends Page {
|
||||
constructor(driver, platform) {
|
||||
super(driver, `http://localhost:3333/src/components/modal/test/standalone?ionic:mode=${platform}`);
|
||||
}
|
||||
|
||||
async present(buttonId) {
|
||||
await this.navigate('#basic');
|
||||
this.driver.findElement(By.id(buttonId)).click();
|
||||
await this.driver.wait(until.elementLocated(By.css('.modal-wrapper')));
|
||||
return await this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.modal-wrapper'))));
|
||||
}
|
||||
}
|
||||
|
||||
platforms.forEach(platform => {
|
||||
describe('modal/standalone', () => {
|
||||
register('should init', driver => {
|
||||
const page = new E2ETestPage(driver, platform);
|
||||
return page.navigate('#basic');
|
||||
});
|
||||
|
||||
register('shows basic modal', driver => {
|
||||
const page = new E2ETestPage(driver, platform);
|
||||
return page.present('basic');
|
||||
});
|
||||
});
|
||||
});
|
||||
14
core/src/components/modal/test/standalone/e2e.ts
Normal file
14
core/src/components/modal/test/standalone/e2e.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
it('modal: standalone', async () => {
|
||||
const page = await newE2EPage({
|
||||
url: '/src/components/modal/test/standalone?ionic:animated=false'
|
||||
});
|
||||
|
||||
await page.click('#basic');
|
||||
const popover = await page.find('ion-modal');
|
||||
expect(popover).not.toBeNull();
|
||||
|
||||
const compare = await page.compareScreenshot();
|
||||
expect(compare).toMatchScreenshot();
|
||||
});
|
||||
Reference in New Issue
Block a user