test(e2e): update standalone tests for snapshot

This commit is contained in:
Brandy Carney
2018-01-03 13:05:46 -05:00
parent 7299b939e4
commit 544cca099d
21 changed files with 230 additions and 15 deletions

View File

@@ -7,6 +7,13 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/action-sheet/test/standalone?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.action-sheet-container')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.action-sheet-container'))));
}
}
platforms.forEach(platform => {
@@ -15,5 +22,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('should open action sheet', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('basic');
});
});
});

View File

@@ -7,6 +7,13 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/alert/test/standalone?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.alert-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.alert-wrapper'))));
}
}
platforms.forEach(platform => {
@@ -15,5 +22,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('should open alert', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('basic');
});
});
});

View File

@@ -11,7 +11,7 @@
<body>
<ion-alert-controller></ion-alert-controller>
<ion-button expand="block" onclick="presentAlert()">Alert</ion-button>
<ion-button id="basic" expand="block" onclick="presentAlert()">Alert</ion-button>
<script>
async function presentAlert() {

View File

@@ -14,6 +14,7 @@
<ion-badge color="warning">33</ion-badge>
<ion-badge color="danger">44</ion-badge>
<ion-badge color="light">55</ion-badge>
<ion-badge color="dark">66a</ion-badge>
<ion-badge color="dark">66</ion-badge>
<ion-badge>99</ion-badge>
</body>
</html>

View File

@@ -0,0 +1,19 @@
'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/content/test/standalone?ionicplatform=${platform}`);
}
}
platforms.forEach(platform => {
describe('content/standalone', () => {
register('should init', driver => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
});
});

View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="UTF-8">
<title>Content - Standalone</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="/dist/ionic.js"></script>
</head>
<body>
<ion-content padding>
<h1>Heading</h1>
<h2>Heading</h2>
<h3>Heading</h3>
<h4>Heading</h4>
<h5>Heading</h5>
<h6>Heading</h6>
<p>Paragraph</p>
</ion-content>
</body>
</html>

View File

@@ -7,6 +7,13 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/datetime/test/basic?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.picker-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.picker-wrapper'))));
}
}
platforms.forEach(platform => {
@@ -15,5 +22,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('should open custom picker', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('customPickerOptions');
});
});
});

View File

@@ -7,6 +7,13 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/datetime/test/standalone?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.picker-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.picker-wrapper'))));
}
}
platforms.forEach(platform => {
@@ -15,5 +22,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('should open basic picker', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('basic');
});
});
});

View File

@@ -9,6 +9,6 @@
</head>
<body>
<ion-datetime display-format="MMMM" value="2012-12-15T13:47:20.789"></ion-datetime>
<ion-datetime id="basic" display-format="MMMM" value="2012-12-15T13:47:20.789"></ion-datetime>
</body>
</html>

View File

@@ -10,21 +10,32 @@
<body>
<ion-fab top right id="fab1">
<ion-fab-button onclick="openLists('fab1')" mini class="e2eFabTopRight"><ion-icon name="add"></ion-icon></ion-fab-button>
<ion-fab-button onclick="toggleList('fab1')" mini><ion-icon name="add"></ion-icon></ion-fab-button>
<ion-fab-list>
<ion-fab-button onclick="openLists('fab1')"><ion-icon name="logo-facebook"></ion-icon></ion-fab-button>
<ion-fab-button onclick="openLists('fab1')"><ion-icon name="logo-twitter"></ion-icon></ion-fab-button>
<ion-fab-button onclick="openLists('fab1')"><ion-icon name="logo-vimeo"></ion-icon></ion-fab-button>
<ion-fab-button onclick="openLists('fab1')"><ion-icon name="logo-googleplus"></ion-icon></ion-fab-button>
<ion-fab-button onclick="toggleList('fab1')"><ion-icon name="logo-facebook"></ion-icon></ion-fab-button>
<ion-fab-button onclick="toggleList('fab1')"><ion-icon name="logo-twitter"></ion-icon></ion-fab-button>
<ion-fab-button onclick="toggleList('fab1')"><ion-icon name="logo-vimeo"></ion-icon></ion-fab-button>
<ion-fab-button onclick="toggleList('fab1')"><ion-icon name="logo-googleplus"></ion-icon></ion-fab-button>
</ion-fab-list>
</ion-fab>
<ion-fab bottom left id="fab2">
<ion-fab-button onclick="toggleList('fab2')">More</ion-fab-button>
<ion-fab-list side="right">
<ion-fab-button onclick="toggleList('fab2')"><ion-icon name="logo-facebook"></ion-icon></ion-fab-button>
<ion-fab-button onclick="toggleList('fab2')"><ion-icon name="logo-twitter"></ion-icon></ion-fab-button>
<ion-fab-button onclick="toggleList('fab2')"><ion-icon name="logo-vimeo"></ion-icon></ion-fab-button>
<ion-fab-button onclick="toggleList('fab2')"><ion-icon name="logo-googleplus"></ion-icon></ion-fab-button>
</ion-fab-list>
</ion-fab>
<script>
function openLists(container) {
function toggleList(container) {
var fabLists = document.getElementById(container).querySelectorAll('ion-fab-list');
for (var i = 0; i < fabLists.length; i++) {
fabLists[i].activated = true;
var activated = fabLists[i].activated;
fabLists[i].activated = activated ? false : true;
}
}
</script>

View File

@@ -13,7 +13,7 @@ platforms.forEach(platform => {
describe('menu/standalone', () => {
register('should init', driver => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
return page.navigate('ion-page');
});
});
});

