1- import  { browser ,  by ,  element ,  Key }  from  'protractor' ; 
1+ import  { browser ,  by ,  element ,  Key ,   ExpectedConditions }  from  'protractor' ; 
22import  { screenshot }  from  '../../screenshot' ; 
33
44describe ( 'checkbox' ,  function  ( )  { 
@@ -17,31 +17,39 @@ describe('checkbox', function () {
1717      checkboxEl . click ( ) ; 
1818      inputEl . getAttribute ( 'checked' ) . then ( ( value : string )  =>  { 
1919        expect ( value ) . toBeTruthy ( 'Expect checkbox "checked" property to be true' ) ; 
20+         browser . wait ( ExpectedConditions . not ( 
21+           ExpectedConditions . presenceOf ( element ( by . css ( 'div.mat-ripple-element' ) ) ) ) ) 
22+           . then ( ( )  =>  screenshot ( 'checked' ) ) ; 
2023      } ) ; 
21-       screenshot ( 'checked' ) ; 
2224
2325      checkboxEl . click ( ) ; 
2426      inputEl . getAttribute ( 'checked' ) . then ( ( value : string )  =>  { 
2527        expect ( value ) . toBeFalsy ( 'Expect checkbox "checked" property to be false' ) ; 
28+         browser . wait ( ExpectedConditions . not ( 
29+           ExpectedConditions . presenceOf ( element ( by . css ( 'div.mat-ripple-element' ) ) ) ) ) 
30+           . then ( ( )  =>  screenshot ( 'unchecked' ) ) ; 
2631      } ) ; 
27-       screenshot ( 'unchecked' ) ; 
2832    } ) ; 
2933
3034    it ( 'should toggle the checkbox when pressing space' ,  ( )  =>  { 
3135      let  inputEl  =  element ( by . css ( 'input[id=input-test-checkbox]' ) ) ; 
3236
3337      inputEl . getAttribute ( 'checked' ) . then ( ( value : string )  =>  { 
3438        expect ( value ) . toBeFalsy ( 'Expect checkbox "checked" property to be false' ) ; 
35-         screenshot ( 'start' ) ; 
39+         browser . wait ( ExpectedConditions . not ( 
40+           ExpectedConditions . presenceOf ( element ( by . css ( 'div.mat-ripple-element' ) ) ) ) ) 
41+           . then ( ( )  =>  screenshot ( 'start' ) ) ; 
3642      } ) ; 
3743
3844      inputEl . sendKeys ( Key . SPACE ) ; 
3945
4046      inputEl . getAttribute ( 'checked' ) . then ( ( value : string )  =>  { 
4147        expect ( value ) . toBeTruthy ( 'Expect checkbox "checked" property to be true' ) ; 
42-         screenshot ( 'pressed space' ) ; 
48+         browser . wait ( ExpectedConditions . not ( 
49+           ExpectedConditions . presenceOf ( element ( by . css ( 'div.mat-ripple-element' ) ) ) ) ) 
50+           . then ( ( )  =>  screenshot ( 'pressed space' ) ) ; 
4351      } ) ; 
4452    } ) ; 
4553
4654  } ) ; 
47- } ) ; 
55+ } ) ; 
0 commit comments