Skip to content

Commit 9a0b030

Browse files
committed
Improve station logbook test reliability
Added a check for the page header and increased timeout for table existence to ensure the test waits for the page to fully load before verifying the station logbook entry.
1 parent 83a2895 commit 9a0b030

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cypress/e2e/5-station-logbook.cy.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ describe("Create station logbook", () => {
3939
// Check if the station location was created successfully
4040
cy.url().should("include", "/logbooks");
4141

42-
// // Check if the station location is present in the table
43-
cy.get("#station_logbooks_table")
42+
// Wait for the page to fully load after redirect
43+
cy.get('h2').should('contain', 'Station Logbooks');
44+
45+
// Check if the station location is present in the table
46+
cy.get("#station_logbooks_table", { timeout: 10000 })
47+
.should("exist")
4448
.contains(stationLogbookName)
4549
.should("exist");
4650
});

0 commit comments

Comments
 (0)