Overview

Unable to find an element with the text: The Entire Node 1. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible

Proposed resolution

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

larowlan created an issue. See original summary.

larowlan’s picture

Status: Active » Needs review
wim leers’s picture

Assigned: Unassigned » jessebaker
Issue tags: +e2e, +DX (Developer Experience)

Needs Cypress expertise to review, due to the introduction of waits and an intercept, which I thought we eliminated? 🤔

bnjmnm’s picture

I believe this is similar to my comment in #3500136: Random failure in empty-canvas.cy.js where there are waits being added for endpoints to address the issue, but the problem occurs slightly earlier so those endpoints are not being requested at all.

larowlan’s picture

larowlan’s picture

@bnjmnm I think the first wait is valid here, because the newly added component doesn't yet show in the sections library.
The second one is the same as your comment on #3500136: Random failure in empty-canvas.cy.js I agree. Either way, it's costing us velocity

larowlan’s picture

bnjmnm’s picture

This seems to be reliably passing with the changes I made in #3500542: Implement adding component to empty layout without dnd. It's difficult to be 100% sure since it is intermittent but I re-ran the tests many times and it's green every time

wim leers’s picture

#3500542: Implement adding component to empty layout without dnd has been merged.

But … #9: I found a remaining random failure, that is not related to drag-and-drop:

FYI: when this was merged, component-operations.cy.js failed during the 0.x test run 🙈 But it failed ~20 LoC earlier than the change here.

Failure:

      cy:command ✔  click	
        cy:fetch ➟  GET http://localhost/web/xb/api/config/pattern
                    Status: 200
      cy:command ✔  get	.primaryPanelContent
      cy:command ✔  within	
      cy:command ✔  findByText	Sections
      cy:command ✔  click	{force: true, scrollbehavior: false}
      cy:command ✘  findByText	The Entire Node 1
      cy:command ✘  assert	expected **findByText(`The Entire Node 1`)** to exist in the DOM
                    Actual: 	"findByText(`The Entire Node 1`)"
                    Expected: 	"findByText(`The Entire Node 1`)"

Relevant test code:

    cy.openLibraryPanel();
    cy.get('.primaryPanelContent').within(() => {
      cy.findByText('Sections').click(clickDefault);
      cy.findByText('The Entire Node 1').should('exist');
    });
    cy.get('.primaryPanelContent')
      .as('panel')
      .should('contain.text', 'The Entire Node 1');

#3500542-9: Implement adding component to empty layout without dnd

bnjmnm’s picture

StatusFileSize
new198.93 KB

component-operations had two different random fail areas, one of which was recently addressed in #3500542: Implement adding component to empty layout without dnd. The other, which happens to be the screenshot in the issue summary, has something pretty specific going on.

It fails when looking for a section called "The Entire Node 1". In the issue summary, that section is instead namede "Node 1"

In a separate instance of this failing, the section is named "e Node 1"

This is the code where it happens - the input is receptive enough to receive the clear() as there are no artifacts of the default section name "Two Column section", but it looks like the fails occur when some of the initial typing used to name the section fails to register.

   cy.findByLabelText('Section name').clear();
    cy.findByLabelText('Section name').type('The Entire Node 1');
    cy.findByText('Add to Library').click({ scrollBehavior: false });

It is a pretty specific way to fail so hopefully that means a fix is reasonably easy to achieve too.

bnjmnm’s picture

Assigned: jessebaker » Unassigned

Fortunately I was able to reproduce the flaky test locally by slowing things down a bit (throttling or enabling Xdebug worked). The 3500128-retry-typing-until-it-works branch has the solution, and I've re-run it several times. It being intermittent makes it hard to be 100% certain, but this fixing it on a local where it happened reliably

hooroomoo’s picture

  • hooroomoo committed 6568bce0 on 0.x authored by bnjmnm
    Issue #3500128 by bnjmnm: Random failure in component-operations.cy.js
    
hooroomoo’s picture

Status: Needs review » Fixed
hooroomoo’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.