Skip to content

Cypress is confusing cy.clear() with cy.click() #26152

Open
@thekayshawn

Description

@thekayshawn

Current behavior

I've selected a few input fields and told cypress to clear all of them using the multiple: true flag but cypress fails to clear them while saying cy.click() can only be called on a single element. Your subject contained 34 elements. Pass { multiple: true }.

image

Desired behavior

In this situation, cypress should display the correct error and mention the method that's actually used - the cy.clear() method, instead, it's mentioning cy.click() and asking me to pass the multiple: true flag, which is already there.

Test code to reproduce

It's a simple form with about 32 fields, here's the failing code:

cy.get('input:not([type="file"]), textarea').clear({
  force: true,
  multiple: true,
});

Cypress Version

12.8.1

Node version

16.19.0

Operating System

Elementary OS 7

Debug Logs

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    pkg/driverThis is due to an issue in the packages/driver directorytype: enhancementRequested enhancement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions