Skip to content

Type-Command needs force-option on Inputs in ShadowDOM #7741

@suffle

Description

@suffle

Current behavior:

Calling type on an inout in the ShadowDOM throws an error and seems to be called on the wrong element:

cy.type() failed because it requires a valid typeable element.

The element typed into was:

  > <webcomponent-lightdom></webcomponent-lightdom>

Desired behavior:

type-command should work on inputs in ShadowDOM just as it does on inputs in LightDOM

Test code to reproduce

DOM:

<webcomponent-lightdom>
  #shadow-root
    <webcomponent-with-input>
      #shadow-root
        <input type="text" />
    <webcomponent-with-input>
</webcomponent-lightdom>

Test:

// Finds element but fails on type
cy.get('webcomponent-lightdom').get('input', { includeShadowDom: true }).type('test');

// Works, if you don't have to wait for actionability
cy.get('webcomponent-lightdom').get('input', { includeShadowDom: true }).type('test', {force: true});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions