Skip to content

throw error when attempting to .select() an option that doesn't exist or is disabled. #91

@jennifer-shehane

Description

@jennifer-shehane

Description
When using the .select() command, you can pass in a value or text that doesn't exist in the select's options. The command log performs normally as if the option was selected, although it was not.

Code

<select>
  <option value="foo">Foo</option>
</select>
cy.get("select").select("baz")

No error will be thrown with the above code.

Additional Info
It is additionally possible to set <option> as disabled. The .select() command should thrown an error if attempting to select a disabled option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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