ppqa

This automation testing project is built using playwright and will serve as a perfect framework to start testing any application across organizations with ease.

View the Project on GitHub

Classes

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.

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.

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)

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

Members

PlaywrightApi

usePlaywrightApi

  • It returns a proxy object that wraps the PlaywrightApi class
usePlaywrightApi

createApiFragment

  • To create a api fragment actions object with proxy traps
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

registerAppInfo

registerPlaywrightPage

  • To register the page to be used for testing
registerPlaywrightPage

registerPlaywrightExpect

  • To register the expect object to be used for testing
registerPlaywrightExpect

registerPlaywrightAPI

  • To register the api object to be used for testing
registerPlaywrightAPI

It registers all the Playwright functions that we'll be using in our tests

registerAll

registerPlaywrightPageLocator

  • To register the locator to be used for testing
PlaywrightPage

usePlaywrightPage A method called to initialize the PlaywrightPage with given page

PlaywrightPageLocator

usePlaywrightPageLocator

  • To use the Playwright Page Locator with proxy
usePlaywrightPageLocator

createFragment

  • To create a web fragment object with proxy traps
createFragment

createFragmentActions

  • To create a web fragment actions object with proxy traps
PlaywrightExpect

usePlaywrightExpect To use the playwright expect with Proxy traps

WebElement

useWebElement

  • To create a WebElement for the given props
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

WebFragmentActions

checkPageActionable

  • This function takes in a locator, an actionable, and an optional negative boolean and options
  • object, and then checks the page for the actionable based on the locator and options.
checkPageActionable

checkLocatorActionable

  • This function takes in a locator, an actionable, and a negative boolean, and then checks the locator
  • against the actionable, and if the negative boolean is true, it will check the opposite of the
  • actionable.

Functions

registerAppUrl(url)

registerAppUrl

  • To register the base url for testing
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.

ApiURLBuilder

To Build API URLs

Kind: global class

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

Kind: global class

LocatorFragment

The LocatorFragment class is a class that can be used to do playwright operations on top of the current locator.

Kind: global class

locatorFragment.waitForNetworkResponseAfter(urlPath, [status]) ⇒

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>

locatorFragment.search(text, options) ⇒

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>

locatorFragment.typeIn(text, options) ⇒

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>

locatorFragment.pressKey(text, options) ⇒

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>

locatorFragment.findInLocator(locator, options) ⇒

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>

locatorFragment.findNth(nth, locator, options) ⇒

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>

locatorFragment.findFirst(locator, options) ⇒

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>

locatorFragment.click(options) ⇒

click

Kind: instance method of LocatorFragment
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

locatorFragment.dispatchEvent(type, options) ⇒

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>

locatorFragment.dblclick(options) ⇒

dblclick

Kind: instance method of LocatorFragment
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

locatorFragment.check(options) ⇒

check

Kind: instance method of LocatorFragment
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

locatorFragment.uncheck(options) ⇒

uncheck

Kind: instance method of LocatorFragment
Returns: <p>The return type is LocatorFragment.</p>

Param Description
options <p>LocatorOptions - Interface</p>

locatorFragment.verifyActionable(actionable, options) ⇒

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>

locatorFragment.verifyNotActionable(actionable, options) ⇒

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

webElement.waitForNetworkResponseAfter(urlPath, [status]) ⇒

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>

webElement.search(text, options) ⇒

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>

webElement.typeIn(text, options) ⇒

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>

webElement.pressKey(text, options) ⇒

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>

webElement.findInLocator(locator) ⇒

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>

webElement.findNth(nth) ⇒

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>

webElement.findFirst() ⇒

findFirst

Kind: instance method of WebElement
Returns: <p>PlaywrightPageLocator (this)</p>

webElement.click(options) ⇒

click

Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

webElement.dispatchEvent(type, options) ⇒

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>

webElement.dblclick(options) ⇒

dblclick

Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

webElement.check(options) ⇒

check

Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

webElement.uncheck(options) ⇒

uncheck

Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>

Param Description
options <p>LocatorOptions - Interface</p>

webElement.verifyActionable(actionable, options) ⇒

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>

webElement.verifyNotActionable(actionable, options) ⇒

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

new URLBuilder()

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();

urlBuilder.culture(culture) ⇒

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>

urlBuilder.suffix(suffix) ⇒

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>

urlBuilder.extra(extra) ⇒

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>

urlBuilder.options(options) ⇒

"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>

urlBuilder.expectedTitle(expectedTitle) ⇒

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>

urlBuilder.build() ⇒

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

webFragment.open(urlProps)

open

Kind: instance method of WebFragment

Param Description
urlProps <p>URLProps Interface</p>

webFragment.reload(options)

reload

Kind: instance method of WebFragment

Param Description
options <p>PageOptions Interface</p>

webFragment.goBack(options)

goBack

Kind: instance method of WebFragment

Param Description
options <p>PageOptions Interface</p>

webFragment.getTitle() ⇒

getTitle

Kind: instance method of WebFragment
Returns: <p>Title of the page as a promise</p>

webFragment.waitForPageLoad(timeout, state)

waitForPageLoad

Kind: instance method of WebFragment

Param Description
timeout <p>timeout in milliseconds</p>
state <p>state to achieve upon load</p>

webFragment.waitForWebElement(locator, [actionable], [baseLocator], [options]) ⇒

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>  

webFragment.waitForNthWebElement(locator, nth, [actionable], [options]) ⇒

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>

playwrightApi.updateHeaders(headers)

updateHeaders

Kind: instance method of PlaywrightApi

Param Type Description
headers HeadersProps <p>HeadersProps</p>

playwrightApi.getRequest(url) ⇒

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>

playwrightApi.postRequest(url, [data]) ⇒

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>

playwrightApi.getBody() ⇒

getBody

Kind: instance method of PlaywrightApi
Returns: <p>The response body.</p>

playwrightApi.getJson() ⇒

getJson

Kind: instance method of PlaywrightApi
Returns: <p>The returnResponse() method is being called and the response is being returned.</p>

playwrightApi.getJsonWithKeys([options]) ⇒

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>

playwrightApi.dispose() ⇒

dispose

Kind: instance method of PlaywrightApi
Returns: <p>The response object.</p>

playwrightApi.isResponseOK() ⇒

isResponseOK

Kind: instance method of PlaywrightApi
Returns: <p>The responseConfig object.</p>

playwrightApi.returnResponse() ⇒

returnResponse

Kind: instance method of PlaywrightApi
Returns: <p>The response object.</p>

playwrightApi.resetResponseConfig()

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

Kind: global variable

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>

playwrightPage.goto(urlProps)

goto

Kind: instance method of PlaywrightPage

Param Description
urlProps <p>URLProps interface</p>

playwrightPage.getTitle() ⇒

getTitle

Kind: instance method of PlaywrightPage
Returns: <p>Title of the page as a promise</p>

playwrightPage.reload(options)

reload

Kind: instance method of PlaywrightPage

Param Description
options <p>PageOptions Interface</p>

playwrightPage.goBack(options)

goBack

Kind: instance method of PlaywrightPage

Param Description
options <p>PageOptions Interface</p>

playwrightPage.waitForPageLoad(timeout, state)

waitForPageLoad

Kind: instance method of PlaywrightPage

Param Description
timeout <p>timeout in milliseconds</p>
state <p>state to achieve upon load</p>

playwrightPage.waitForNetworkResponseAfter(urlPath, status)

waitForNetworkResponseAfter

Kind: instance method of PlaywrightPage

Param Description
urlPath <p>URL path as string</p>
status <p>Response status code to be expected</p>

playwrightPage.click(locator, options)

click

Kind: instance method of PlaywrightPage

Param Description
locator <p>The locator as a string</p>
options <p>Locator options Interface</p>

playwrightPage.dispatchEvent(locator, type, options)

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>

playwrightPage.dblclick(locator, options)

dblclick

Kind: instance method of PlaywrightPage

Param Description
locator <p>The locator as a string</p>
options <p>Locator options Interface</p>

playwrightPage.check(locator, options)

check

Kind: instance method of PlaywrightPage

Param Description
locator <p>The locator as a string</p>
options <p>Locator options Interface</p>

playwrightPage.uncheck(locator, options)

uncheck

Kind: instance method of PlaywrightPage

Param Description
locator <p>The locator as a string</p>
options <p>Locator options Interface</p>

playwrightPage.type(locator, text, options)

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>

playwrightPage.press(locator, text, options)

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>

playwrightPage.find(locator, baseLocator, options) ⇒

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>

playwrightPage.findFirst(selector, options) ⇒

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>

playwrightPage.findNth(selector, options) ⇒

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>

playwrightPage.verifyActionable(locator, actionable, options)

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>

playwrightPage.verifyNotActionable(locator, actionable, options)

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>

playwrightPage.assert()

not

Kind: instance method of PlaywrightPage

playwrightPage.not()

not

Kind: instance method of PlaywrightPage

playwrightPage.toBeEmpty(locator, message, options)

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>

playwrightPage.toHaveText(locator, expected, message, options)

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>

playwrightPage.toHaveValue(locator, value, message, options)

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>

playwrightPage.toHaveAttribute(locator, name, value, message, options)

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>

playwrightPage.toHaveCSS(locator, name, value, message, options)

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>

playwrightPage.toHaveClass(locator, expected, message, options)

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>

playwrightPage.toHaveCount(locator, count, message, options)

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>

playwrightPage.toContainText(locator, expected, message, options)

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>

playwrightPage.toHaveId(locator, id, message, options)

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>

playwrightPageLocator.waitForNetworkResponseAfter(urlPath, status)

waitForNetworkResponseAfter

Kind: instance method of PlaywrightPageLocator

Param Description
urlPath <p>URL path as string</p>
status <p>Response status code to be expected</p>

playwrightPageLocator.click(options)

click

Kind: instance method of PlaywrightPageLocator

Param Description
options <p>Locator options Interface</p>

playwrightPageLocator.dispatchEvent(type, options)

dispatchEvent

Kind: instance method of PlaywrightPageLocator

Param Description
type <p>The type of dispatch event</p>
options <p>Locator options Interface</p>

playwrightPageLocator.dblclick(options)

dblclick

Kind: instance method of PlaywrightPageLocator

Param Description
options <p>Locator options Interface</p>

playwrightPageLocator.check(options)

check

Kind: instance method of PlaywrightPageLocator

Param Description
options <p>Locator options Interface</p>

playwrightPageLocator.uncheck(options)

uncheck

Kind: instance method of PlaywrightPageLocator

Param Description
options <p>Locator options Interface</p>

playwrightPageLocator.press(text, options)

press

Kind: instance method of PlaywrightPageLocator

Param Description
text <p>The Key to be pressed</p>
options <p>Locator options Interface</p>

playwrightPageLocator.type(text, options)

type

Kind: instance method of PlaywrightPageLocator

Param Description
text <p>The text to be entered</p>
options <p>Locator options Interface</p>

playwrightPageLocator.find(locator, options) ⇒

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>

playwrightPageLocator.findFirst() ⇒

findFirst

Kind: instance method of PlaywrightPageLocator
Returns: <p>PlaywrightPageLocator (this)</p>

playwrightPageLocator.findNth(nth) ⇒

findFirst

Kind: instance method of PlaywrightPageLocator
Returns: <p>PlaywrightPageLocator (this)</p>

Param Description
nth <p>Nth count of element to be found</p>

playwrightPageLocator.verifyActionable(actionable, options)

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>

playwrightPageLocator.verifyNotActionable(actionable, options)

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>

playwrightPageLocator.not()

not

Kind: instance method of PlaywrightPageLocator

playwrightPageLocator.toBeEmpty(message)

toBeEmpty

Kind: instance method of PlaywrightPageLocator

Param Description
message <p>The message to be shown on expect</p>

playwrightPageLocator.toHaveText(expected, message)

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>

playwrightPageLocator.toHaveValue(value, message)

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>

playwrightPageLocator.toHaveAttribute(name, value, message)

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>

playwrightPageLocator.toHaveCSS(name, value, message)

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>

playwrightPageLocator.toHaveClass(expected, message)

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>

playwrightPageLocator.toHaveCount(count, message)

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>

playwrightPageLocator.toContainText(expected, message)

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>

playwrightPageLocator.toHaveId(id, message)

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,
  });

webElement.waitForNetworkResponseAfter(urlPath, [status]) ⇒

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>

webElement.search(text, options) ⇒

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>

webElement.typeIn(text, options) ⇒

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>

webElement.pressKey(text, options) ⇒

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>

webElement.findInLocator(locator) ⇒

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>

webElement.findNth(nth) ⇒

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>

webElement.findFirst() ⇒

findFirst

Kind: instance method of WebElement
Returns: <p>PlaywrightPageLocator (this)</p>

webElement.click(options) ⇒

click

Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

webElement.dispatchEvent(type, options) ⇒

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>

webElement.dblclick(options) ⇒

dblclick

Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

webElement.check(options) ⇒

check

Kind: instance method of WebElement
Returns: <p>The LocatorFragment object.</p>

Param Description
options <p>LocatorOptions - Interface</p>

webElement.uncheck(options) ⇒

uncheck

Kind: instance method of WebElement
Returns: <p>The return type is LocatorFragment.</p>

Param Description
options <p>LocatorOptions - Interface</p>

webElement.verifyActionable(actionable, options) ⇒

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>

webElement.verifyNotActionable(actionable, options) ⇒

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);
  }
  ...

webFragment.open(urlProps)

open

Kind: instance method of WebFragment

Param Description
urlProps <p>URLProps Interface</p>

webFragment.reload(options)

reload

Kind: instance method of WebFragment

Param Description
options <p>PageOptions Interface</p>

webFragment.goBack(options)

goBack

Kind: instance method of WebFragment

Param Description
options <p>PageOptions Interface</p>

webFragment.getTitle() ⇒

getTitle

Kind: instance method of WebFragment
Returns: <p>Title of the page as a promise</p>

webFragment.waitForPageLoad(timeout, state)

waitForPageLoad

Kind: instance method of WebFragment

Param Description
timeout <p>timeout in milliseconds</p>
state <p>state to achieve upon load</p>

webFragment.waitForWebElement(locator, [actionable], [baseLocator], [options]) ⇒

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>  

webFragment.waitForNthWebElement(locator, nth, [actionable], [options]) ⇒

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>

webFragmentActions.webElement(locator, [baseLocator], [options]) ⇒

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>

webFragmentActions.waitForWebElement(locator, [actionable], [baseLocator], [options]) ⇒

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>  

webFragmentActions.waitForNthWebElement(locator, nth, [actionable]) ⇒

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.

Kind: global function

waitForLocatorNetworkResponse()

If the LocatorCoreCalls.WAIT_FOR_NETWORK_RESPONSE property is set, wait for a network response with the specified URL and status.

Kind: global function

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>