1
- import { browser , by , element } from 'protractor' ;
1
+ import { browser , by , element , ExpectedConditions } from 'protractor' ;
2
+ import { screenshot } from '../../screenshot' ;
2
3
3
4
describe ( 'radio' , ( ) => {
4
5
describe ( 'disabling behavior' , ( ) => {
@@ -8,6 +9,9 @@ describe('radio', () => {
8
9
element ( by . id ( 'water' ) ) . click ( ) ;
9
10
element ( by . id ( 'water' ) ) . getAttribute ( 'class' ) . then ( ( value : string ) => {
10
11
expect ( value ) . toContain ( 'mat-radio-checked' ) ;
12
+ browser . wait ( ExpectedConditions . not (
13
+ ExpectedConditions . presenceOf ( element ( by . css ( 'div.mat-ripple-element' ) ) ) ) )
14
+ . then ( ( ) => screenshot ( 'water' ) ) ;
11
15
} ) ;
12
16
element ( by . css ( 'input[id=water-input]' ) ) . getAttribute ( 'checked' ) . then ( ( value : string ) => {
13
17
expect ( value ) . toBeTruthy ( ) ;
@@ -19,6 +23,9 @@ describe('radio', () => {
19
23
element ( by . id ( 'leaf' ) ) . click ( ) ;
20
24
element ( by . id ( 'leaf' ) ) . getAttribute ( 'class' ) . then ( ( value : string ) => {
21
25
expect ( value ) . toContain ( 'mat-radio-checked' ) ;
26
+ browser . wait ( ExpectedConditions . not (
27
+ ExpectedConditions . presenceOf ( element ( by . css ( 'div.mat-ripple-element' ) ) ) ) )
28
+ . then ( ( ) => screenshot ( 'leaf' ) ) ;
22
29
} ) ;
23
30
element ( by . css ( 'input[id=leaf-input]' ) ) . getAttribute ( 'checked' ) . then ( ( value : string ) => {
24
31
expect ( value ) . toBeTruthy ( ) ;
@@ -33,14 +40,20 @@ describe('radio', () => {
33
40
element ( by . id ( 'water' ) ) . click ( ) ;
34
41
element ( by . id ( 'water' ) ) . getAttribute ( 'class' ) . then ( ( value : string ) => {
35
42
expect ( value ) . toContain ( 'mat-radio-disabled' ) ;
43
+ browser . wait ( ExpectedConditions . not (
44
+ ExpectedConditions . presenceOf ( element ( by . css ( 'div.mat-ripple-element' ) ) ) ) )
45
+ . then ( ( ) => screenshot ( 'water' ) ) ;
36
46
} ) ;
37
- element ( by . css ( 'input[id=water-input]' ) ) . getAttribute ( 'disabled' ) . then ( ( value : string ) => {
47
+ element ( by . css ( 'input[id=water-input]' ) ) . getAttribute ( 'disabled' ) . then ( ( value : string ) => {
38
48
expect ( value ) . toBeTruthy ( ) ;
39
49
} ) ;
40
50
41
51
element ( by . id ( 'leaf' ) ) . click ( ) ;
42
52
element ( by . id ( 'leaf' ) ) . getAttribute ( 'class' ) . then ( ( value : string ) => {
43
53
expect ( value ) . toContain ( 'mat-radio-disabled' ) ;
54
+ browser . wait ( ExpectedConditions . not (
55
+ ExpectedConditions . presenceOf ( element ( by . css ( 'div.mat-ripple-element' ) ) ) ) )
56
+ . then ( ( ) => screenshot ( 'leaf' ) ) ;
44
57
} ) ;
45
58
element ( by . css ( 'input[id=leaf-input]' ) ) . getAttribute ( 'disabled' ) . then ( ( value : string ) => {
46
59
expect ( value ) . toBeTruthy ( ) ;
0 commit comments