test(e2e): port e2e tests to @ionic/core (#13438)

* feat(e2e-tests) simplify e2e test structure

* test(badge) add basic e2e test

* test(button) update e2e test to new structure

* test(card) add basic e2e test

* test(checkbox) add basic e2e test

* chore(e2e-test) update path to e2e module in run-e2e

* fix(button) update toolbar e2e deps

* fix(e2e-test) update path in snapshot script

* feat(e2e-test) move e2e scripts into scripts/e2e

* test(chip) add basic e2e test

* test(content) add basic e2e test

* test(datetime) add basic e2e test

* style(e2e-test) use consistent title/header in e2e test pages

* test(fab) add basic e2e test

* fix(e2e-test) don't run e2e script when required

* test(grid) add basic e2e test

* test(icon) add basic e2e test

* test(input) add basic e2e test

* style(e2e-test) use consistent e2e test header titles

* test(list) add basic e2e test

* test(menu) add basic e2e test

* test(modal) add basic e2e test

* feat(e2e-test) add navigate export to e2e module

* feat(e2e-test) add present method to Page class

* test(popover) add basic e2e test

* test(menu) add present left menu e2e test

* test(radio) add basic e2e test

* test(range) add  basic e2e test

* test(searchbar) add basic e2e test

* test(segment) add basic e2e test

* test(select) add basic e2e test

* test(modal) add shows modal e2e test

* test(slides) add basic e2e test

* test(spinner) add basic/color e2e tests

* test(tabs) add basic e2e test

* test(toast) add basic e2e test

* test(toggle) add basic e2e test

* test(toolbar) add basic e2e test

* docs(e2e-test) update e2e readme to reflect simplest test

* test(card) update basic e2e test

* chore(e2e-test) remove run-e2e script

* test(components): move remaining component tests to index files

* chore(package): add mocha to devDependencies

* test(infinite-scroll) add basic e2e test

* test(item-sliding) add basic e2e test

* test(item) add basic/buttons e2e tests

* test(nav) add basic e2e test

* test(reorder) add basic e2e test

* test(split-pane) add basic e2e test

* chore() update declarations file

* refactor(toast): reduce border-radius

* chore(components): update components.d.ts
This commit is contained in:
Cam Wiegert
2017-11-16 12:19:23 -06:00
committed by Brandy Carney
parent 90b6e01a38
commit db475cd153
90 changed files with 846 additions and 509 deletions

View File

@@ -1,11 +0,0 @@
'use strict';
const register = require('../../../../scripts/e2e-test-runner').register;
const E2ETestPage = require('../../../../scripts/E2ETestPage');
describe('button: basic', () => {
register('navigates', driver => {
const page = new E2ETestPage(driver, 'http://localhost:3333/src/components/button/test/basic.html');
return page.navigate();
});
});

View File

@@ -1,82 +0,0 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="UTF-8">
<title>Ionic Buttons</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-button button-type="bar-button">Test button</ion-button>
<ion-button button-type="test-button">Test button</ion-button>
<ion-button button-type="test-button" class="my-test-button">Test button w/ class</ion-button>
<ion-button button-type="alert-radio-button">
Alert button
</ion-button>
<ion-button button-type="alert-radio-button" class="alert-tappable alert-radio" role="radio">
Alert button w/ class & role
</ion-button>
<ion-button href="#">Anchor Button</ion-button>
<a href="#">Anchor Link</a>
<h4>Colors</h4>
<ion-button>Default</ion-button>
<ion-button color="secondary">Secondary</ion-button>
<ion-button color="danger">Danger</ion-button>
<ion-button color="light">Light</ion-button>
<ion-button color="dark">Dark</ion-button>
<h4>Shapes</h4>
<ion-button full>Full Button</ion-button>
<ion-button block>Block Button</ion-button>
<ion-button round>Round Button</ion-button>
<h4>Outlines</h4>
<ion-button full outline>Outline + Full + No Color</ion-button>
<ion-button color="secondary" full outline>Outline + Full</ion-button>
<ion-button color="secondary" block outline>Outline + Block</ion-button>
<ion-button color="secondary" round outline>Outline + Round</ion-button>
<h4>Clear</h4>
<ion-button full clear>Clear + Full + No Color</ion-button>
<ion-button color="danger" full clear>Clear + Full</ion-button>
<ion-button color="danger" block clear>Clear + Block</ion-button>
<ion-button color="danger" round clear>Clear + Round</ion-button>
<h4>Icons</h4>
<ion-button color="dark">
<ion-icon slot="start" name="star"></ion-icon>
Left Icon
</ion-button>
<ion-button color="dark">
Right Icon
<ion-icon slot="end" name="star"></ion-icon>
</ion-button>
<ion-button color="dark">
<ion-icon slot="icon-only" name="star"></ion-icon>
</ion-button>
<h4>Sizes</h4>
<ion-button color="light" large>Large</ion-button>
<ion-button color="light">Default</ion-button>
<ion-button color="light" small>Small</ion-button>
<h4>States</h4>
<ion-button disabled>Large</ion-button>
<ion-button color="secondary" disabled clear>Large</ion-button>
</ion-content>
</ion-page>
</ion-app>
</body>
</html>

View File

@@ -0,0 +1,7 @@
const { register, navigate } = require('../../../../../scripts/e2e');
describe('button: basic', () => {
register('navigates', navigate('http://localhost:3333/src/components/button/test/basic'));
});

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="UTF-8">
<title>Button - 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-header>
<ion-toolbar>
<ion-title>Button - Basic</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding no-bounce>
<p><ion-button>Default</ion-button></p>
<p><ion-button color="primary">Primary</ion-button></p>
<p><ion-button color="secondary">Secondary</ion-button></p>
<p><ion-button color="danger">Danger</ion-button></p>
<p><ion-button color="light">Light</ion-button></p>
<p><ion-button color="dark">Dark</ion-button></p>
<p><ion-button disabled>Disabled</ion-button></p>
</ion-content>
</ion-page>
</ion-app>
</body>
</html>

View File

@@ -1,27 +0,0 @@
import { flush, render } from '@stencil/core/testing';
import { Button } from '../button';
describe('button', () => {
it('should render button inner text', async () => {
const root = await render({
components: [Button],
html: '<ion-button>Button Inner Text</ion-button>'
});
expect(root.textContent).toBe('Button Inner Text');
expect(root.querySelector('button').hasAttribute('disabled')).toBe(false);
root.disabled = true;
await flush(root);
expect(root.querySelector('button').hasAttribute('disabled')).toBe(true);
});
it('should default itemButton to false', () => {
const btn = new Button();
expect(btn.itemButton).toBe(false);
});
});

View File

@@ -1,11 +0,0 @@
'use strict';
const register = require('../../../../scripts/e2e-test-runner').register;
const E2ETestPage = require('../../../../scripts/E2ETestPage');
describe('button: toolbar', () => {
register('navigates', (driver) => {
const page = new E2ETestPage(driver, 'http://localhost:3333/src/components/button/test/toolbar.html');
return page.navigate();
});
});

View File

@@ -0,0 +1,5 @@
const { register, navigate } = require('../../../../../scripts/e2e');
describe('button: toolbar', () => {
register('navigates', navigate('http://localhost:3333/src/components/button/test/toolbar'));
});

View File

@@ -2,13 +2,19 @@
<html dir="ltr">
<head>
<meta charset="UTF-8">
<title>Ionic Toolbar Buttons</title>
<title>Button - Toolbar</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-header>
<ion-toolbar>
<ion-title>Button - Toolbar</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-toolbar no-padding>
<ion-title>This should have no padding</ion-title>
@@ -204,7 +210,7 @@
<ion-toolbar>
<ion-buttons slot="mode-end">
<ion-button #button1 (click)="buttonClick(button1)">
<ion-button>
<ion-icon slot="icon-only" name="star"></ion-icon>
</ion-button>
</ion-buttons>
@@ -216,7 +222,7 @@
<ion-toolbar>
<ion-buttons slot="mode-end">
<ion-button #button2 (click)="buttonClick(button2)">
<ion-button>
<ion-icon slot="icon-only" name="search"></ion-icon>
</ion-button>
</ion-buttons>