View File

@@ -7,6 +7,13 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/modal/test/standalone?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.modal-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.modal-wrapper'))));
}
}
platforms.forEach(platform => {
@@ -15,5 +22,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('shows basic modal', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('basic');
});
});
});

View File

@@ -9,7 +9,7 @@
</head>
<body>
<ion-button expand="block" onclick="presentModal()">Present Modal</ion-button>
<ion-button id="basic" expand="block" onclick="presentModal()">Present Modal</ion-button>
<ion-modal-controller></ion-modal-controller>

View File

@@ -7,6 +7,13 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/popover/test/standalone?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.popover-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.popover-wrapper'))));
}
}
platforms.forEach(platform => {
@@ -15,5 +22,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('shows basic popover', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('basic');
});
});
});

View File

@@ -9,7 +9,7 @@
</head>
<body>
<ion-button expand="block" onclick="presentPopover({ component: 'profile-page', ev: event })">Show Popover</ion-button>
<ion-button id="basic" expand="block" onclick="presentPopover({ component: 'profile-page', ev: event })">Show Popover</ion-button>
<ion-popover-controller></ion-popover-controller>

View File

@@ -9,12 +9,20 @@
</head>
<body>
<ion-radio></ion-radio>
<ion-radio color="primary"></ion-radio>
<ion-radio color="secondary"></ion-radio>
<ion-radio color="danger"></ion-radio>
<ion-radio color="dark"></ion-radio>
<ion-radio color="light"></ion-radio>
<ion-radio disabled></ion-radio>
<ion-radio checked></ion-radio>
<ion-radio color="primary" checked></ion-radio>
<ion-radio color="secondary" checked></ion-radio>
<ion-radio color="danger" checked></ion-radio>
<ion-radio color="dark" checked></ion-radio>
<ion-radio color="light" checked></ion-radio>
<ion-radio disabled></ion-radio>
<ion-radio checked disabled></ion-radio>
</body>
</html>

View File

@@ -7,6 +7,13 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/toast/test/standalone?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.toast-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.toast-wrapper'))));
}
}
platforms.forEach(platform => {
@@ -15,5 +22,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('shows basic toast', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('basic');
});
});
});

View File

@@ -9,7 +9,7 @@
</head>
<body>
<ion-button expand="block" onclick="presentToast('bottom')">Show Toast Bottom</ion-button>
<ion-button id="basic" expand="block" onclick="presentToast('bottom')">Show Toast Bottom</ion-button>
<ion-toast-controller></ion-toast-controller>

View File

@@ -0,0 +1,19 @@
'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/toolbar/test/basic?ionicplatform=${platform}`);
}
}
platforms.forEach(platform => {
describe('toolbar/basic', () => {
register('should init', driver => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
});
});

View File

@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="UTF-8">
<title>Toolbar - Basic</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="/dist/ionic.js"></script>
</head>
<body>
<ion-app>
<ion-page>
<ion-content>
<ion-toolbar>
<ion-title>Toolbar</ion-title>
</ion-toolbar>
<ion-toolbar color="primary">
<ion-title>Primary</ion-title>
</ion-toolbar>
<ion-toolbar color="secondary">
<ion-title>Secondary</ion-title>
</ion-toolbar>
<ion-toolbar color="warning">
<ion-title>Warning</ion-title>
</ion-toolbar>
<ion-toolbar color="danger">
<ion-title>Danger</ion-title>
</ion-toolbar>
<ion-toolbar color="light">
<ion-title>Light</ion-title>
</ion-toolbar>
<ion-toolbar color="dark">
<ion-title>Dark</ion-title>
</ion-toolbar>
</ion-content>
</ion-page>
</ion-app>
</body>
</html>

View File

@@ -37,4 +37,10 @@
<ion-title>Dark</ion-title>
</ion-toolbar>
</body>
<style>
body {
margin: 0;
}
</style>
</html>