async function
async param or param
Returns floored numeric properties in object
Object that contain only numeric props
Returns bottom border of bounding box
Returns element bounding box. If box is null - throws exception.
Returns center point of bounding box
Returns visible part of bounding box relative to viewport or null
Returns frame bounding box. Uses frame.name() as frame id first or frame.name() as name. Useful for case, when you have instance of frame, but you don't know it's selector. If frame does not exist - throws an exception.
Returns offsets from center to bounding box borders
Returns point that is divided in n times from bounding box bottom right border
Returns right border of bounding box
Returns bounding box of two elements, where left top border is their coordinates minimum and right bottom border is their coordinates maximum. Is useful in cases like selection of several elements and checking which area is selected.
2+ bounding boxes
Returns left border coordinates of bounding box
Returns top border coordinates of bounding box
Checks if bounding box is placed in center of another bounding box with delta 1 px
Checks that offsets from one bounding box to another is equal expected
Checks if one bounding box is placed inside another and not gone over the borders
Waits for bounding box to be placed inside another and not go beyond the borders.
Async function that returns bounding box that should be placed inside parent
Parent bounding box
WaitOptions
Creates promise chain. Returns void.
Executes function for every promise in collection. Awaits for each Promise in array. Guarantees order. Useful when you have collection of Promises, and after they would be resolved after some action, order should be the same.
Filters async filter elements from collection. Guarantees order.
Finds first element in collection by async filter.
Maps collection by async mapper. Guarantees order.
Returns element from array that contain defined text. Can be also user in ignore case mode.
Page or Frame
Elements array or selector
Text
Ignore case option (default - false)
Returns element from array by text exact match. Can be also user in ignore case mode.
Page or Frame
Elements array or selector
Text
Ignore case option (default - false)
Returns index of element that contain defined text. Can be also user in ignore case mode.
Page or Frame
Elements array or selector
Text
Ignore case option (default - false)
Returns element index that has exact property value
Page or Frame
Elements array or selector
ElementPropertyType or string
Property value
Returns index of element by text exact match. Can be also user in ignore case mode.
Page or Frame
Elements array or selector
Text
Ignore case option (default - false)
Returns text of all elements from array. Guarantees order.
Page or Frame
Elements array or selector
Returns copied text from clipboard. Needs clipboard permissions to the page. (for more details https://github.com/chromium/chromium/commit/f66617497ff714042afe98ce19a7cb611e08c07d)
Page or Frame
Drags element from point to point with offset by defined coordinates.
Page or Frame
Coordinates of the drag object
Left offset
Top offset
DragOptions
Drags element from it's center to point with offsets from center. Guarantees that element position would be stable (do not jump) after drag.
Page or Frame
Selector or element
Left offset
Top offset
DragOptions
Drags element to the center of another element. Guarantees that element position would be stable (do not jump) after drag.
Page or Frame
Element that should be dragged
Target element
Drag options
Drag element to coordinates. Start drag point is element center. Guarantees that element position would be stable (do not jump) after drag.
Page or Frame
Element that should be dragged
Target coordinates
DragOptions
Executes drag from point to point. Doesn't guarantee that drag entity location would be stable after drag.
Page or Frame
Point from where drag is executed
Target point
DragOptions
Drag from point to point. Generic function that drag utils are using. Strongly recommended not use it directly, but to use its wrappers. Drags element first by horizontally X, then vertically by Y.
Page or Frame
Point from which drag is executed
Target point
if enabled - drag will be executed pixel by pixel number of times which equal drag distance if steps are not defined. If steps are defined - dragDistance / steps. If not enabled - would be dragged in 1 step per axis.
Amount of steps by which drag would be executed
Opens dropdown and returns dropdown option by selector. If option does not exist, throws an exception.
Page or Frame
Dropdown open element or it's selector
Target option selector
Opens dropdown and gets dropdown option by text exact match.
Page or Frame
Open dropdown element or it's selector
Dropdown Options selector
Target text
Opens dropdown and gets dropdown option by value element property.
Page or Frame
Open dropdown element or it's selector
Dropdown Options selector
Value of 'value' property
Opens dropdown and gets all options text. Order is guaranteed.
Page or Frame
Open dropdown element or it's selector
Dropdown Options selector
Opens dropdown and gets dropdown options` attribute value. Order is guaranteed.
Page or Frame
Open dropdown element or it's selector
Dropdown Options selector
Target attribute name
Opens dropdown and verifies that dropdown option with property value exists and not disabled.
Page or Frame
Open dropdown element or it's selector
Dropdown Options selector
Value of 'value' property
Opens dropdown and verifies that dropdown option with property value exists.
Page or Frame
Open dropdown element or it's selector
Dropdown Options selector
Value of 'value' property
Opens dropdown and returns array of dropdown option elements.
Page or Frame
Open dropdown element or it's selector
Dropdown Options selector
Opens dropdown (if needed) and select option by containing text.
Page or Frame
Open dropdown element or it's selector or null. If null - doesn't click on open dropdown element.
Dropdown Options selector
Target text
Opens dropdown and select option by containing value of property 'value'.
Page or Frame
Open dropdown element, or it's selector
Dropdown Options selector
Value of property 'value'
Opens dropdown and selects dropdown option by index.
Page or Frame
Open dropdown element, or it's selector.
Dropdown Options selector
Target index
Opens dropdown and selects dropdown option by selector. Waits optionally for option to not exist or to not to be in viewport.
Page or Frame
Open dropdown element, or it's selector.
Dropdown Options selector
Default - wait for option not to be in viewport. Also can wait for option not to exist.
Opens dropdown and select option by text exact match.
Page or Frame
Open dropdown element or it's selector.
Dropdown Options selector
Target text
Opens dropdown and select option by value exact match of property 'value'.
Page or Frame
Open dropdown element, or it's selector
Dropdown Options selector
Value of property 'value'
Perform remove keyboard focus for element.
Page or Frame
Element or selector
Clears text from focuses input via keyboard hotkeys.
Page
Method clears the input.
Before clearing the value method performs click on the element.
After clicking on the input it clears the data inside by selecting all text and deleting it.
If a selector was passed then the method tries to find the element and only then clears the value.
In order to clear the input a page object is needed, so if the context is Frame
then an additional page
argument should be passed.
Click on the provided element. If a selector was passed then the method tries to find the element and only then click on it. The click is available only if the button is not disabled, otherwise the error is thrown.
Clicks at a point with offset from element.
Page
Element or selector
Offset from top left corner of element
ClickOptions
Clicks on parent element of current element
Page or Frame
Element or selector
Click Options
Evaluates browser function on element in defined browser context.
Browser function
Page or Frame
Element or selector
SearchElementOptions
Returns filtered array of elements that contain defined attribute value part.
Page or Frame
Element or selector
Attribute name
Attribute value part
Returns filtered array of elements that exact matches defined attribute value.
Page or Frame
Element or selector
Attribute name
Attribute value
Returns filtered array of elements that are in viewport and not hidden.
Element or selector
Page or Frame
Returns the number of elements by the provided selector.
Gets parent element of defined element.
Page or Frame
Element or selector
This method scrolls element into view if needed, and then performs hover over the center of the element. If a selector was passed then the method tries to find the element first and only then performs hover action.
This method performs hover by offsets from element.
Page or Frame
Element or selector
Offset coordinates
Number of mouse moves during hover
Perform scroll to element.
Page or Frame
Element or selector
Align to top of the viewport
Types a text to the provided element.
Before typing the value in the input field it's cleared if not specified otherwise.
In order to clear the input a page object is needed, so if the context is Frame
then an additional page
argument should be passed.
Wrapper for waitForSelector. Used only for elements that exist. Throws exception on null, so don't pass {hidden: true} prop inside it.
Page or Frame
Element or selector
SearchElementOptions
Returns an array of the elements based on the provided selector. Before retrieving the elements there is a wait function that checks the availability of at least one element.
Gets the element attribute value. If a selector was passed then the method tries to find the element and only then returns the attribute value.
Returns an array of classes for the specified element. If there are no classes for the element returns an empty array.
Method returns the computed style property.
Gets element background color property in {r, g, b} format.
Page or Frame
Element or selector
Gets element style property.
Page or Frame
Element or selector
StyleProperty or string
Gets element style property in {r, g, b} format. Use only for color properties.
Page or Frame
Element or selector
StyleProperty or string
Gets inner html property.
Page or Frame
Element or selector
Gets the element property value. If a selector was passed then the method tries to find the element and only then returns the property value.
Gets element src property.
Page or Frame
Element or selector
Returns the text value of the element. If a selector was passed then the method tries to find the element and only then returns the text value.
Returns the value of the element. If a selector was passed then the method tries to find the element and only then returns the value.
Returns hex color value in {r,g,b} format.
Returns style property as opacity. Only for transparent / {r,g,b,a} values. If property can't be parsed, returns empty string.
string
Returns style property in {r,g,b} format. If transparent - returns {r:0, g:0, b:0}. If property can't be parsed, returns empty string (be careful, pass only color props inside).
string
Checks if element contains class.
Element or selector
Class name
Checks if element computed height doesn't equal 0px.
Page or Frame
selector or ELementHandle
Checks if property exist on element and doesn't equal empty string or null
Element property or string
Page or Frame
selector o ElementHandle
Wait options
Checks if property exist on element and it's value is truthy
Element property or string
Page or Frame
selector o ElementHandle
Wait options
Checks if element computed font weight is equal 700.
Page or Frame
selector o ElementHandle
Checks if element contains checked property.
Page or Frame
Element or selector
Checks if element has class 'closed'. Can be project specific (will not work if closed class is not assigned to element on collapse).
Verifies if the element is disabled by checking its data-disabled
attribute,
disabled
property, and disabled
class value.
Checks if element has class 'open'. Can be project specific (will not work if open class is not assigned to element on expand).
Checks if element is fully in viewport. Helps when element.isIntersectingViewport() doesn't return correct value (example - for animations). Supports getting element from array by index and offsets from borders of viewport.
Page or Frame
Selector
Element index (default - 0)
Offsets from bottom and right border of viewport
Checks if element computed font style is equal italic.
Page or Frame
selector or Element
Checks if element has required property.
Page or Frame
Element or selector
Checks if element has class 'selected'. Can be project specific (will not work if selected class is not assigned to element on selection).
Checks if element computed text decoration is equal underline.
Page or Frame
selector or ElementHandle
Verifies if the element visible by checking next conditions:
false
at onceopacity === '0'
then returns false
display === 'none'
then returns false
visibility === 'hidden'
then returns false
null
then returns false
true
Waits for attribute value of element to be changed after async action. If it doesn't changed after timeout - throws an exception.
Page or Frame
Element or selector
Attribute name
Async function after which attribute should be changed
WaitOptions
Similar to getElement, just another naming and merging options.
Page or Frame
Selector or element
SearchElementOptions
WaitOptions
Waits for attribute value for element to stop changing. Is useful when your element is in rendering and you want to wait until it would be rendered completely.
Page or Frame
Selector or element
Attribute name
WaitOptions
Waits for element not to be in viewport. Using method isIntersectingViewport() that can sometimes return incorrect value (example - in cases of animation when element is disappears but isIntersectingViewport() returns true)
Page or Frame
Selector or element
WaitOptions
Waits for element not to have attribute value. If it doesn't change after timeout - throws an exception.
Page or Frame
Element or selector
Attribute name
Attribute value (default - empty string)
WaitOptions
Waits for element position to stop changing. If element disappears - that also counts like element position is stopped changing.
Page or Frame
Selector or element
WaitOptions
Waits for element to have property 'checked'. If checking element is not changing this property, this method wouldn't work.
Page or Frame
Selector or element
WaitOptions
Waits for element to have class 'open'. If expanding element is not assigning this class, this method wouldn't work.
Selector or element
WaitOptions
Waits until the element will be in the viewport. Before it there is a verification that the element is visible.
Waits for element to have property 'disabled' or 'disabled' class. If element is not assign class / property 'disabled' after disabling, this method wouldn't work.
Page or Frame
Selector or element
WaitOptions
Waits for element not to have property 'checked'. If unchecking element is not changing this property, this method wouldn't work.
Page or Frame
Selector or element
WaitOptions
Waits for element to contain class (or class part).
Page or Frame
Element or selector
Class name or name part
WaitOptions
Waits for element to contain text.
Page or Frame
Element or selector
Target text
WaitOptions
Waits for element to have attribute value (exact match).
Page or Frame
Element or selector
Attribute name
Attribute value
WaitOptions
Waits for element to have attribute value part (NOT exact match).
Page or Frame
Element or selector
Attribute name
Attribute value part
WaitOptions
Waits for element to have property value (exact match).
Page or Frame
Element or selector
Property name
Property string value
WaitOptions
Waits for element to have property value part.
Page or Frame
Element or selector
Property name
Property string value part
WaitOptions
Waits for element to text to be equal to defined (exact match).
Page or Frame
Element or selector
Target text
WaitOptions
Waits for internal element that is rendered inside initialized ElementHandle instance. Supports xpath selectors. If element doesn't found - throws exception. Historically was created for first versions of Puppeteer which didn't have element.waitForSelector(selector);
Waits until the element will be not visible.
Waits until the element will be visible.
Throws error method for async function waiters. Shows which actual highest level function call failed.
Checks if context is frame.
Checks if context is page.
Waits for frame not to exist.
Returns the frame by its name attribute.
Returns frame instance by it's css selector.
Page or frame
CSS or xpath selector
Frame wait options
Returns frame instance by it's title attribute.
Page or frame
Title attribute
Frame wait options
Returns the frame by its source URL value or Reg Exp.
With isStrictMatch
the frame URL value must be strictly equal to the passed frameUrl
value.
Logs class method. Usage: put @log decorator above your class method. Output would be in logs: '{timestamp} Calling ClassName.method(...args);'
Make complicated object to be simple and readable in logs. Assigns property __DISPLAY_NAME: objectKey for each internal object
Method waits for tab with url part or url is opened and brings it to front. If tab does not exist - throws an exception.
Gets scroll for current window.
Vertical scrolls to y coordinate and waits for scroll to be finished.
Scrolls document of frame to the bottom
Scroll the page or frame to the top
Scrolls the page or frame up by defined value
Waits for vertical scroll to be finished.
Chain 2 selectors
Returns class selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-aid selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-automation-id selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-class selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-comp-id selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-comp selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-hook selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-aid selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-item-id selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-option selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-reactid selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-state selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns data-testid selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns id selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns name selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns role selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns selector string by attribute type with ignore case.
Supports =, *=, ^=, $=
matchers.
Selector value string
Attribute type
Matcher
Returns data-skinpart selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns src selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns tab selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Returns value selector string.
Supports =, *=, ^=, $=
matchers.
Selector value string
Matcher
Checks if selector is XPath selector
Causes your script to wait for the given number of milliseconds.
Causes your script to wait for the given number of milliseconds.
Generic wait function that receives the function and polls it with the specific time interval until it will return true.
Waits for element animation to stop happening. Checks that bounding and opacity computed styles are not changed during 1 second. If they changed - repeats cycle. If animation is still happened during killTimeout or ACTION_TIMEOUT - returns. Function returns ElementHandle.
Page or Frame
Selector
timeout when node would be killed if animation is still happened
Waits for collection length to be equal defined number. If it is not after timeout - throws exception.
Async function that returns array
Expected collection length
WaitOptions
Waits for collection length to be more than defined number. If it is not after timeout - throws exception.
Async function that returns array
Min length - 1
WaitOptions
Waits for collection length to be not less than defined number. If it is after timeout - throws exception.
Async function that returns array
Expected collection minimum length
WaitOptions
Waits for collection NOT to have object with type. If it is has after timeout - throws exception.
Async function that returns array of objects with type
Item of same type as collection item that expected NOT to exist in collection
WaitOptions
Waits for collection length to be 0. If it is not after timeout - throws exception.
Async function that returns array
WaitOptions
Waits for collection length to be NOT 0. If it is after timeout - throws exception.
Async function that returns array
WaitOptions
Waits for collection to have object with type. If it is not after timeout - throws exception.
Async function that returns array of objects with type
Item of same type as collection item that expected to exist in collection
WaitOptions
Similar method as waitFor, just another naming.
Async function that returns true
WaitOptions
Message in exception that would overrides default
Function that is called for wait for condition (Needed for exception message, in case of when not highest level function is passed as 1st argument)
Waits for async function value to be falsy (no strict false, but undefined, null). If it is truthy after timeout - throws exception.
Async function that returns boolean or null or undefined
WaitOptions
Message in exception that would overrides default
Waits for async function value to be falsy true. If it is not true after timeout - does nothing. Useful when you need to wait that action is not happened along interval (or you don't care it's happened or not, but you need to handle if it happened)
Async function that returns boolean or null or undefined
WaitOptions
Waits for async function value NOT to be null. If it is after timeout - throws exception.
Async function with type
WaitOptions
Waits for async function value NOT to be undefined. If it is after timeout - throws exception.
Async function with type
WaitOptions
Waits for async function value to be null. If it is not after timeout - throws exception.
Async function with type
WaitOptions
Waits for async function value to be undefined. If it is not after timeout - throws exception.
Async function with type
WaitOptions
Waits for async function value to be changed. Useful when you expect that value you get would be changed after some action. If it is NOT after timeout - throws exception.
Async function with type which value you expect to be changed
Async function that represents action after which change is expected
WaitOptions
Waits for async function value to be changed and then not to change in some interval. Useful when you expect that value you get would be changed after some action and then there would be several temp states (animation, for ex.). If it is NOT after timeout - throws exception.
Async function with type which value you expect to be changed
Async function that represents action after which change is expected
WaitOptions
Waits for async function value NOT to be equal to another async value or value. If it is after timeout - throws exception.
Async function with type which value you check. Contains exception catch and returns void in that case.
Async value or value that you expect NOT to be equal to function
Function that is called for wait for condition (Needed for exception message, in case of when not highest level function is passed as 1st argument)
WaitOptions
Waits for async function value to be equal to another async value or value. If it is NOT after timeout - throws exception.
Async function with type which value you check. Contains exception catch and returns void in that case.
Async value or value that you expect to be equal to function
Function that is called for wait for condition (Needed for exception message, in case of when not highest level function is passed as 1st argument)
WaitOptions
Waits for async function string value to contain string value. If it is not after timeout - throws exception.
Async function with return type: string
String value that function contains
WaitOptions
Waits for async function numeric value is equal or less than expected value. If it is not after timeout - throws exception.
Async function with return type: number
Number value that is equal or less than to function
WaitOptions
Waits for async function numeric value is equal or more than expected value. If it is not after timeout - throws exception.
Async function with return type: number
Number value that is equal or more than to function
WaitOptions
Waits for async function numeric value is less than expected value. If it is not after timeout - throws exception.
Async function with return type: number
Number value that is less than to function
WaitOptions
Waits for async function numeric value is more than expected value If it is not after timeout - throws exception.
Async function with return type: number
Number value that is more than to function
WaitOptions
Waits for async function value is not changing during interval. If function throws an exception both times - return undefined (it's meant that it stopped changing) If it is still changing after timeout - throws exception.
Async function with type
WaitOptions
Waits for async function numeric value is close to expected value by delta amount. |actual - expected| <= delta If it is not after timeout - throws exception.
Async function with return type: number
Number value that is close to function
Precision
WaitOptions
Waits for function value is not equal undefined or custom value, using number of attempts. Returns function value or throws an exception.
Async function with type
WaitWithAttemptsOptions
Custom exception message that overrides default
Generated using TypeDoc
Function checks if promise-like return function value is equal another promise value or value