diff --git a/tests/cypress/e2e/Entries/deleteEntries.cy.js b/tests/cypress/e2e/Entries/deleteEntries.cy.js index c3de7144a1..bf61f7150c 100644 --- a/tests/cypress/e2e/Entries/deleteEntries.cy.js +++ b/tests/cypress/e2e/Entries/deleteEntries.cy.js @@ -14,12 +14,16 @@ describe( 'Entries submitted from a form', () => { cy.get( '#frm-save-form-name-button' ).should( 'contain', 'Save' ).click(); cy.log( `Add some fields` ); - // Plain, always-visible sidebar links - no hover gating involved. - cy.get( 'li[id="text"] a[title="Text"]' ).should( 'be.visible' ).click(); - cy.get( 'li[id="name"] a[title="Name"]' ).should( 'be.visible' ).click(); - cy.get( 'li[id="checkbox"] a[title="Checkboxes"]' ).should( 'be.visible' ).click(); - cy.get( 'li[id="email"] a[title="Email"]' ).should( 'be.visible' ).click(); - cy.get( 'li[id="phone"] a[title="Phone"]' ).should( 'be.visible' ).click(); + // Plain, always-visible sidebar links - no hover gating involved. Adding a field can leave + // the scrollable field-type panel (.frm-right-panel) scrolled to wherever the previous click + // left it, so a later link in the list can sit outside its own panel's visible scroll area - + // not a render-timing race (a longer timeout never resolves it), so scroll each one into view + // within its own panel before asserting visible. + cy.get( 'li[id="text"] a[title="Text"]' ).scrollIntoView().should( 'be.visible' ).click(); + cy.get( 'li[id="name"] a[title="Name"]' ).scrollIntoView().should( 'be.visible' ).click(); + cy.get( 'li[id="checkbox"] a[title="Checkboxes"]' ).scrollIntoView().should( 'be.visible' ).click(); + cy.get( 'li[id="email"] a[title="Email"]' ).scrollIntoView().should( 'be.visible' ).click(); + cy.get( 'li[id="phone"] a[title="Phone"]' ).scrollIntoView().should( 'be.visible' ).click(); cy.log( 'Update form' ); cy.get( '#frm_submit_side_top' ).should( 'contain', 'Update' ).click(); diff --git a/tests/cypress/e2e/Forms/searchFunctionality.cy.js b/tests/cypress/e2e/Forms/searchFunctionality.cy.js index 7513415129..284b5f9e1c 100644 --- a/tests/cypress/e2e/Forms/searchFunctionality.cy.js +++ b/tests/cypress/e2e/Forms/searchFunctionality.cy.js @@ -9,22 +9,24 @@ describe( 'Search functionality', () => { cy.createNewForm(); cy.log( 'Search the newly created form by using enter' ); - cy.get( '#entry-search-input' ).type( 'Test Form {enter}' ); - cy.get( '.current > .count' ).should( 'contain', '1' ); + // A search submits a real page navigation, not an AJAX update - the reload can still be + // settling past the default 4s command timeout when the result count is checked right after. + cy.get( '#entry-search-input' ).type( 'Test Form {enter}', { timeout: 10000 } ); + cy.get( '.current > .count', { timeout: 10000 } ).should( 'contain', '1' ); cy.log( 'Search the newly created form by using the submit button' ); cy.get( '#entry-search-input' ).type( 'Test Form' ).clear(); cy.get( '#entry-search-input' ).type( 'Test Form' ); cy.get( '#search-submit' ).click(); - cy.get( '.published > .current' ).should( 'exist' ); - cy.get( '.current > .count' ).should( 'contain', '1' ); + cy.get( '.published > .current', { timeout: 10000 } ).should( 'exist' ); + cy.get( '.current > .count', { timeout: 10000 } ).should( 'contain', '1' ); cy.get( '.displaying-num' ).should( 'contain', '1' ); cy.contains( '#the-list tr', 'Test Form' ).should( 'exist' ); cy.log( 'Search for an invalid form title' ); cy.get( '#entry-search-input' ).clear().type( 'Invalid Test Form {enter}' ); - cy.get( '.current > .count' ).should( 'contain', '0' ); + cy.get( '.current > .count', { timeout: 10000 } ).should( 'contain', '0' ); cy.get( '#entry-search-input' ).clear(); cy.get( '#search-submit' ).click();