Increase Cypress timeouts and add waitForSelectOptions command

Raised default and request timeouts to 60 seconds in Cypress config to improve test reliability. Added a custom 'waitForSelectOptions' command to ensure select elements are populated before interacting, and updated station location test to use this command.
这个提交包含在:
Peter Goodhall 2025-07-17 17:03:41 +01:00
父节点 23f1017433
当前提交 ca5df78114
共有 3 个文件被更改,包括 12 次插入0 次删除

查看文件

@ -4,6 +4,8 @@ module.exports = defineConfig({
projectId: 'gm8wco',
e2e: {
baseUrl: "http://localhost/",
defaultCommandTimeout: 60000, // Increase default timeout to 60 seconds
requestTimeout: 60000, // Increase request timeout to 60 seconds
setupNodeEvents(on, config) {
// implement node event listeners here
},

查看文件

@ -41,7 +41,11 @@ describe("Create station location", () => {
cy.get('input[name="station_profile_name"]').type(stationLocationName);
cy.get('input[name="station_callsign"]').type(stationCallsign);
cy.get('input[name="station_power"]').type(stationPower);
// Wait for the DXCC select to be populated with options before trying to select
cy.waitForSelectOptions('select[name="dxcc"]');
cy.get('select[name="dxcc"]').select(stationDXCC);
cy.get('input[name="city"]').type(stationCity);
cy.get('select[name="station_state"]').select(stationState);
cy.get("#stationCntyInput-selectized")

查看文件

@ -6,3 +6,9 @@ Cypress.Commands.add("login", () => {
cy.get('input[name="user_password"]').type(password);
cy.get('button[type="submit"]').click();
});
// Custom command to wait for select elements to be populated
Cypress.Commands.add("waitForSelectOptions", (selector, minOptions = 1) => {
cy.get(selector).should('be.visible');
cy.get(`${selector} option`).should('have.length.greaterThan', minOptions);
});