@@ -42,7 +42,7 @@ export let benchRun = new (class extends CPUBenchmarkPlaywright {
42
42
}
43
43
async init ( browser : Browser , page : Page ) {
44
44
await checkElementExists ( page , "#run" ) ;
45
- for ( let i = 0 ; i < config . WARMUP_COUNT ; i ++ ) {
45
+ for ( let i = 0 ; i < this . benchmarkInfo . warmupCount ; i ++ ) {
46
46
await clickElement ( page , "#run" ) ;
47
47
await checkElementContainsText ( page , "tbody>tr:nth-of-type(1)>td:nth-of-type(1)" , ( i * 1000 + 1 ) . toFixed ( ) ) ;
48
48
await clickElement ( page , "#clear" ) ;
@@ -51,7 +51,7 @@ export let benchRun = new (class extends CPUBenchmarkPlaywright {
51
51
}
52
52
async run ( browser : Browser , page : Page ) {
53
53
await clickElement ( page , "#run" ) ;
54
- await checkElementContainsText ( page , "tbody>tr:nth-of-type(1000)>td:nth-of-type(1)" , ( ( config . WARMUP_COUNT + 1 ) * 1000 ) . toFixed ( ) ) ;
54
+ await checkElementContainsText ( page , "tbody>tr:nth-of-type(1000)>td:nth-of-type(1)" , ( ( this . benchmarkInfo . warmupCount + 1 ) * 1000 ) . toFixed ( ) ) ;
55
55
}
56
56
} ) ( ) ;
57
57
@@ -61,7 +61,7 @@ export const benchReplaceAll = new (class extends CPUBenchmarkPlaywright {
61
61
}
62
62
async init ( browser : Browser , page : Page ) {
63
63
await checkElementExists ( page , "#run" ) ;
64
- for ( let i = 0 ; i < config . WARMUP_COUNT ; i ++ ) {
64
+ for ( let i = 0 ; i < this . benchmarkInfo . warmupCount ; i ++ ) {
65
65
await clickElement ( page , "#run" ) ;
66
66
await checkElementContainsText ( page , "tbody>tr:nth-of-type(1)>td:nth-of-type(1)" , ( i * 1000 + 1 ) . toFixed ( ) ) ;
67
67
}
@@ -99,7 +99,7 @@ export const benchSelect = new (class extends CPUBenchmarkPlaywright {
99
99
await checkElementExists ( page , "#run" ) ;
100
100
await clickElement ( page , "#run" ) ;
101
101
await checkElementContainsText ( page , "tbody>tr:nth-of-type(1000)>td:nth-of-type(1)" , "1000" ) ;
102
- for ( let i = 0 ; i <= config . WARMUP_COUNT ; i ++ ) {
102
+ for ( let i = 0 ; i <= this . benchmarkInfo . warmupCount ; i ++ ) {
103
103
await clickElement ( page , `tbody>tr:nth-of-type(${ i + 5 } )>td:nth-of-type(2)>a` ) ;
104
104
await checkElementHasClass ( page , `tbody>tr:nth-of-type(${ i + 5 } )` , "danger" ) ;
105
105
await checkCountForSelector ( page , "tbody>tr.danger" , 1 ) ;
@@ -119,7 +119,7 @@ export const benchSwapRows = new (class extends CPUBenchmarkPlaywright {
119
119
await checkElementExists ( page , "#run" ) ;
120
120
await clickElement ( page , "#run" ) ;
121
121
await checkElementExists ( page , "tbody>tr:nth-of-type(1000)>td:nth-of-type(1)" ) ;
122
- for ( let i = 0 ; i <= config . WARMUP_COUNT ; i ++ ) {
122
+ for ( let i = 0 ; i <= this . benchmarkInfo . warmupCount ; i ++ ) {
123
123
let text = i % 2 == 0 ? "2" : "999" ;
124
124
await clickElement ( page , "#swaprows" ) ;
125
125
await checkElementContainsText ( page , "tbody>tr:nth-of-type(999)>td:nth-of-type(1)" , text ) ;
@@ -140,10 +140,10 @@ export const benchRemove = new (class extends CPUBenchmarkPlaywright {
140
140
await checkElementExists ( page , "#run" ) ;
141
141
await clickElement ( page , "#run" ) ;
142
142
await checkElementExists ( page , "tbody>tr:nth-of-type(1000)>td:nth-of-type(1)" ) ;
143
- for ( let i = 0 ; i < config . WARMUP_COUNT ; i ++ ) {
144
- await checkElementContainsText ( page , `tbody>tr:nth-of-type(${ config . WARMUP_COUNT - i + 4 } )>td:nth-of-type(1)` , ( config . WARMUP_COUNT - i + 4 ) . toString ( ) ) ;
145
- await clickElement ( page , `tbody>tr:nth-of-type(${ config . WARMUP_COUNT - i + 4 } )>td:nth-of-type(3)>a>span:nth-of-type(1)` ) ;
146
- await checkElementContainsText ( page , `tbody>tr:nth-of-type(${ config . WARMUP_COUNT - i + 4 } )>td:nth-of-type(1)` , "10" ) ;
143
+ for ( let i = 0 ; i < this . benchmarkInfo . warmupCount ; i ++ ) {
144
+ await checkElementContainsText ( page , `tbody>tr:nth-of-type(${ this . benchmarkInfo . warmupCount - i + 4 } )>td:nth-of-type(1)` , ( this . benchmarkInfo . warmupCount - i + 4 ) . toString ( ) ) ;
145
+ await clickElement ( page , `tbody>tr:nth-of-type(${ this . benchmarkInfo . warmupCount - i + 4 } )>td:nth-of-type(3)>a>span:nth-of-type(1)` ) ;
146
+ await checkElementContainsText ( page , `tbody>tr:nth-of-type(${ this . benchmarkInfo . warmupCount - i + 4 } )>td:nth-of-type(1)` , "10" ) ;
147
147
}
148
148
await checkElementContainsText ( page , `tbody>tr:nth-of-type(5)>td:nth-of-type(1)` , "10" ) ;
149
149
await checkElementContainsText ( page , `tbody>tr:nth-of-type(4)>td:nth-of-type(1)` , "4" ) ;
@@ -165,7 +165,7 @@ export const benchRunBig = new (class extends CPUBenchmarkPlaywright {
165
165
}
166
166
async init ( browser : Browser , page : Page ) {
167
167
await checkElementExists ( page , "#run" ) ;
168
- for ( let i = 0 ; i < config . WARMUP_COUNT ; i ++ ) {
168
+ for ( let i = 0 ; i < this . benchmarkInfo . warmupCount ; i ++ ) {
169
169
await clickElement ( page , "#run" ) ;
170
170
await checkElementContainsText ( page , "tbody>tr:nth-of-type(1)>td:nth-of-type(1)" , ( i * 1000 + 1 ) . toFixed ( ) ) ;
171
171
await clickElement ( page , "#clear" ) ;
@@ -184,7 +184,7 @@ export const benchAppendToManyRows = new (class extends CPUBenchmarkPlaywright {
184
184
}
185
185
async init ( browser : Browser , page : Page ) {
186
186
await checkElementExists ( page , "#run" ) ;
187
- for ( let i = 0 ; i < config . WARMUP_COUNT ; i ++ ) {
187
+ for ( let i = 0 ; i < this . benchmarkInfo . warmupCount ; i ++ ) {
188
188
await clickElement ( page , "#run" ) ;
189
189
await checkElementContainsText ( page , "tbody>tr:nth-of-type(1)>td:nth-of-type(1)" , ( i * 1000 + 1 ) . toFixed ( ) ) ;
190
190
await clickElement ( page , "#clear" ) ;
@@ -205,14 +205,14 @@ export const benchClear = new (class extends CPUBenchmarkPlaywright {
205
205
}
206
206
async init ( browser : Browser , page : Page ) {
207
207
await checkElementExists ( page , "#run" ) ;
208
- for ( let i = 0 ; i < config . WARMUP_COUNT ; i ++ ) {
208
+ for ( let i = 0 ; i < this . benchmarkInfo . warmupCount ; i ++ ) {
209
209
await clickElement ( page , "#run" ) ;
210
210
await checkElementContainsText ( page , "tbody>tr:nth-of-type(1)>td:nth-of-type(1)" , ( i * 1000 + 1 ) . toFixed ( ) ) ;
211
211
await clickElement ( page , "#clear" ) ;
212
212
await checkElementNotExists ( page , "tbody>tr:nth-of-type(1000)>td:nth-of-type(1)" ) ;
213
213
}
214
214
await clickElement ( page , "#run" ) ;
215
- await checkElementContainsText ( page , "tbody>tr:nth-of-type(1)>td:nth-of-type(1)" , ( config . WARMUP_COUNT * 1000 + 1 ) . toFixed ( ) ) ;
215
+ await checkElementContainsText ( page , "tbody>tr:nth-of-type(1)>td:nth-of-type(1)" , ( this . benchmarkInfo . warmupCount * 1000 + 1 ) . toFixed ( ) ) ;
216
216
}
217
217
async run ( browser : Browser , page : Page ) {
218
218
await clickElement ( page , "#clear" ) ;
0 commit comments