Skip to content

Retry cy.focused() command #409

@jennifer-shehane

Description

@jennifer-shehane

I have this test in cypress that’s supposed to check that a certain element is focused.

Example Test
cy.focused().should('have.value', 'foobar')

But it’s really brittle since I'm testing it on a modal that may or may not have fully animated into the screen.

We need to have the cy.focused() command retry the assertion until it passes or times out at the duration of it's command timeout. Currently, it checks against the assertion once then passes or fails.

Metadata

Metadata

Assignees

Labels

pkg/driverThis is due to an issue in the packages/driver directory

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