Skip to content

Commit

Permalink
fixup! front: handle uncaught exceptions for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maymanaf committed Feb 18, 2025
1 parent accd861 commit d8d5afc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion front/tests/002-project-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test.describe('Validate the Operational Study Project workflow', () => {
});

// Navigate back to the Operational Studies page via the home page
await projectPage.goToHomePage();
await projectPage.backToHomePage();
await projectPage.goToOperationalStudiesPage();

// Reopen the updated project and validate the updated data
Expand Down
1 change: 1 addition & 0 deletions front/tests/pages/home-page-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class HomePage extends CommonPage {
// Click on the logo to navigate back to the home page
async backToHomePage() {
await this.backHomeLogo.click();
await this.page.waitForLoadState();
}

async goToOperationalStudiesPage() {
Expand Down
5 changes: 5 additions & 0 deletions front/tests/pages/stdcm-page-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ class STDCMPage extends HomePage {
// Fill and verify origin CI suggestions
await this.dynamicOriginCi.fill(input);
await this.verifyOriginNorthSuggestions();
await expect(this.suggestionNWS).toBeVisible();
await this.suggestionNWS.click();
const originCiValue = await this.dynamicOriginCi.getAttribute('value');
expect(originCiValue).toContain(suggestion);
Expand Down Expand Up @@ -529,6 +530,7 @@ class STDCMPage extends HomePage {
// Fill destination input and verify suggestions
await this.dynamicDestinationCi.fill(input);
await this.verifyDestinationSouthSuggestions();
await expect(this.suggestionSS).toBeVisible();
await this.suggestionSS.click();
const destinationCiValue = await this.dynamicDestinationCi.getAttribute('value');
expect(destinationCiValue).toContain(suggestion);
Expand Down Expand Up @@ -569,6 +571,7 @@ class STDCMPage extends HomePage {
const { input, chValue, arrivalDate, arrivalTime, tolerance, arrivalType } =
LIGHT_ORIGIN_DETAILS;
await this.dynamicOriginCi.fill(input);
await expect(this.suggestionNWS).toBeVisible();
await this.suggestionNWS.click();
if (isPrecise && arrivalTypeOverride) {
await this.originArrival.selectOption(arrivalTypeOverride);
Expand All @@ -585,6 +588,7 @@ class STDCMPage extends HomePage {
async fillDestinationDetailsLight() {
const { input, chValue, arrivalType } = LIGHT_DESTINATION_DETAILS;
await this.dynamicDestinationCi.fill(input);
await expect(this.suggestionSS).toBeVisible();
await this.suggestionSS.click();
await expect(this.dynamicDestinationCh).toHaveValue(chValue);
await expect(this.destinationArrival).toHaveValue(arrivalType);
Expand Down Expand Up @@ -622,6 +626,7 @@ class STDCMPage extends HomePage {
expect(await this.addViaButton.count()).toBe(viaNumber + 1);
await expect(this.getViaCI(viaNumber)).toBeVisible();
await this.getViaCI(viaNumber).fill(ciSearchText);
await expect(selectedSuggestion).toBeVisible();
await selectedSuggestion.click();
await expect(this.getViaCH(viaNumber)).toHaveValue(DEFAULT_DETAILS.chValue);
await expect(this.getViaType(viaNumber)).toHaveValue(PASSAGE_TIME);
Expand Down

0 comments on commit d8d5afc

Please sign in to comment.