outline | ||
---|---|---|
|
Documenté comes with pre-defined actions and assertions that cover most of the common use cases.
Triggers a navigation to the given URL.
visit {{url}}
When I visit "https://example.com"
then title should have text "Example Domain"
Triggers a click
event on the given element.
click <selector>
click on <selector>
When I click confirm button
When I click on confirm button
Triggers a dblclick
event on the given element.
double click <selector>
double click on <selector>
double-click <selector>
double-click on <selector>
doubleclick <selector>
doubleclick on <selector>
When I double click confirm button
When I double click on confirm button
When I double-click confirm button
When I double-click on confirm button
When I doubleclick confirm button
When I doubleclick on confirm button
Triggers a contextmenu
event on the given element.
right click <selector>
right click on <selector>
right-click <selector>
right-click on <selector>
rightclick <selector>
rightclick on <selector>
When I right click confirm button
When I right click on confirm button
When I right-click confirm button
When I right-click on confirm button
When I rightclick confirm button
When I rightclick on confirm button
Triggers mouseenter
and mouseover
events on the given element.
hover <selector>
hover on <selector>
When I hover confirm button
When I hover on confirm button
Types the given text into the given element.
The target element must accept text input, e.g. <input>
, <textarea>
or [contenteditable]
.
type <text> on <selector>
type <text> into <selector>
type <text> in <selector>
When I type "Hello World" on input field
When I type "Hello World" into input field
When I type "Hello World" in input field
Clears the given element.
The target element must accept text input, e.g. <input>
, <textarea>
or [contenteditable]
.
clear <selector>
When I clear input field
Checks the given checkbox.
check <selector>
When I check "I agree" checkbox
Unchecks the given checkbox.
uncheck <selector>
When I uncheck "I agree" checkbox
Selects the given option from the given select element.
select <option> in <selector>
select <option> from <selector>
When I select "Option 1" in select field
When I select "Option 1" from select field
Scrolls the given element into view.
scroll to <selector>
scroll <selector> into view
When I scroll to confirm button
When I scroll confirm button into view
Navigates back in history.
go back
When I go back
Navigates forward in history.
go forward
When I go forward
Asserts that the given element exists.
exist
Then confirm button should exist
Asserts that the given element does not exist.
not exist
Then confirm button should not exist
Asserts that the given selector has a given number of occurrences.
For example, if the selector matches 3 elements, then the following assertion is valid:
it should have 3 occurrences
have <number> occurrences
have <number> occurrence
have <number> occurrence(s)
Then confirm button should have 1 occurrence
Then confirm button should have 2 occurrences
Then confirm button should have 3 occurrence(s)
Asserts that the given element is visible.
be visible
Then confirm button should be visible
be hidden
Asserts that the given element is hidden.
be hidden
Then confirm button should be hidden
Asserts that the given element has the given text.
have text <text>
Then title should have text "Example Domain"
Asserts that the given element contains the given text.
contain text <text>
Then title should contain text "Example"
Asserts that the given element has the given value.
The target element should have a value
attribute, e.g. <input>
or <textarea>
.
have value <value>
Then input field should have value "Hello World"
Asserts that the given element has the given CSS class.
have class <class>
Then confirm button should have class "btn"
Asserts that the given checkbox is checked.
be checked
Then "I agree" checkbox should be checked
Asserts that the given checkbox is unchecked.
be unchecked
Then "I agree" checkbox should be unchecked
Asserts that the given element is enabled.
The target element could be an <input>
, <textarea>
or <button>
.
be enabled
Then confirm button should be enabled
Asserts that the given element is disabled.
The target element could be an <input>
, <textarea>
or <button>
.
be disabled
Then confirm button should be disabled