@@ -13,132 +13,132 @@ import {ProtractorHarnessEnvironment} from '@angular/cdk/testing/protractor';
13
13
import { $$ , element , by } from 'protractor' ;
14
14
15
15
describe ( 'performance baseline for the protractor harness' , ( ) => {
16
- it ( 'should retrieve all of the buttons' , async ( ) => {
17
- await runBenchmark ( {
18
- id : 'get-all-buttons' ,
19
- url : '' ,
20
- ignoreBrowserSynchronization : true ,
21
- params : [ ] ,
22
- work : async ( ) => $$ ( '.mat-button' ) ,
23
- } ) ;
24
- } ) ;
16
+ it ( 'should retrieve all of the buttons' , async ( ) => {
17
+ await runBenchmark ( {
18
+ id : 'get-all-buttons' ,
19
+ url : '' ,
20
+ ignoreBrowserSynchronization : true ,
21
+ params : [ ] ,
22
+ work : async ( ) => $$ ( '.mat-button' ) ,
23
+ } ) ;
24
+ } ) ;
25
25
26
- it ( 'should click the first button' , async ( ) => {
27
- await runBenchmark ( {
28
- id : 'click-first-button' ,
29
- url : '' ,
30
- ignoreBrowserSynchronization : true ,
31
- params : [ ] ,
32
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
33
- work : async ( ) => await element ( by . buttonText ( '0' ) ) . click ( ) ,
34
- } ) ;
35
- } ) ;
26
+ it ( 'should click the first button' , async ( ) => {
27
+ await runBenchmark ( {
28
+ id : 'click-first-button' ,
29
+ url : '' ,
30
+ ignoreBrowserSynchronization : true ,
31
+ params : [ ] ,
32
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
33
+ work : async ( ) => await element ( by . buttonText ( '0' ) ) . click ( ) ,
34
+ } ) ;
35
+ } ) ;
36
36
37
- it ( 'should click the middle button' , async ( ) => {
38
- await runBenchmark ( {
39
- id : 'click-middle-button' ,
40
- url : '' ,
41
- ignoreBrowserSynchronization : true ,
42
- params : [ ] ,
43
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
44
- work : async ( ) => await element ( by . buttonText ( '12' ) ) . click ( ) ,
45
- } ) ;
46
- } ) ;
37
+ it ( 'should click the middle button' , async ( ) => {
38
+ await runBenchmark ( {
39
+ id : 'click-middle-button' ,
40
+ url : '' ,
41
+ ignoreBrowserSynchronization : true ,
42
+ params : [ ] ,
43
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
44
+ work : async ( ) => await element ( by . buttonText ( '12' ) ) . click ( ) ,
45
+ } ) ;
46
+ } ) ;
47
47
48
- it ( 'should click the last button' , async ( ) => {
49
- await runBenchmark ( {
50
- id : 'click-last-button' ,
51
- url : '' ,
52
- ignoreBrowserSynchronization : true ,
53
- params : [ ] ,
54
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
55
- work : async ( ) => await element ( by . buttonText ( '24' ) ) . click ( ) ,
56
- } ) ;
57
- } ) ;
48
+ it ( 'should click the last button' , async ( ) => {
49
+ await runBenchmark ( {
50
+ id : 'click-last-button' ,
51
+ url : '' ,
52
+ ignoreBrowserSynchronization : true ,
53
+ params : [ ] ,
54
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
55
+ work : async ( ) => await element ( by . buttonText ( '24' ) ) . click ( ) ,
56
+ } ) ;
57
+ } ) ;
58
58
59
- it ( 'should click all of the buttons' , async ( ) => {
60
- await runBenchmark ( {
61
- id : 'click-every-button' ,
62
- url : '' ,
63
- ignoreBrowserSynchronization : true ,
64
- params : [ ] ,
65
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
66
- work : async ( ) => {
67
- const buttons = $$ ( '.mat-button' ) ;
68
- await buttons . each ( async ( button ) => await button ! . click ( ) ) ;
69
- }
70
- } ) ;
71
- } ) ;
59
+ it ( 'should click all of the buttons' , async ( ) => {
60
+ await runBenchmark ( {
61
+ id : 'click-every-button' ,
62
+ url : '' ,
63
+ ignoreBrowserSynchronization : true ,
64
+ params : [ ] ,
65
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
66
+ work : async ( ) => {
67
+ const buttons = $$ ( '.mat-button' ) ;
68
+ await buttons . each ( async ( button ) => await button ! . click ( ) ) ;
69
+ }
70
+ } ) ;
71
+ } ) ;
72
72
} ) ;
73
73
74
74
let loader : HarnessLoader ;
75
75
76
76
describe ( 'performance overhead of the protractor harness' , ( ) => {
77
- it ( 'should load the protractor harness environment' , async ( ) => {
78
- await runBenchmark ( {
79
- id : 'initial-harness-load' ,
80
- url : '' ,
81
- ignoreBrowserSynchronization : true ,
82
- params : [ ] ,
83
- work : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
84
- } ) ;
85
- } ) ;
77
+ it ( 'should load the protractor harness environment' , async ( ) => {
78
+ await runBenchmark ( {
79
+ id : 'initial-harness-load' ,
80
+ url : '' ,
81
+ ignoreBrowserSynchronization : true ,
82
+ params : [ ] ,
83
+ work : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
84
+ } ) ;
85
+ } ) ;
86
86
87
- it ( 'should retrieve all of the buttons' , async ( ) => {
88
- await runBenchmark ( {
89
- id : 'get-all-buttons' ,
90
- url : '' ,
91
- ignoreBrowserSynchronization : true ,
92
- params : [ ] ,
93
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
94
- work : async ( ) => await loader . getAllHarnesses ( MatButtonHarness ) ,
95
- } ) ;
96
- } ) ;
87
+ it ( 'should retrieve all of the buttons' , async ( ) => {
88
+ await runBenchmark ( {
89
+ id : 'get-all-buttons' ,
90
+ url : '' ,
91
+ ignoreBrowserSynchronization : true ,
92
+ params : [ ] ,
93
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
94
+ work : async ( ) => await loader . getAllHarnesses ( MatButtonHarness ) ,
95
+ } ) ;
96
+ } ) ;
97
97
98
- it ( 'should click the first button' , async ( ) => {
99
- await runBenchmark ( {
100
- id : 'click-first-button' ,
101
- url : '' ,
102
- ignoreBrowserSynchronization : true ,
103
- params : [ ] ,
104
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
105
- work : async ( ) => await ( await loader . getHarness ( MatButtonHarness . with ( { text : '0' } ) ) ) . click ( ) ,
106
- } ) ;
107
- } ) ;
98
+ it ( 'should click the first button' , async ( ) => {
99
+ await runBenchmark ( {
100
+ id : 'click-first-button' ,
101
+ url : '' ,
102
+ ignoreBrowserSynchronization : true ,
103
+ params : [ ] ,
104
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
105
+ work : async ( ) => await ( await loader . getHarness ( MatButtonHarness . with ( { text : '0' } ) ) ) . click ( ) ,
106
+ } ) ;
107
+ } ) ;
108
108
109
- it ( 'should click the middle button' , async ( ) => {
110
- await runBenchmark ( {
111
- id : 'click-middle-button' ,
112
- url : '' ,
113
- ignoreBrowserSynchronization : true ,
114
- params : [ ] ,
115
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
116
- work : async ( ) => await ( await loader . getHarness ( MatButtonHarness . with ( { text : '12' } ) ) ) . click ( ) ,
117
- } ) ;
118
- } ) ;
109
+ it ( 'should click the middle button' , async ( ) => {
110
+ await runBenchmark ( {
111
+ id : 'click-middle-button' ,
112
+ url : '' ,
113
+ ignoreBrowserSynchronization : true ,
114
+ params : [ ] ,
115
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
116
+ work : async ( ) => await ( await loader . getHarness ( MatButtonHarness . with ( { text : '12' } ) ) ) . click ( ) ,
117
+ } ) ;
118
+ } ) ;
119
119
120
- it ( 'should click the last button' , async ( ) => {
121
- await runBenchmark ( {
122
- id : 'click-last-button' ,
123
- url : '' ,
124
- ignoreBrowserSynchronization : true ,
125
- params : [ ] ,
126
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
127
- work : async ( ) => await ( await loader . getHarness ( MatButtonHarness . with ( { text : '24' } ) ) ) . click ( ) ,
128
- } ) ;
129
- } ) ;
120
+ it ( 'should click the last button' , async ( ) => {
121
+ await runBenchmark ( {
122
+ id : 'click-last-button' ,
123
+ url : '' ,
124
+ ignoreBrowserSynchronization : true ,
125
+ params : [ ] ,
126
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
127
+ work : async ( ) => await ( await loader . getHarness ( MatButtonHarness . with ( { text : '24' } ) ) ) . click ( ) ,
128
+ } ) ;
129
+ } ) ;
130
130
131
- it ( 'should click all of the buttons' , async ( ) => {
132
- await runBenchmark ( {
133
- id : 'click-every-button' ,
134
- url : '' ,
135
- ignoreBrowserSynchronization : true ,
136
- params : [ ] ,
137
- setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
138
- work : async ( ) => {
139
- const buttons = await loader . getAllHarnesses ( MatButtonHarness ) ;
140
- buttons . forEach ( async ( button ) => await button . click ( ) ) ;
141
- }
142
- } ) ;
143
- } ) ;
131
+ it ( 'should click all of the buttons' , async ( ) => {
132
+ await runBenchmark ( {
133
+ id : 'click-every-button' ,
134
+ url : '' ,
135
+ ignoreBrowserSynchronization : true ,
136
+ params : [ ] ,
137
+ setup : ( ) => { loader = ProtractorHarnessEnvironment . loader ( ) ; } ,
138
+ work : async ( ) => {
139
+ const buttons = await loader . getAllHarnesses ( MatButtonHarness ) ;
140
+ buttons . forEach ( async ( button ) => await button . click ( ) ) ;
141
+ }
142
+ } ) ;
143
+ } ) ;
144
144
} ) ;
0 commit comments