Overview

We need this for accessibility, but it also provides a way to add components in e2e tests without needing to replicate drag and drop, something that is prone to intermittent fails.

Proposed resolution

  • Provide a way to add components to an empty layout without drag and drop
  • Refactor e2e tests that use drag and drop for this to use the new interaction. If those tests are skipped, they should be unskipped as part of this MR

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

bnjmnm created an issue. See original summary.

bnjmnm’s picture

Assigned: bnjmnm » Unassigned
Status: Active » Needs review

This brings back every skip added in #3500549: Temporarily skip intermittently failing e2e tests, and I've rerun the Cypress tests many times and they pass every time.

  • components-operations, empty-canvas and publish-button now add a component to the empty layout by clicking the component instead of dragging it. (turns out the UI already does this! Just no affordance to make it evident)
  • global-regions was unskipped but no changes as the drag and drop operation is never in the canvas area. Seems to be passing
  • The skip added in components-slots earlier today was removed, but only because a skip is already present on the higher level describe() that was added last month. The scope of this issue is only to remove skips added in #3500549

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

  • wim leers committed 4a89dc71 on 0.x authored by bnjmnm
    Issue #3500542 by bnjmnm, larowlan: Implement adding component to empty...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

🥳 for more reliable tests! (And running the entire test suite again.)

wim leers’s picture

wim leers’s picture

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');

Status: Fixed » Closed (fixed)

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

wim leers’s picture