1
1
"use strict" ;
2
2
3
+ var PageObject_Welcome = require ( "./welcome.po.js" ) . PageObject_Welcome ;
4
+ var PageObject_Skeleton = require ( "./skeleton.po.js" ) . PageObject_Skeleton ;
5
+
6
+
3
7
describe ( "aurelia skeleton app" , function ( ) {
8
+ var po_welcome , po_skeleton ;
9
+
4
10
beforeEach ( function ( ) {
11
+ po_skeleton = new PageObject_Skeleton ( ) ;
12
+ po_welcome = new PageObject_Welcome ( ) ;
13
+
5
14
browser . get ( "http://localhost:9000" ) ;
6
15
7
16
browser . executeAsyncScript ( "var cb = arguments[arguments.length - 1];" + "document.addEventListener(\"aurelia-composed\", function (e) {" + " cb(\"Aurelia App composed\")" + "}, false);" ) . then ( function ( result ) {
8
17
console . log ( result ) ;
9
18
} ) ;
10
19
} ) ;
11
20
12
- it ( "should load the page" , function ( ) {
13
- expect ( browser . getTitle ( ) ) . toBe ( "Welcome | Aurelia" ) ;
21
+ it ( "should load the page and display the initial page title" , function ( ) {
22
+ expect ( po_skeleton . getCurrentPageTitle ( ) ) . toBe ( "Welcome | Aurelia" ) ;
23
+ } ) ;
24
+
25
+ it ( "should display greeting" , function ( ) {
26
+ expect ( po_welcome . getGreeting ( ) ) . toBe ( "Welcome to the Aurelia Navigation App!" ) ;
27
+ } ) ;
28
+
29
+ it ( "should automatically write down the fullname" , function ( ) {
30
+ po_welcome . setFirstname ( "Rob" ) ;
31
+ po_welcome . setLastname ( "Eisenberg" ) ;
32
+ expect ( po_welcome . getFullname ( ) ) . toBe ( "ROB EISENBERG" ) ;
33
+ } ) ;
34
+
35
+ it ( "should show alert message when clicking submit button" , function ( ) {
36
+ expect ( po_welcome . openAlertDialog ( ) ) . toBe ( true ) ;
37
+
38
+ // close it again otherwhise your testing browser starts to hang
39
+ /*po_welcome.closeAlert();*/
40
+ } ) ;
41
+
42
+ iit ( "should navigate to flickr page" , function ( ) {
43
+ po_skeleton . navigateTo ( "#/flickr" ) ;
44
+ expect ( po_skeleton . getCurrentPageTitle ( ) ) . toBe ( "Flickr | Aurelia" ) ;
14
45
} ) ;
15
46
} ) ;
0 commit comments