Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix types for cy.dblclick and cy.rightclick #5618

Merged
merged 4 commits into from
Nov 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion cli/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,13 +620,60 @@ declare namespace Cypress {
* @see https://on.cypress.io/dblclick
*/
dblclick(options?: Partial<ClickOptions>): Chainable<Subject>

/**
* Double-click a DOM element at specific corner / side.
*
* @param {String} position - The position where the click should be issued.
* The `center` position is the default position.
* @see https://on.cypress.io/dblclick
* @example
* cy.get('button').dblclick('topRight')
*/
dblclick(position: string, options?: Partial<ClickOptions>): Chainable<Subject>
/**
* Double-click a DOM element at specific coordinates
*
* @param {number} x The distance in pixels from the element’s left to issue the click.
* @param {number} y The distance in pixels from the element’s top to issue the click.
* @see https://on.cypress.io/dblclick
* @example
```
// The click below will be issued inside of the element
// (15px from the left and 40px from the top).
cy.get('button').dblclick(15, 40)
```
*/
dblclick(x: number, y: number, options?: Partial<ClickOptions>): Chainable<Subject>
/**
* Right-click a DOM element.
*
* @see https://on.cypress.io/rightclick
*/
rightclick(options?: Partial<ClickOptions>): Chainable<Subject>
/**
* Right-click a DOM element at specific corner / side.
*
* @param {String} position - The position where the click should be issued.
* The `center` position is the default position.
* @see https://on.cypress.io/click
* @example
* cy.get('button').rightclick('topRight')
*/
rightclick(position: string, options?: Partial<ClickOptions>): Chainable<Subject>
/**
* Right-click a DOM element at specific coordinates
*
* @param {number} x The distance in pixels from the element’s left to issue the click.
* @param {number} y The distance in pixels from the element’s top to issue the click.
* @see https://on.cypress.io/rightclick
* @example
```
// The click below will be issued inside of the element
// (15px from the left and 40px from the top).
cy.get('button').rightclick(15, 40)
```
*/
rightclick(x: number, y: number, options?: Partial<ClickOptions>): Chainable<Subject>

/**
* Set a debugger and log what the previous command yields.
Expand Down