Files
cypress/docs/source/api/commands/dblclick.md
T
2017-06-26 01:05:20 -04:00

1.9 KiB

title, comments
title comments
dblclick false

Double-click a DOM element.

Syntax

.dblclick()
.dblclick(options)

Usage

.dblclick() requires being chained off another cy command that yields a DOM element.

{% fa fa-check-circle green %} Valid Usage

cy.get('button').dblclick()          // Double click on button
cy.focused().dblclick()              // Double click on el with focus
cy.contains('Welcome').dblclick()    // Double click on first el containing 'Welcome'

{% fa fa-exclamation-triangle red %} Invalid Usage

cy.click('button')          // Errors, cannot be chained off 'cy'
cy.window().click()         // Errors, 'window' does not yield DOM element

Arguments

{% fa fa-angle-right %} options (Object)

Pass in an options object to change the default behavior of .dblclick().

Option Default Description
log true {% usage_options log %}
timeout {% url defaultCommandTimeout configuration#Timeouts %} {% usage_options timeout .dblclick %}

Yields {% helper_icon yields %}

{% yields same_subject .dblclick %}

Requirements {% helper_icon defaultAssertion %}

{% requirements actionability .dblclick %}

Timeouts {% helper_icon timeout %}

{% timeouts actionability .dblclick %}

Examples

Double Click

Double click an anchor link

cy.get('a#nav1').dblclick() // yields the <a>

Command Log

Double click on a calendar schedule

cy.get('[data-schedule-id="4529114"]:first').dblclick()

The commands above will display in the command log as:

Command Log dblclick

When clicking on dblclick within the command log, the console outputs the following:

console.log dblclick

See also

  • {% url .click() click %}