Skip to content

Commit 1439b48

Browse files
committed
front: fix flaky e2e test 008
Signed-off-by: maymanaf <med.aymen.naf@gmail.com>
1 parent 74a2bcb commit 1439b48

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

front/tests/pages/op-timetable-page-model.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class OperationalStudiesTimetablePage extends CommonPage {
9494

9595
// Verify that simulation results are displayed
9696
async verifySimulationResultsVisibility(): Promise<void> {
97-
await this.page.waitForLoadState('networkidle');
97+
await this.page.waitForLoadState('networkidle', { timeout: 30_000 });
9898

9999
const simulationResultsLocators = [
100100
// TODO: remove this commented code when the design of simationBar has been changed
@@ -200,12 +200,13 @@ class OperationalStudiesTimetablePage extends CommonPage {
200200
const trainCount = await this.timetableTrains.count();
201201

202202
for (let currentTrainIndex = 0; currentTrainIndex < trainCount; currentTrainIndex += 1) {
203-
await this.page.waitForLoadState('networkidle');
204-
await this.waitForSimulationResults();
205-
const trainButton = OperationalStudiesTimetablePage.getTrainButton(
206-
this.timetableTrains.nth(currentTrainIndex)
207-
);
203+
const trainElementHandle = this.timetableTrains.nth(currentTrainIndex);
204+
205+
await trainElementHandle.scrollIntoViewIfNeeded();
206+
await trainElementHandle.waitFor();
207+
const trainButton = OperationalStudiesTimetablePage.getTrainButton(trainElementHandle);
208208
await trainButton.click({ position: { x: 5, y: 5 } });
209+
await this.waitForSimulationResults();
209210
await this.verifySimulationResultsVisibility();
210211
}
211212
}

0 commit comments

Comments
 (0)