Skip to content

Commit

Permalink
front: fix time and tolerance modal not closing for e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: maymanaf <[email protected]>
  • Loading branch information
Maymanaf committed Jan 6, 2025
1 parent e758cf2 commit 32dbd50
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions front/tests/pages/stdcm-page-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ class STDCMPage {

readonly timeDestinationArrival: Locator;

readonly closeTimePickerButton: Locator;

readonly toleranceDestinationArrival: Locator;

readonly closeTolerancePickerButton: Locator;

readonly warningBox: Locator;

readonly suggestionList: Locator;
Expand Down Expand Up @@ -183,7 +187,9 @@ class STDCMPage {
this.destinationArrival = page.locator('#select-destination-arrival');
this.dateDestinationArrival = page.locator('#date-destination-arrival');
this.timeDestinationArrival = page.locator('#time-destination-arrival');
this.closeTimePickerButton = page.locator('.time-picker .close-button');
this.toleranceDestinationArrival = page.locator('#stdcm-tolerance-destination-arrival');
this.closeTolerancePickerButton = page.locator('.tolerance-picker .close-button');
this.warningBox = page.getByTestId('warning-box');
this.suggestionList = page.locator('.suggestions-list');
this.suggestionItems = this.suggestionList.locator('.suggestion-item');
Expand Down Expand Up @@ -498,7 +504,7 @@ class STDCMPage {
await this.setHourLocator(updatedDetails.hour);
await this.setMinuteLocator(updatedDetails.minute);
await this.incrementButton.dblclick(); // Double-click the +1 minute button to reach 37
await this.timeDestinationArrival.click();
await this.closeTimePickerButton.click();
await expect(this.timeDestinationArrival).toHaveValue(updatedDetails.timeValue);

// Update tolerance and verify warning box
Expand Down Expand Up @@ -541,8 +547,7 @@ class STDCMPage {
await this.page.getByRole('button', { name: minusValue, exact: true }).click();
await this.page.getByRole('button', { name: plusValue, exact: true }).click();
await expect(toleranceField).toHaveValue(`${minusValue}/${plusValue}`);
// TODO : Add a click on the close button instead of clicking on the map when #693 is done
await this.mapContainer.click();
await this.closeTolerancePickerButton.click();
}

async fillAndVerifyViaDetails({
Expand Down

0 comments on commit 32dbd50

Please sign in to comment.