-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(loading): add e2e test for loading in tabs and remove animation …
…for basic e2e references #5426
- Loading branch information
1 parent
1d6569a
commit 41a6524
Showing
5 changed files
with
111 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
it('should show default spinner', function() { | ||
element(by.css('.e2eLoadingTabsContent')).click(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import {App, Page, ActionSheet, Loading, NavController, ViewController, Platform} from 'ionic-angular'; | ||
|
||
|
||
@Page({ | ||
templateUrl: 'main.html' | ||
}) | ||
class E2EPage { | ||
constructor(private nav: NavController, private platform: Platform) {} | ||
|
||
presentLoading() { | ||
let loading = Loading.create({ | ||
spinner: 'hide', | ||
content: 'Loading...', | ||
duration: 1000 | ||
}); | ||
|
||
this.nav.present(loading); | ||
} | ||
|
||
presentLoadingNav() { | ||
let loading = Loading.create({ | ||
content: 'Please wait...', | ||
}); | ||
|
||
this.nav.present(loading); | ||
|
||
setTimeout(() => { | ||
this.nav.push(Page2); | ||
|
||
setTimeout(() => { | ||
loading.dismiss(); | ||
}, 1000); | ||
}, 1000); | ||
} | ||
|
||
} | ||
|
||
@Page({ | ||
template: ` | ||
<ion-navbar *navbar> | ||
<ion-title>Page 2</ion-title> | ||
</ion-navbar> | ||
<ion-content padding>Some content</ion-content> | ||
` | ||
}) | ||
class Page2 { | ||
constructor(private nav: NavController, private platform: Platform) {} | ||
} | ||
|
||
@Page({ | ||
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 { | ||
private root1 = E2EPage; | ||
private root2 = Page2; | ||
private root3 = E2EPage; | ||
|
||
constructor() { | ||
|
||
} | ||
} | ||
|
||
@App({ | ||
template: '<ion-nav [root]="root"></ion-nav>' | ||
}) | ||
class E2EApp { | ||
root = TabsPage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
<ion-navbar *navbar> | ||
<ion-title>Loading</ion-title> | ||
</ion-navbar> | ||
|
||
<ion-content padding> | ||
<button block (click)="presentLoading()" class="e2eLoadingTabsContent">Loading Content</button> | ||
<button block (click)="presentLoadingNav()">Loading w/ Nav</button> | ||
</ion-content> |