title |
---|
dblclick |
Double-click a DOM element.
.dblclick()
.dblclick(options)
{% fa fa-check-circle green %} Correct 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 %} Incorrect Usage
cy.dblclick('button') // Errors, cannot be chained off 'cy'
cy.window().dblclick() // Errors, 'window' does not yield DOM element
{% 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 same_subject .dblclick %}
cy.get('a#nav1').dblclick() // yields the <a>
.dblclick()
is an "action command" that follows all the rules {% url 'defined here' interacting-with-elements %}.
{% requirements dom .dblclick %}
{% assertions actions .dblclick %}
{% timeouts actions .dblclick %}
Double click on a calendar schedule
cy.get('[data-schedule-id="4529114"]:first').dblclick()
The commands above will display in the Command Log as:
{% imgTag /img/api/dblclick/double-click-in-testing.png "Command Log dblclick" %}
When clicking on dblclick
within the command log, the console outputs the following:
{% imgTag /img/api/dblclick/element-double-clicked-on.png "console.log dblclick" %}
- {% url
.click()
click %}