module:ShopPage

module:ShopPage

The front-end Shop page.

Constructor

new module:ShopPage(driver, args)

Parameters:
Name Type Description
driver WebDriver

Instance of WebDriver.

args object

Configuration arguments.

Source:

Extends

  • Page

Methods

addProductToCart(productTitle) → {Promise}

Add a product to the cart.

Parameters:
Name Type Description
productTitle string

The title of the product to add.

Source:
Returns:

Promise that evaluates to true if product is found and added, false otherwise.

Type
Promise

clickProduct(productTitle) → {Promise}

Click a product.

Parameters:
Name Type Description
productTitle string

The title of the product to click.

Source:
Returns:

Promise that evaluates to true if product is found and clicked, false otherwise.

Type
Promise

goToPage(pageNum) → {Promise}

Go to a specific shop page

Parameters:
Name Type Description
pageNum number

The page number to go to.

Source:
Returns:

Promise that evaluates to true if able to go to specified page, false otherwise.

Type
Promise

nextPage() → {Promise}

Go to the next shop page

Source:
Returns:

Promise that evaluates to true if able to go to next page, false otherwise.

Type
Promise

sortBy(optionText) → {Promise}

Change the shop product sorting

Parameters:
Name Type Default Description
optionText string Default sorting

The text of the sort option. Default: "Default sorting".

Source:
Returns:

Promise that evaluates to true if able to select sort option, false otherwise.

Type
Promise