2.3.3
Check if a modal was opened
(("an alertbox"
| "a confirmbox"
| "a prompt"
))
The type of modal that is expected
(boolean)
Check for opposite state
void
Check the text of a modal
"an alertbox"
| "a confirmbox"
| "a prompt"
), reverse: boolean, expectedText: string): void(("an alertbox"
| "a confirmbox"
| "a prompt"
))
The type of modal that is expected
(boolean)
Check for opposite state
(string)
The text to check against
void
Handle an alertbox/confirmbox/prompt
"accept"
| "dismiss"
), type: ("alertbox"
| "confirmbox"
| "prompt"
)): void(("accept"
| "dismiss"
))
Action to perform
(("alertbox"
| "confirmbox"
| "prompt"
))
Type of modal
void
Enter text into the current prompt
(string)
The text to enter into the prompt
void
Delete a cookie
(string)
The name of the cookie to delete
void
Check if a cookie with the given name exists
void
Check the content of a cookie against a given value
(string)
The name of the cookie
(boolean)
Check for opposite state
(string)
The value to check against
void
Set a given cookie to a given value. When the cookies does not exist it will be created
void
Define a typed step
(IDefineStepOptions)
The options to use (optional)
(StepDefinitionCode?)
The function to execute
void
Pause execution for a given number of milliseconds
(number)
Number of milliseconds to pause
void
Wait for the given element to be checked, enabled, selected, displayed, match/contain a text, match a value or to exist
(ElementQuery)
Element getter
(boolean)
Check for opposite state
(State?
= exist
)
State to check for
(string?)
The value to check for (in case of "match/contain the text/value")
void
Wait for the url or path to contain or match the specified value
"url"
| "path"
), reverse: boolean, state: State, expectedValue: string): void(("url"
| "path"
))
The type to check (url or path)
(boolean)
Check for opposite state
(State)
State to check for (contain or match)
(string)
The value to check for
void
When called, returns a WebdriverIO.Element.
Type: any
Get an element query for the specified text
(string)
The text to get the selectors by. Separate nesting child selectors by " -> ".
ElementQuery
:
An ElementQuery for a single element
When called, returns an array of WebdriverIO.Element.
Type: any
Get an elements query for the specified text
(string)
The text to get the selectors by. Separate nesting child selectors by " -> ".
ElementsQuery
:
An ElementsQuery for multiple elements
Add a value to the current element value
(string)
The value to add to the element
(ElementQuery)
The element query
void
Clear the value of a given input field
(ElementQuery)
The element query
void
Perform a click action on the given element
(Action)
The action to perform
(ElementQuery)
The element query
void
Drag an element to a given destination
(ElementQuery)
The element query for the source element
(ElementQuery)
The element query for the destination element
void
Check if the given element has the given class
(ElementQuery)
The element query
(boolean)
Check for opposite state
(string)
The class name to check
void
Check if the given element is (not) displayed
(ElementQuery)
The element query
(boolean)
Check for opposite state
void
Check if the given element is empty
(("element"
| "button"
))
Element type
(ElementQuery)
The element query
(boolean)
Check for opposite state
void
Check if the given element is enabled
(ElementQuery)
The element query
(boolean)
Check for opposite state
void
Check if the given element exists in the DOM one or more times
(ElementsQuery)
The elements query
(boolean)
Check for opposite state
(number?)
Check if the element exists exactly this number of times
void
Check if the given element has the focus
(ElementQuery)
The element query
(boolean)
Check for opposite state
void
Check the offset of the given element
"x"
| "y"
)): void(ElementQuery)
The element query
(boolean)
Check for opposite state
(number)
The position to check against
(("x"
| "y"
))
The axis to check on
void
Check the given property of the given element
(boolean)
Whether to check for a CSS property or an attribute
(string)
The name of the attribute to check
(ElementQuery)
The element query
(boolean)
Check for opposite state
(string)
The value to match against
void
when getting something with a color or font-weight WebdriverIO returns a object but we want to assert against a string
Compare the contents of two elements with each other
(ElementQuery)
The element query for the first element
(boolean)
Check for opposite state
(ElementQuery)
The element query for the second element
void
Check the selected state of the given element
(ElementQuery)
The element query
(boolean)
Check for opposite state
void
Check the dimensions of the given element
"width"
| "height"
), element: ElementQuery, reverse: boolean, expectedSize: number): void(("width"
| "height"
))
Dimension to check
(ElementQuery)
The element query
(boolean)
Check for opposite state
(number)
Expected size
void
Check if the given elements text is the same as the given text
"element"
| "button"
), element: ElementQuery, reverse: boolean, expectedText: string): void(("element"
| "button"
))
Element type
(ElementQuery)
The element query
(boolean)
Check for opposite state
(string)
The text to validate against
void
Check if the given elements contains text
"element"
| "button"
), element: ElementQuery, reverse: boolean, expectedText: string): void(("element"
| "button"
))
Element type
(ElementQuery)
The element query
(boolean)
Check for opposite state
(string)
The text to check against
void
Check if the given element is displayed inside the current viewport
(ElementQuery)
The element query
(boolean)
Check for opposite state
void
Move to the given element with an optional offset on an X and Y position
(ElementQuery)
The element query
(number)
X coordinate to move to
(number)
Y coordinate to move to
void
Perform a key press
(string)
The key to press
void
Scroll the page to the given element
(ElementQuery)
The element query
void
Select an option of a select element
(Type)
Type of method to select by
(string)
Value to select by
(ElementQuery)
The element query
void
Select an option from a select element by it's index
(number)
The index of the option
(ElementQuery)
The element query
void
Set the value of the given input field to a new value
(ElementQuery)
The element query
(string)
The value to set the element to
void
When an exception has been thrown, this will ensure its message will be changed.
(function (): void)
A callback that might throw an exception
(string)
The message that should be set on the error object.
void
Turn the first character of the supplied string to upper-case.
(string)
The text to change
string
Remove the first word of the supplied string (including whitespace).
(string)
The text to change
string
Get the last element of a list
(Array<T>)
The list to use
T
Get the current url or path (if type !== 'url')
(("url"
| "path"
))
The type
string
Get the text of an element
(any)
The element
any
:
The element text depending on the specified text method.
Get the text or value of an element or button
(("element"
| "button"
))
Element type
(WebdriverIO.Element)
The element
string
:
The element value if type is not 'button', but the tagname is input, select or textarea. Otherwise the element text.
Conversion function for input values from .feature files
Conversion function for input values from .feature files, with possibility to use optional.
Extends ParamType
Conversion function for input values from .feature files, with possibility to use optional.
Extends ParamTypeWithOptional
The parameter is expected to be a string. If it matches trueValue
, true is returned, otherwise false.
(string)
ParamTypeWithOptional
The parameter is expected to be a string. If it matches falseValue
, false is returned, otherwise true.
(string)
ParamTypeWithOptional
Conversion function for input values from .feature files, with possibility to use optional.
Extends ParamTypeWithOptional
The parameter is expected to be a string. pattern
must contain '{{VALUE}}', which will be replaced by the parameter.
(string)
ParamTypeWithOptional
Helper to add an 'optional' method to the function to make a parameter optional.
(ParamType)
The function to add the 'optional' attribute to.
ParamTypeWithOptional
Built-in ParamTypes. Use .optional() instead if it is optional.
The parameter is expected to be a string
. No conversion done.
The parameter is expected to be an integer
. parseInt()
is applied.
The parameter is expected to be a float
. parseFloat()
is applied.
The parameter is expected to be a boolean
value. !!
is applied.
The parameter is expected to be a selector key. getSelector()
is applied.
The parameter is expected to be a selector key. elementQuery()
is applied.
The parameter is expected to be a selector key. elementsQuery()
is applied.
Close all tabs but the first one.
void
Close the last opened window
void
Check if a new window or tab is opened
(boolean?)
Check for opposite state
void
Check if the given URL or path was opened in a new window
(("url"
| "path"
))
The type to check
(string)
The expected value to match against
void
Check the title of the current browser window
void
Check the title of the current browser window contains expected text/title
void
Check if the current URL or path matches the given value
(("url"
| "path"
))
The type to check
(boolean)
Check for opposite state
(string)
The expected value to match against
void
Check if the given string is in the URL path
(("url"
| "path"
))
The type to check
(boolean)
Check for opposite state
(string)
The string to check for
void
Focus the last opened window
void
Open the given URL
(("url"
| "path"
))
Type of navigation
(string)
The URL or path to navigate to
void
Resize the browser window
(number)
The width of the window to resize to
(number)
The height of the window to resize to
void