Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tests/cypress/e2e/Entries/deleteEntries.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking — PR description is stale against this code. The PR body's "What changed" says: "Gave the one racing assertion in each spec { timeout: 10000 } rather than reaching for { force: true }" and diagnoses the root cause as a mount-race/0-height timing issue. That described the first commit's fix here (65c4185: a { timeout: 10000 } bump on the first selector). This second commit (602cfce, "Fix root cause... not just symptoms") replaced that with scrollIntoView() and this comment explicitly says the opposite — "not a render-timing race (a longer timeout never resolves it)". The description was never updated to match, so it now misdescribes the actual root cause and fix for this file (it's still accurate for searchFunctionality.cy.js). Worth a quick edit so anyone debugging a future flake here isn't pointed at the wrong theory.

// 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();
Expand Down
12 changes: 7 additions & 5 deletions tests/cypress/e2e/Forms/searchFunctionality.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading