This automation testing project is built using playwright and will serve as a perfect framework to start testing any application across organizations with ease.
Classes
To Build API URLs
This class is used to wait for the network to be idle before continuing with the test. This module cannot be used directly by a test code, but can be provided to be used by Proxy Check createFragment and createFragmentActions for how it is being used
The LocatorFragment class is a class that can be used to do playwright operations on top of the current locator.
This class can be used to create a WebElement for Dom Nodes and interact with them using the functions in this class The class is a wrapper for the playwrightPageLocator object. The class is used to create a fluent interface for the playwrightPageLocator object.
This class is used to build a URLProps object. This will be used build the URL to be used later to create an URLProps to add WebFragment(WebPage/Component/or any sort)
It's a class that contains functions that can be used to interact with the dom nodes in a web page/component/anything by that design
Members
usePlaywrightApi
createApiFragment
The basic appinfo data might be needed for testing the app
It takes an object of type AppInfo and assigns it to the appInfo variable
registerPlaywrightPage
registerPlaywrightExpect
registerPlaywrightAPI
It registers all the Playwright functions that we'll be using in our tests
registerPlaywrightPageLocator
usePlaywrightPage A method called to initialize the PlaywrightPage with given page
usePlaywrightPageLocator
createFragment
createFragmentActions
usePlaywrightExpect To use the playwright expect with Proxy traps
useWebElement
This class is a base class for all page objects. It contains functions that return a new instance of the LocatorFragment class. Use this class to pawn of the actions thats can be done in a web page, primary building actions of the available DOM nodes in a web fragment This is almost similar to how WebFragment works except this class will not have any actions one can see on page like goBack(), reload(), etc
checkPageActionable
checkLocatorActionable
Functions
registerAppUrl
If the WAIT_FOR_NETWORK_RESPONSE property is set, wait for a network response with the specified URL and status.
If the LocatorCoreCalls.WAIT_FOR_NETWORK_RESPONSE property is set, wait for a network response with the specified URL and status.
This function waits for the network to be idle for a certain amount of time before continuing.
ApiURLBuilder
To Build API URLs
WaitLogic
This class is used to wait for the network to be idle before continuing with the test. This module cannot be used directly by a test code, but can be provided to be used by Proxy Check createFragment and createFragmentActions for how it is being used
LocatorFragment
The LocatorFragment class is a class that can be used to do playwright operations on top of the current locator.
Kind: global class
waitForNetworkResponseAfter
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| urlPath | string |
<p>string - The URL path to wait for.</p> |
| [status] | number |
<p>The HTTP status code to wait for.</p> |
search
Kind: instance method of LocatorFragment
Returns: <p>The LocatorFragment object.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - the text to search for</p> |
| options | <p>LocatorOptions - Interface</p> |
typeIn
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - The text to type into the element</p> |
| options | <p>LocatorOptions - Interface</p> |
pressKey
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - The text to type into the element.</p> |
| options | <p>LocatorOptions - Interface</p> |
findInLocator
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| locator | string |
<p>string - the locator you want to find</p> |
| options | <p>LocatorOptions - Interface</p> |
findNth
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| nth | number |
<p>number - The nth element to find.</p> |
| locator | string |
<p>string - The locator to find the element</p> |
| options | <p>LocatorOptions - Interface</p> |
findFirst
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| locator | string |
<p>string - The locator to find the element</p> |
| options | <p>LocatorOptions - Interface</p> |
click
Kind: instance method of LocatorFragment
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
dispatchEvent
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| type | string |
<p>string - The type of event to dispatch.</p> |
| options | <p>LocatorOptions - Interface</p> |
dblclick
Kind: instance method of LocatorFragment
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
check
Kind: instance method of LocatorFragment
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
uncheck
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
verifyActionable
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| actionable | Actionable |
<p>Actionable</p> |
| options | <p>LocatorOptions - Interface</p> |
verifyNotActionable
Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| actionable | Actionable |
<p>Actionable</p> |
| options | <p>LocatorOptions - Interface</p> |
WebElement
This class can be used to create a WebElement for Dom Nodes and interact with them using the functions in this class The class is a wrapper for the playwrightPageLocator object. The class is used to create a fluent interface for the playwrightPageLocator object.
Kind: global class
waitForNetworkResponseAfter
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| urlPath | string |
<p>string - The URL path to wait for.</p> |
| [status] | number |
<p>The HTTP status code to wait for.</p> |
search
Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - the text to search for</p> |
| options | <p>LocatorOptions - Interface</p> |
typeIn
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - The text to type into the element</p> |
| options | <p>LocatorOptions - Interface</p> |
pressKey
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - The text to type into the element.</p> |
| options | <p>LocatorOptions - Interface</p> |
findInLocator
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| locator | string |
<p>string - the locator you want to find</p> |
findNth
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| nth | number |
<p>number - The nth element to find.</p> |
findFirst
Kind: instance method of WebElement
Returns: <p>PlaywrightPageLocator (this)</p>
click
Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
dispatchEvent
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| type | string |
<p>string - The type of event to dispatch.</p> |
| options | <p>LocatorOptions - Interface</p> |
dblclick
Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
check
Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
uncheck
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
verifyActionable
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| actionable | Actionable |
<p>Actionable</p> |
| options | <p>LocatorOptions - Interface</p> |
verifyNotActionable
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| actionable | Actionable |
<p>Actionable</p> |
| options | <p>LocatorOptions - Interface</p> |
URLBuilder
This class is used to build a URLProps object. This will be used build the URL to be used later to create an URLProps to add WebFragment(WebPage/Component/or any sort)
Kind: global class
A Simple constructor to initialize the _page value without this, above data member will become undefined
Example
//Build a simple URLProps like below
export const TodoMvcPageProps = (): URLProps => new URLBuilder().suffix('todomvc').build();
This function takes a string as a parameter and returns a URLBuilder object.
Kind: instance method of URLBuilder
Returns: <p>The URLBuilder object.</p>
| Param | Type | Description |
|---|---|---|
| culture | string |
<p>string</p> |
This function takes a string as an argument and sets the suffix property of the URLBuilder class to the value of the string argument. It then sets the url property of the URLBuilder class to the value of the url property plus the value of the suffix property. It then returns the URLBuilder class.
Kind: instance method of URLBuilder
Returns: <p>The URLBuilder object.</p>
| Param | Type | Description |
|---|---|---|
| suffix | string |
<p>string - The suffix to be added to the URL.</p> |
It takes a string as an argument, sets the extra property of the _url object to the string, and then sets the url property of the _url object to the url property of the _url object plus the extra property of the _url object.
Kind: instance method of URLBuilder
Returns: <p>The URLBuilder object.</p>
| Param | Type | Description |
|---|---|---|
| extra | string |
<p>string - This is the extra string that will be appended to the url.</p> |
"This function takes an object with optional properties and returns an object with optional properties."
Kind: instance method of URLBuilder
Returns: <p>The URLBuilder object.</p>
| Param | Description |
|---|---|
| options | <p>simpleOptions</p> |
This function sets the expectedTitle property of the URL object and returns the URLBuilder object.
Kind: instance method of URLBuilder
Returns: <p>The URLBuilder object.</p>
| Param | Type | Description |
|---|---|---|
| expectedTitle | string |
<p>The title of the page you expect to be on.</p> |
The function returns the URLProps object that was created in the constructor.
Kind: instance method of URLBuilder
Returns: <p>The URLProps object.</p>
WebFragment
It's a class that contains functions that can be used to interact with the dom nodes in a web page/component/anything by that design
Kind: global class
open
Kind: instance method of WebFragment
| Param | Description |
|---|---|
| urlProps | <p>URLProps Interface</p> |
reload
Kind: instance method of WebFragment
| Param | Description |
|---|---|
| options | <p>PageOptions Interface</p> |
goBack
Kind: instance method of WebFragment
| Param | Description |
|---|---|
| options | <p>PageOptions Interface</p> |
getTitle
Kind: instance method of WebFragment
Returns: <p>Title of the page as a promise</p>
waitForPageLoad
Kind: instance method of WebFragment
| Param | Description |
|---|---|
| timeout | <p>timeout in milliseconds</p> |
| state | <p>state to achieve upon load</p> |
waitForWebElement
Kind: instance method of WebFragment
Returns: <p>A LocatorFragment object.</p>
| Param | Type | Description | |
|---|---|---|---|
| locator | string |
<p>string - the locator to find</p> | |
| [actionable] | Actionable | Array.<Actionable> |
<p>Actionable | Actionable[]</p> |
| [baseLocator] | Locator |
<p>The base locator to use for the find.</p> | |
| [options] | FindOptions |
<p>FindOptions = {</p> |
waitForNthWebElement
Kind: instance method of WebFragment
Returns: <p>A new instance of the LocatorFragment class.</p>
| Param | Type | Description | |
|---|---|---|---|
| locator | string |
<p>string - the locator to find</p> | |
| nth | number |
<p>number - the nth element to find</p> | |
| [actionable] | Actionable | Array.<Actionable> |
<p>Actionable | Actionable[]</p> |
| [options] | FindOptions |
<p>FindOptions = {</p> |
PlaywrightApi ⇒
usePlaywrightApi
Kind: global variable
Returns: <p>A Proxy object that is a PlaywrightApiProps.</p>
| Param | Type | Description |
|---|---|---|
| request | APIRequestContext |
<p>APIRequestContext - This is the request object that is passed to the API function.</p> |
updateHeaders
Kind: instance method of PlaywrightApi
| Param | Type | Description |
|---|---|---|
| headers | HeadersProps |
<p>HeadersProps</p> |
getRequest
Kind: instance method of PlaywrightApi
Returns: <p>The response from the API call.</p>
| Param | Type | Description |
|---|---|---|
| url | string |
<p>string - The url to make the request to</p> |
postRequest
Kind: instance method of PlaywrightApi
Returns: <p>The response object.</p>
| Param | Type | Description |
|---|---|---|
| url | string |
<p>string - The url to send the request to</p> |
| [data] | unknown |
<p>The data to be sent to the server.</p> |
getBody
Kind: instance method of PlaywrightApi
Returns: <p>The response body.</p>
getJson
Kind: instance method of PlaywrightApi
Returns: <p>The returnResponse() method is being called and the response is being returned.</p>
getJsonWithKeys
Kind: instance method of PlaywrightApi
Returns: <p>An object with two properties: json and keys.</p>
| Param | Description |
|---|---|
| [options] | <p>splicing options like keys</p> |
dispose
Kind: instance method of PlaywrightApi
Returns: <p>The response object.</p>
isResponseOK
Kind: instance method of PlaywrightApi
Returns: <p>The responseConfig object.</p>
returnResponse
Kind: instance method of PlaywrightApi
Returns: <p>The response object.</p>
resetResponseConfig
Kind: instance method of PlaywrightApi
usePlaywrightApi ⇒
createApiFragment
Kind: global variable
Returns: <p>The ApiFragment actions with Proxy traps</p>
| Param | Description |
|---|---|
| ClassObject | <p>The ClassObject that will use ApiFragment actions</p> |
appInfo
The basic appinfo data might be needed for testing the app
registerAppUrl
It takes an object of type AppInfo and assigns it to the appInfo variable
Kind: global variable
| Param | Type | Description |
|---|---|---|
| info | AppInfo |
<p>AppInfo</p> |
registerAppInfo
registerPlaywrightPage
Kind: global variable
| Param | Description |
|---|---|
| page | <p>Playwright tests page to be used</p> |
registerPlaywrightPage
registerPlaywrightExpect
Kind: global variable
| Param | Description |
|---|---|
| expect | <p>Playwright tests expect to be used</p> |
registerPlaywrightExpect
registerPlaywrightAPI
Kind: global variable
| Param | Description |
|---|---|
| request | <p>Playwright tests request to be used</p> |
registerPlaywrightAPI
It registers all the Playwright functions that we'll be using in our tests
Kind: global variable
| Param | Description |
|---|---|
| hooks | <p>object that accepts url, page, expect, request module from Playwright</p> |
registerAll
registerPlaywrightPageLocator
Kind: global variable
| Param | Description |
|---|---|
| locator | <p>The locator to be used for testing</p> |
| options |
PlaywrightPage ⇒
usePlaywrightPage A method called to initialize the PlaywrightPage with given page
Kind: global variable
Returns: <p>The Playwright page object’s proxy</p>
| Param | Description |
|---|---|
| page | <p>Playwright page to be used</p> |
goto
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| urlProps | <p>URLProps interface</p> |
getTitle
Kind: instance method of PlaywrightPage
Returns: <p>Title of the page as a promise</p>
reload
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| options | <p>PageOptions Interface</p> |
goBack
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| options | <p>PageOptions Interface</p> |
waitForPageLoad
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| timeout | <p>timeout in milliseconds</p> |
| state | <p>state to achieve upon load</p> |
waitForNetworkResponseAfter
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| urlPath | <p>URL path as string</p> |
| status | <p>Response status code to be expected</p> |
click
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator as a string</p> |
| options | <p>Locator options Interface</p> |
dispatchEvent
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator as a string</p> |
| type | <p>Event type</p> |
| options | <p>Locator options Interface</p> |
dblclick
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator as a string</p> |
| options | <p>Locator options Interface</p> |
check
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator as a string</p> |
| options | <p>Locator options Interface</p> |
uncheck
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator as a string</p> |
| options | <p>Locator options Interface</p> |
type
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator as a string</p> |
| text | <p>The text to be entered in the text box</p> |
| options | <p>Locator options Interface</p> |
press
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator as a string</p> |
| text | <p>The Key to be pressed</p> |
| options | <p>Locator options Interface</p> |
find
Kind: instance method of PlaywrightPage
Returns: <p>PlaywrightPageLocator (this)</p>
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| baseLocator | <p>Base Locator of the element to be found - optional</p> |
| options | <p>FindOptions Interface</p> |
findFirst
Kind: instance method of PlaywrightPage
Returns: <p>PlaywrightPageLocator (this)</p>
| Param | Description |
|---|---|
| selector | <p>The locator string for the element</p> |
| options | <p>FindOptions Interface</p> |
findNth
Kind: instance method of PlaywrightPage
Returns: <p>PlaywrightPageLocator (this)</p>
| Param | Description |
|---|---|
| selector | <p>The locator string for the element</p> |
| options | <p>FindOptions Interface</p> |
verifyActionable
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| actionable | <p>Actionable enum to set a Actionable event on ELement</p> |
| options | <p>LocatorOptions - Interface</p> |
verifyNotActionable
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| actionable | <p>Actionable enum to set a Actionable event on ELement</p> |
| options | <p>LocatorOptions - Interface</p> |
not
Kind: instance method of PlaywrightPage
not
Kind: instance method of PlaywrightPage
toBeEmpty
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
toHaveText
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| expected | <p>The Expected Text in the element</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
toHaveValue
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| value | <p>The Expected value in the element</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
toHaveAttribute
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| name | <p>The Expected name of attribute in the element</p> |
| value | <p>The Expected value of attribute in the element</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
toHaveCSS
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| name | <p>The Expected name of CSS attribute in the element</p> |
| value | <p>The Expected value of CSS attribute in the element</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
toHaveClass
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| expected | <p>The Expected class in the element</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
toHaveCount
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| count | <p>The count expected to be found - as DOM nodes</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
toContainText
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| expected | <p>The expected part of text to be found</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
toHaveId
Kind: instance method of PlaywrightPage
| Param | Description |
|---|---|
| locator | <p>The locator string for the element</p> |
| id | <p>The expected ID in web Element</p> |
| message | <p>The message to be shown on expect</p> |
| options | <p>FindOptions - Interface</p> |
PlaywrightPageLocator ⇒
usePlaywrightPageLocator
Kind: global variable
Returns: <p>The PageLocator with Proxy</p>
| Param | Description |
|---|---|
| locator | <p>The element Locator</p> |
| options | <p>The Locator Options for element</p> |
waitForNetworkResponseAfter
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| urlPath | <p>URL path as string</p> |
| status | <p>Response status code to be expected</p> |
click
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| options | <p>Locator options Interface</p> |
dispatchEvent
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| type | <p>The type of dispatch event</p> |
| options | <p>Locator options Interface</p> |
dblclick
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| options | <p>Locator options Interface</p> |
check
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| options | <p>Locator options Interface</p> |
uncheck
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| options | <p>Locator options Interface</p> |
press
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| text | <p>The Key to be pressed</p> |
| options | <p>Locator options Interface</p> |
type
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| text | <p>The text to be entered</p> |
| options | <p>Locator options Interface</p> |
find
Kind: instance method of PlaywrightPageLocator
Returns: <p>PlaywrightPageLocator (this)</p>
| Param | Description |
|---|---|
| locator | <p>Locator of the element to be found</p> |
| options | <p>FindOptions Interface</p> |
findFirst
Kind: instance method of PlaywrightPageLocator
Returns: <p>PlaywrightPageLocator (this)</p>
findFirst
Kind: instance method of PlaywrightPageLocator
Returns: <p>PlaywrightPageLocator (this)</p>
| Param | Description |
|---|---|
| nth | <p>Nth count of element to be found</p> |
verifyActionable
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| actionable | <p>Actionable enum to set a Actionable event on ELement</p> |
| options | <p>LocatorOptions - Interface</p> |
verifyNotActionable
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| actionable | <p>Actionable enum to set a Actionable event on ELement</p> |
| options | <p>LocatorOptions - Interface</p> |
not
Kind: instance method of PlaywrightPageLocator
toBeEmpty
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| message | <p>The message to be shown on expect</p> |
toHaveText
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| expected | <p>The Expected Text in the element</p> |
| message | <p>The message to be shown on expect</p> |
toHaveValue
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| value | <p>The Expected value in the element</p> |
| message | <p>The message to be shown on expect</p> |
toHaveAttribute
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| name | <p>The Expected name of attribute in the element</p> |
| value | <p>The Expected value of attribute in the element</p> |
| message | <p>The message to be shown on expect</p> |
toHaveCSS
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| name | <p>The Expected name of CSS attribute in the element</p> |
| value | <p>The Expected value of CSS attribute in the element</p> |
| message | <p>The message to be shown on expect</p> |
toHaveClass
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| expected | <p>The Expected class in the element</p> |
| message | <p>The message to be shown on expect</p> |
toHaveCount
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| count | <p>The count expected to be found - as DOM nodes</p> |
| message | <p>The message to be shown on expect</p> |
toContainText
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| expected | <p>The expected part of text to be found</p> |
| message | <p>The message to be shown on expect</p> |
toHaveId
Kind: instance method of PlaywrightPageLocator
| Param | Description |
|---|---|
| id | <p>The expected ID in web Element</p> |
| message | <p>The message to be shown on expect</p> |
usePlaywrightPageLocator ⇒
createFragment
Kind: global variable
Returns: <p>The WebFragment with Proxy traps</p>
| Param | Description |
|---|---|
| ClassObject | <p>The ClassObject that will use WebFragment</p> |
| urlProps | <p>The URLProps</p> |
Example
//Use below example to create a new WebFragment
let todoMvcPage: TodoMvcPage = createFragment(
TodoMvcPage,
TodoMvcPageProps()
);
createFragment ⇒
createFragmentActions
Kind: global variable
Returns: <p>The WebFragment actions with Proxy traps</p>
| Param | Description |
|---|---|
| ClassObject | <p>The ClassObject that will use WebFragment actions</p> |
Example
//Use below example to create a new WebFragment
let actions: TodoMvcPageActions = createFragmentActions(
TodoMvcPageActions
);
PlaywrightExpect ⇒
usePlaywrightExpect To use the playwright expect with Proxy traps
Kind: global variable
Returns: <p>A proxy object for PlaywrightExpect</p>
| Param | Description |
|---|---|
| expect | <p>Playwright Expect to be used</p> |
WebElement ⇒
useWebElement
Kind: global variable
Returns: <p>WebElement</p>
| Param | Description |
|---|---|
| webElementProps | <p>WebElementType</p> |
Example
//Just like below one can simply create a WebElement using the below example
const newTodoTextBox = (text?: string): WebElement =>
useWebElement({
locator: '.new-todo',
text,
});
waitForNetworkResponseAfter
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| urlPath | string |
<p>string - The URL path to wait for.</p> |
| [status] | number |
<p>The HTTP status code to wait for.</p> |
search
Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - the text to search for</p> |
| options | <p>LocatorOptions - Interface</p> |
typeIn
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - The text to type into the element</p> |
| options | <p>LocatorOptions - Interface</p> |
pressKey
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| text | string |
<p>string - The text to type into the element.</p> |
| options | <p>LocatorOptions - Interface</p> |
findInLocator
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| locator | string |
<p>string - the locator you want to find</p> |
findNth
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| nth | number |
<p>number - The nth element to find.</p> |
findFirst
Kind: instance method of WebElement
Returns: <p>PlaywrightPageLocator (this)</p>
click
Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
dispatchEvent
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| type | string |
<p>string - The type of event to dispatch.</p> |
| options | <p>LocatorOptions - Interface</p> |
dblclick
Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
check
Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
uncheck
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Description |
|---|---|
| options | <p>LocatorOptions - Interface</p> |
verifyActionable
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| actionable | Actionable |
<p>Actionable</p> |
| options | <p>LocatorOptions - Interface</p> |
verifyNotActionable
Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>
| Param | Type | Description |
|---|---|---|
| actionable | Actionable |
<p>Actionable</p> |
| options | <p>LocatorOptions - Interface</p> |
WebFragment
This class is a base class for all page objects. It contains functions that return a new instance of the LocatorFragment class. Use this class to pawn of the actions thats can be done in a web page, primary building actions of the available DOM nodes in a web fragment This is almost similar to how WebFragment works except this class will not have any actions one can see on page like goBack(), reload(), etc
Kind: global variable
Example
//Create a simple class and make sure the class extends WebFragment to avail all the below functionalities
export class TodoMvcPageActions extends WebFragmentActions {
constructor() {
super();
}
...
//This can be later called in a class that extends WebFragment to link the actions available in WebFragment like below
export class TodoMvcPage extends WebFragment {
actions: TodoMvcPageActions;
constructor(urlProps?: URLProps) {
super(urlProps);
this.actions = createFragmentActions(TodoMvcPageActions);
}
...
open
Kind: instance method of WebFragment
| Param | Description |
|---|---|
| urlProps | <p>URLProps Interface</p> |
reload
Kind: instance method of WebFragment
| Param | Description |
|---|---|
| options | <p>PageOptions Interface</p> |
goBack
Kind: instance method of WebFragment
| Param | Description |
|---|---|
| options | <p>PageOptions Interface</p> |
getTitle
Kind: instance method of WebFragment
Returns: <p>Title of the page as a promise</p>
waitForPageLoad
Kind: instance method of WebFragment
| Param | Description |
|---|---|
| timeout | <p>timeout in milliseconds</p> |
| state | <p>state to achieve upon load</p> |
waitForWebElement
Kind: instance method of WebFragment
Returns: <p>A LocatorFragment object.</p>
| Param | Type | Description | |
|---|---|---|---|
| locator | string |
<p>string - the locator to find</p> | |
| [actionable] | Actionable | Array.<Actionable> |
<p>Actionable | Actionable[]</p> |
| [baseLocator] | Locator |
<p>The base locator to use for the find.</p> | |
| [options] | FindOptions |
<p>FindOptions = {</p> |
waitForNthWebElement
Kind: instance method of WebFragment
Returns: <p>A new instance of the LocatorFragment class.</p>
| Param | Type | Description | |
|---|---|---|---|
| locator | string |
<p>string - the locator to find</p> | |
| nth | number |
<p>number - the nth element to find</p> | |
| [actionable] | Actionable | Array.<Actionable> |
<p>Actionable | Actionable[]</p> |
| [options] | FindOptions |
<p>FindOptions = {</p> |
WebFragmentActions
checkPageActionable
Kind: global variable
| Param | Type | Default | Description |
|---|---|---|---|
| locator | string |
<p>string - the locator of the element</p> | |
| actionable | Actionable |
<p>Actionable - This is an enum that I created that has the following values:</p> | |
| [negative] | boolean |
false |
<p>boolean = false,</p> |
| [options] | LocatorOptions |
<p>LocatorOptions</p> |
webElement
Kind: instance method of WebFragmentActions
Returns: <p>A LocatorFragment object.</p>
| Param | Type | Description |
|---|---|---|
| locator | string |
<p>string - the locator to find</p> |
| [baseLocator] | Locator |
<p>The base locator to use for the element.</p> |
| [options] | FindOptions |
<p>FindOptions</p> |
waitForWebElement
Kind: instance method of WebFragmentActions
Returns: <p>A LocatorFragment object.</p>
| Param | Type | Description | |
|---|---|---|---|
| locator | string |
<p>string - the locator to find</p> | |
| [actionable] | Actionable | Array.<Actionable> |
<p>Actionable | Actionable[]</p> |
| [baseLocator] | Locator |
<p>The base locator to use for the find.</p> | |
| [options] | FindOptions |
<p>FindOptions = {</p> |
waitForNthWebElement
Kind: instance method of WebFragmentActions
Returns: <p>A new instance of the LocatorFragment class.</p>
| Param | Type | Description | |
|---|---|---|---|
| locator | string |
<p>string - the locator to find</p> | |
| nth | number |
<p>number - the nth element to wait for</p> | |
| [actionable] | Actionable | Array.<Actionable> |
<p>Actionable | Actionable[]</p> |
checkPageActionable
checkLocatorActionable
Kind: global variable
| Param | Type | Default | Description |
|---|---|---|---|
| locator | Locator |
<p>Locator - this is the locator that you want to check</p> | |
| actionable | Actionable |
<p>Actionable - This is an enum that contains the following values:</p> | |
| [negative] | boolean |
false |
<p>boolean = false,</p> |
| [options] | LocatorOptions |
<p>LocatorOptions</p> |
registerAppUrl(url)
registerAppUrl
Kind: global function
| Param | Description |
|---|---|
| url | <p>The base URL string</p> |
waitForPageNetworkResponse()
If the WAIT_FOR_NETWORK_RESPONSE property is set, wait for a network response with the specified URL and status.
waitForLocatorNetworkResponse()
If the LocatorCoreCalls.WAIT_FOR_NETWORK_RESPONSE property is set, wait for a network response with the specified URL and status.
waitForNetworkIdle(options) ⇒
This function waits for the network to be idle for a certain amount of time before continuing.
Kind: global function
Returns: <p>A promise.</p>
| Param | Type | Description |
|---|---|---|
| options | WaitForNetworkIdleProps |
<p>WaitForNetworkIdleProps = {</p> |