Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 965 Bytes

no-force-true.md

File metadata and controls

37 lines (22 loc) · 965 Bytes

disallow using of 'force: true' option (no-force-true)

Using force:true on inputs appears to be confusing rather than helpful. It usually silences the actual problem instead of providing a way to overcome it. See Cypress Core Concepts.

Rule Details

This rule aims to disallow using of the force option on .click(), .dblclick() and .type().

Examples of incorrect code for this rule:

cy.get('button').click({force: true})
cy.get('button').dblclick({force: true})
cy.get('input').type('somth', {force: true})

Examples of correct code for this rule:

cy.get('button').click()
cy.get('button').click({multiple: true})
cy.get('button').dblclick()
cy.get('input').type('somth')

When Not To Use It

If you really need to use.