test(tabs): uncomment tabs e2e and add colors test

This commit is contained in:
Brandy Carney
2018-07-10 15:11:14 -04:00
parent b46c3e2039
commit e131d55e0f
4 changed files with 185 additions and 54 deletions

View File

@ -1,20 +1,20 @@
// 'use strict';
'use strict';
// const { register, Page, platforms } = require('../../../../../scripts/e2e');
// const { getElement, waitAndGetElementById, waitForTransition } = require('../../../../../scripts/e2e/utils');
const { register, Page, platforms } = require('../../../../../scripts/e2e');
const { getElement, waitAndGetElementById, waitForTransition } = require('../../../../../scripts/e2e/utils');
// class E2ETestPage extends Page {
// constructor(driver, platform) {
// super(driver, `http://localhost:3333/src/components/tabs/test/basic?ionic:mode=${platform}`);
// }
// }
class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/tabs/test/basic?ionic:mode=${platform}`);
}
}
// platforms.forEach(platform => {
// describe('tabs/basic', () => {
// register('should init', driver => {
// const page = new E2ETestPage(driver, platform);
// return page.navigate();
// });
platforms.forEach(platform => {
describe('tabs/basic', () => {
register('should init', driver => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
// register('should check each tab', async (driver, testContext) => {
// testContext.timeout(60000);
@ -30,5 +30,5 @@
// tabThreeButton.click();
// await waitForTransition(600);
// });
// });
// });
});
});

View File

@ -0,0 +1,34 @@
'use strict';
const { register, Page, platforms } = require('../../../../../scripts/e2e');
const { getElement, waitAndGetElementById, waitForTransition } = require('../../../../../scripts/e2e/utils');
class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/tabs/test/colors?ionic:mode=${platform}`);
}
}
platforms.forEach(platform => {
describe('tabs/colors', () => {
register('should init', driver => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
// register('should check each tab', async (driver, testContext) => {
// testContext.timeout(60000);
// const page = new E2ETestPage(driver, platform);
// await waitForTransition(300);
// const tabTwoButton = await waitAndGetElementById(driver, 'tab-t-0-1');
// tabTwoButton.click();
// await waitForTransition(600);
// const tabThreeButton = await waitAndGetElementById(driver, 'tab-t-0-2');
// tabThreeButton.click();
// await waitForTransition(600);
// });
});
});

View File

@ -0,0 +1,97 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="UTF-8">
<title>Tab - Colors</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
<script src="/dist/ionic.js"></script>
<link rel="stylesheet" type="text/css" href="/css/ionic.min.css">
</head>
<body>
<ion-app>
<!-- Default -->
<ion-tabs>
<ion-tab label="Recents"></ion-tab>
<ion-tab label="Favorites"></ion-tab>
<ion-tab label="Settings"></ion-tab>
</ion-tabs>
<!-- Icons -->
<ion-tabs selected-index="1" color="primary">
<ion-tab icon="call"></ion-tab>
<ion-tab icon="heart"></ion-tab>
<ion-tab icon="settings"></ion-tab>
</ion-tabs>
<!-- Icons on top of text -->
<ion-tabs selected-index="2" color="secondary">
<ion-tab label="Location" icon="navigate"></ion-tab>
<ion-tab label="Favorites" icon="star"></ion-tab>
<ion-tab label="Radio" icon="musical-notes"></ion-tab>
</ion-tabs>
<!-- Icons below text -->
<ion-tabs tabbar-layout="icon-bottom" selected-index="1" color="dark">
<ion-tab label="Recents" icon="call"></ion-tab>
<ion-tab label="Favorites" icon="heart"></ion-tab>
<ion-tab label="Settings" icon="settings"></ion-tab>
</ion-tabs>
<!-- Icons right of text -->
<ion-tabs tabbar-layout="icon-end" selected-index="0" color="danger">
<ion-tab label="Recents" icon="call"></ion-tab>
<ion-tab label="Favorites" icon="heart"></ion-tab>
<ion-tab label="Settings" icon="settings"></ion-tab>
</ion-tabs>
<!-- Icons left of text -->
<ion-tabs tabbar-layout="icon-start" color="light">
<ion-tab label="Recents" icon="call"></ion-tab>
<ion-tab label="Favorites" icon="heart"></ion-tab>
<ion-tab label="Settings" icon="settings"></ion-tab>
</ion-tabs>
<!-- No icons -->
<ion-tabs tabbar-layout="icon-hide" color="primary">
<ion-tab label="Recents" icon="call"></ion-tab>
<ion-tab label="Favorites" icon="heart"></ion-tab>
<ion-tab label="Settings" icon="settings"></ion-tab>
</ion-tabs>
<!-- No label -->
<ion-tabs tabbar-layout="label-hide" color="secondary">
<ion-tab label="Recents" icon="call"></ion-tab>
<ion-tab label="Favorites" icon="heart"></ion-tab>
<ion-tab label="Settings" icon="settings"></ion-tab>
</ion-tabs>
<!-- No overflow text -->
<ion-tabs color="danger">
<ion-tab label="Indiana Jones and the Raiders of the Lost Ark"></ion-tab>
<ion-tab label="Indiana Jones and the Temple of Doom"></ion-tab>
<ion-tab label="Indiana Jones and the Last Crusade"></ion-tab>
</ion-tabs>
</ion-app>
<style>
ion-tabs {
position: relative;
height: 60px;
}
</style>
</body>
</html>

View File

@ -1,20 +1,20 @@
// 'use strict';
'use strict';
// const { register, Page, platforms } = require('../../../../../scripts/e2e');
// const { getElement, waitAndGetElementById, waitForTransition } = require('../../../../../scripts/e2e/utils');
const { register, Page, platforms } = require('../../../../../scripts/e2e');
const { getElement, waitAndGetElementById, waitForTransition } = require('../../../../../scripts/e2e/utils');
// class E2ETestPage extends Page {
// constructor(driver, platform) {
// super(driver, `http://localhost:3333/src/components/tabs/test/basic?ionic:mode=${platform}`);
// }
// }
class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/tabs/test/placements?ionic:mode=${platform}`);
}
}
// platforms.forEach(platform => {
// describe('tabs/basic', () => {
// register('should init', driver => {
// const page = new E2ETestPage(driver, platform);
// return page.navigate();
// });
platforms.forEach(platform => {
describe('tabs/placements', () => {
register('should init', driver => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
// register('should check each tab', async (driver, testContext) => {
// testContext.timeout(60000);
@ -30,5 +30,5 @@
// tabThreeButton.click();
// await waitForTransition(600);
// });
// });
// });
});
});