Closed
Description
Current behavior:
According to the documentation, one of the cy.rightclick
call signature should be rightclick(position, options?)
but when attempting to use this version of the call, TypeScript returns an error:
Looking at the index.d.ts
file, it seems rightclick's definition only has one signature, the one with the options object:
/**
* Right-click a DOM element.
*
* @see https://on.cypress.io/rightclick
*/
rightclick(options?: Partial<ClickOptions>): Chainable<Subject>
The click method has two additional call signatures, so calling cy.click('topLeft')
will work as expected:
click(options?: Partial<ClickOptions>): Chainable<Subject>
click(position: string, options?: Partial<ClickOptions>): Chainable<Subject>
click(x: number, y: number, options?: Partial<ClickOptions>): Chainable<Subject>
Desired behavior:
All three call types should be present in the index.d.ts file for rightclick so that this call is valid from TypeScript:
cy.get('.element').rightclick('topLeft');
I made a PR adding the missing call signatures.
Versions
Cypress 3.6.0
macOS Catalina
Chrome 78
Metadata
Metadata
Assignees
Labels
No labels
Activity
ADDED: missing call signatures for right/dblclick
Fix types for cy.dblclick and cy.rightclick (#5618)
cypress-bot commentedon Nov 7, 2019
The code for this is done in cypress-io/cypress#5618, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
cypress-bot commentedon Nov 8, 2019
Released in
3.6.1
.