Skip to content

Commit be79382

Browse files
committed
test(e2e): refactor e2e tests to modular structure and utilize lazy loading where possible
refactor e2e tests to modular structure and utilize lazy loading where possible
1 parent 0d32e5e commit be79382

File tree

638 files changed

+5744
-3729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

638 files changed

+5744
-3729
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Component } from '@angular/core';
2+
import { PageOne } from '../pages/page-one/page-one';
3+
4+
@Component({
5+
template: '<ion-nav [root]="root"></ion-nav>'
6+
})
7+
export class AppComponent {
8+
root = PageOne;
9+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { IonicApp, IonicModule } from '../../../../..';
4+
5+
import { AppComponent } from './app.component';
6+
import { ModalPageModule } from '../pages/modal-page/modal-page.module';
7+
import { PageOneModule } from '../pages/page-one/page-one.module';
8+
9+
@NgModule({
10+
declarations: [
11+
AppComponent,
12+
],
13+
imports: [
14+
BrowserModule,
15+
IonicModule.forRoot(AppComponent),
16+
ModalPageModule,
17+
PageOneModule
18+
],
19+
bootstrap: [IonicApp]
20+
})
21+
export class AppModule {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
3+
import { AppModule } from './app.module';
4+
5+
platformBrowserDynamic().bootstrapModule(AppModule);

src/components/action-sheet/test/basic/e2e.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { by, element } from 'protractor';
12

23
it('should open action sheet', function() {
34
element(by.css('.e2eOpenActionSheet')).click();
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { NgModule } from '@angular/core';
2+
import { DeepLinkModule } from '../../../../../..';
3+
4+
import { ModalPage } from './modal-page';
5+
6+
@NgModule({
7+
declarations: [
8+
ModalPage,
9+
],
10+
imports: [
11+
DeepLinkModule.forChild(ModalPage),
12+
],
13+
entryComponents: [
14+
ModalPage,
15+
]
16+
})
17+
export class ModalPageModule {}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Component } from '@angular/core';
2+
import { ViewController } from '../../../../../..';
3+
4+
@Component({
5+
template: `
6+
<ion-header>
7+
<ion-toolbar>
8+
<ion-buttons start>
9+
<button ion-button (click)="dismiss()" strong>Close</button>
10+
</ion-buttons>
11+
<ion-title>Modal</ion-title>
12+
</ion-toolbar>
13+
</ion-header>
14+
<ion-content padding>
15+
Hi, I'm Bob, and I'm a modal.
16+
</ion-content>
17+
`
18+
})
19+
export class ModalPage {
20+
21+
constructor(public viewCtrl: ViewController) {}
22+
23+
dismiss() {
24+
this.viewCtrl.dismiss();
25+
}
26+
}

src/components/action-sheet/test/basic/main.html renamed to src/components/action-sheet/test/basic/pages/page-one/page-one.html

File renamed without changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { NgModule } from '@angular/core';
2+
import { DeepLinkModule } from '../../../../../..';
3+
4+
import { PageOne } from './page-one';
5+
6+
@NgModule({
7+
declarations: [
8+
PageOne,
9+
],
10+
imports: [
11+
DeepLinkModule.forChild(PageOne),
12+
],
13+
entryComponents: [
14+
PageOne,
15+
]
16+
})
17+
export class PageOneModule {}

src/components/action-sheet/test/basic/app.module.ts renamed to src/components/action-sheet/test/basic/pages/page-one/page-one.ts

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { Component, NgModule } from '@angular/core';
2-
import { IonicApp, IonicModule, ActionSheetController, AlertController, ModalController, ViewController, Platform } from '../../../../../ionic-angular';
1+
import { Component } from '@angular/core';
2+
import { ActionSheetController, AlertController, ModalController, Platform } from '../../../../../..';
3+
4+
import { ModalPage } from '../modal-page/modal-page';
35

46
@Component({
5-
templateUrl: 'main.html'
7+
templateUrl: 'page-one.html'
68
})
7-
export class E2EPage {
9+
export class PageOne {
810
result: string = '';
911

1012
constructor(public actionSheetCtrl: ActionSheetController, public alertCtrl: AlertController, public modalCtrl: ModalController, public plt: Platform) {}
@@ -152,53 +154,3 @@ export class E2EPage {
152154
}
153155

154156
}
155-
156-
@Component({
157-
template: `
158-
<ion-header>
159-
<ion-toolbar>
160-
<ion-buttons start>
161-
<button ion-button (click)="dismiss()" strong>Close</button>
162-
</ion-buttons>
163-
<ion-title>Modal</ion-title>
164-
</ion-toolbar>
165-
</ion-header>
166-
<ion-content padding>
167-
Hi, I'm Bob, and I'm a modal.
168-
</ion-content>
169-
`
170-
})
171-
export class ModalPage {
172-
173-
constructor(public viewCtrl: ViewController) {}
174-
175-
dismiss() {
176-
this.viewCtrl.dismiss();
177-
}
178-
}
179-
180-
181-
@Component({
182-
template: '<ion-nav [root]="root"></ion-nav>'
183-
})
184-
export class E2EApp {
185-
root = E2EPage;
186-
}
187-
188-
189-
@NgModule({
190-
declarations: [
191-
E2EApp,
192-
E2EPage,
193-
ModalPage
194-
],
195-
imports: [
196-
IonicModule.forRoot(E2EApp)
197-
],
198-
bootstrap: [IonicApp],
199-
entryComponents: [
200-
E2EPage,
201-
ModalPage
202-
]
203-
})
204-
export class AppModule {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Component } from '@angular/core';
2+
import { PageOne } from '../pages/page-one/page-one';
3+
4+
@Component({
5+
template: '<ion-nav [root]="root"></ion-nav>'
6+
})
7+
export class E2EApp {
8+
root = PageOne;
9+
}

0 commit comments

Comments
 (0)