test(e2e) loading/tabs

This commit is contained in:
Daniel Imhoff
2017-03-03 11:54:19 -06:00
parent 73b7a00771
commit 3c4ed81845
11 changed files with 150 additions and 93 deletions

View File

@ -1,93 +0,0 @@
import { Component, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, LoadingController, NavController } from '../../../..';
@Component({
templateUrl: 'main.html'
})
export class E2EPage {
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoading() {
let loading = this.loadingCtrl.create({
spinner: 'hide',
content: 'Loading...',
duration: 1000
});
loading.present();
}
presentLoadingNav() {
let loading = this.loadingCtrl.create({
content: 'Please wait...',
});
loading.present();
setTimeout(() => {
this.navCtrl.push(Page2);
setTimeout(() => {
loading.dismiss();
}, 1000);
}, 1000);
}
}
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>Some content</ion-content>
`
})
export class Page2 {}
@Component({
template: `
<ion-tabs>
<ion-tab tabTitle="Plain List" tabIcon="star" [root]="root1"></ion-tab>
<ion-tab tabTitle="Schedule" tabIcon="globe" [root]="root2"></ion-tab>
<ion-tab tabTitle="Stopwatch" tabIcon="stopwatch" [root]="root3"></ion-tab>
</ion-tabs>
`
})
export class TabsPage {
root1 = E2EPage;
root2 = Page2;
root3 = E2EPage;
}
@Component({
template: '<ion-nav [root]="root"></ion-nav>'
})
export class E2EApp {
root = TabsPage;
}
@NgModule({
declarations: [
E2EApp,
E2EPage,
TabsPage,
Page2
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp)
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
E2EPage,
TabsPage,
Page2
]
})
export class AppModule {}

View File

@ -0,0 +1,8 @@
import { Component } from '@angular/core';
@Component({
template: '<ion-nav [root]="root"></ion-nav>'
})
export class E2EApp {
root = 'TabsPage';
}

View File

@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';
import { E2EApp } from './app.component';
@NgModule({
declarations: [
E2EApp
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ loadChildren: '../pages/main/main.module#E2EPageModule', name: 'E2EPage' },
{ loadChildren: '../pages/page2/page2.module#Page2Module', name: 'Page2' },
{ loadChildren: '../pages/tabs/tabs.module#TabsPageModule', name: 'TabsPage' }
]
})
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp
]
})
export class AppModule {}

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { E2EPage } from './main';
@NgModule({
declarations: [
E2EPage,
],
imports: [
DeepLinkModule.forChild(E2EPage)
],
entryComponents: [
E2EPage,
]
})
export class E2EPageModule {}

View File

@ -0,0 +1,36 @@
import { Component } from '@angular/core';
import { LoadingController, NavController } from '../../../../../..';
@Component({
templateUrl: 'main.html'
})
export class E2EPage {
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoading() {
let loading = this.loadingCtrl.create({
spinner: 'hide',
content: 'Loading...',
duration: 1000
});
loading.present();
}
presentLoadingNav() {
let loading = this.loadingCtrl.create({
content: 'Please wait...',
});
loading.present();
setTimeout(() => {
this.navCtrl.push('Page2');
setTimeout(() => {
loading.dismiss();
}, 1000);
}, 1000);
}
}

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { Page2 } from './page2';
@NgModule({
declarations: [
Page2,
],
imports: [
DeepLinkModule.forChild(Page2)
],
entryComponents: [
Page2,
]
})
export class Page2Module {}

View File

@ -0,0 +1,13 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>Some content</ion-content>
`
})
export class Page2 {}

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { TabsPage } from './tabs';
@NgModule({
declarations: [
TabsPage,
],
imports: [
DeepLinkModule.forChild(TabsPage)
],
entryComponents: [
TabsPage,
]
})
export class TabsPageModule {}

View File

@ -0,0 +1,16 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-tabs>
<ion-tab tabTitle="Plain List" tabIcon="star" [root]="root1"></ion-tab>
<ion-tab tabTitle="Schedule" tabIcon="globe" [root]="root2"></ion-tab>
<ion-tab tabTitle="Stopwatch" tabIcon="stopwatch" [root]="root3"></ion-tab>
</ion-tabs>
`
})
export class TabsPage {
root1 = 'E2EPage';
root2 = 'Page2';
root3 = 'E2EPage';
}