@@ -18,23 +18,39 @@ describe('Angular Timer E2E Tests', function () {
18
18
it ( "Simple Timer - Should stop ticking when user clicks 'Stop' button" , function ( ) {
19
19
sleep ( 1 ) ;
20
20
element ( '#basic-timer button:last-child' ) . click ( ) ;
21
- var originalValue = null ;
22
- element ( '#basic-timer span' ) . query ( function ( span , done ) {
23
- originalValue = span . html ( ) ;
21
+ var oldValue = null ;
22
+ element ( '#basic-timer timer span' ) . query ( function ( span , done ) {
23
+ oldValue = span . html ( ) ;
24
24
done ( ) ;
25
25
} ) ;
26
26
sleep ( 1 ) ;
27
- element ( '#basic-timer span' ) . query ( function ( span , done ) {
28
- expect ( value ( originalValue ) ) . toBe ( span . html ( ) ) ;
27
+ element ( '#basic-timer timer span' ) . query ( function ( span , done ) {
28
+ expect ( value ( oldValue ) ) . toBe ( span . html ( ) ) ;
29
29
done ( ) ;
30
30
} ) ;
31
31
} ) ;
32
32
33
33
it ( 'Simple Timer - Should reset timer value when user click on start button again' , function ( ) {
34
- sleep ( 1 ) ;
35
- var oldValue = element ( '#basic-timer span' ) . text ( ) ;
34
+ sleep ( 2 ) ;
35
+ var oldValue = element ( '#basic-timer timer span' ) . text ( ) ;
36
36
element ( '#basic-timer button:nth-child(3)' ) . click ( ) ;
37
- element ( '#basic-timer button:last-child' ) . click ( ) ;
38
37
expect ( element ( '#basic-timer span' ) . text ( ) ) . toBeLessThan ( oldValue ) ;
39
38
} ) ;
39
+
40
+ it ( 'Clock Timer - with hours, minutes & seconds' , function ( ) {
41
+ expect ( element ( '#clock-timer timer' ) . html ( ) ) . toMatch ( / 0 h o u r s , / ) ;
42
+ expect ( element ( '#clock-timer timer' ) . html ( ) ) . toMatch ( / 0 m i n u t e s , / ) ;
43
+ expect ( element ( '#clock-timer timer' ) . html ( ) ) . toMatch ( / s e c o n d s ./ ) ;
44
+ } ) ;
45
+
46
+ it ( 'Countdown Timer - Starts from 100' , function ( ) {
47
+ expect ( element ( '#countdown-timer timer' ) . html ( ) ) . toBeLessThan ( 100 ) ;
48
+ } ) ;
49
+
50
+ it ( 'Autostart False Timer - Init from 0' , function ( ) {
51
+ expect ( element ( '#auto-start-false-timer timer' ) . html ( ) ) . toBe ( '0' ) ;
52
+ element ( '#auto-start-false-timer button:nth-child(3)' ) . click ( ) ;
53
+ sleep ( 2 ) ;
54
+ expect ( element ( '#auto-start-false-timer timer' ) . html ( ) ) . toBeLessThan ( 100 ) ;
55
+ } ) ;
40
56
} ) ;
0 commit comments