@@ -156,6 +156,10 @@ const runTests = async (): Promise<void> => {
156
156
for ( let testIndex = 0 ; testIndex < tests . length ; testIndex ++ ) {
157
157
const test = Object . values ( config . TESTS_CONFIG ) [ testIndex ] ;
158
158
159
+ // re-instal app for each new test suite
160
+ await installApp ( config . MAIN_APP_PACKAGE , mainAppPath ) ;
161
+ await installApp ( config . DELTA_APP_PACKAGE , deltaAppPath ) ;
162
+
159
163
// check if we want to skip the test
160
164
if ( args . includes ( '--includes' ) ) {
161
165
const includes = args [ args . indexOf ( '--includes' ) + 1 ] ;
@@ -177,11 +181,17 @@ const runTests = async (): Promise<void> => {
177
181
178
182
const warmupText = `Warmup for test '${ test . name } ' [${ testIndex + 1 } /${ tests . length } ]` ;
179
183
180
- // Warmup the main app:
181
- await runTestIteration ( config . MAIN_APP_PACKAGE , `[MAIN] ${ warmupText } ` ) ;
184
+ // by default we do 2 warmups:
185
+ // - first warmup to pass a login flow
186
+ // - second warmup to pass an actual flow and cache network requests
187
+ const iterations = test . warmupRuns ?? 2 ;
188
+ for ( let i = 0 ; i < iterations ; i ++ ) {
189
+ // Warmup the main app:
190
+ await runTestIteration ( config . MAIN_APP_PACKAGE , `[MAIN] ${ warmupText } . Iteration ${ i + 1 } /${ iterations } ` ) ;
182
191
183
- // Warmup the delta app:
184
- await runTestIteration ( config . DELTA_APP_PACKAGE , `[DELTA] ${ warmupText } ` ) ;
192
+ // Warmup the delta app:
193
+ await runTestIteration ( config . DELTA_APP_PACKAGE , `[DELTA] ${ warmupText } . Iteration ${ i + 1 } /${ iterations } ` ) ;
194
+ }
185
195
186
196
// For each test case we allow the test to fail three times before we stop the test run:
187
197
const errorCountRef = {
0 commit comments