Constructor
new module:CartPage(driver, args)
Parameters:
Name | Type | Description |
---|---|---|
driver |
WebDriver | Instance of WebDriver. |
args |
object | Configuration arguments. |
- Source:
Extends
- Page
Methods
checkout() → {Promise}
Click the "Proceed to checkout" button.
- Source:
Returns:
Promise that evaluates to true
if button successfully clicked, false
otherwise.
- Type
- Promise
getItem(productTitle, args) → {ComponentCartItem}
Get the ComponentCartItem object for a product.
Parameters:
Name | Type | Description |
---|---|---|
productTitle |
string | The title of the product to associate with the object. |
args |
object | Config options. Default { qty: 1 }. |
- Source:
Returns:
ComponentCartItem.
- Type
- ComponentCartItem
hasItem(productTitle, args) → {Promise}
Check whether a specific item is in the cart.
Parameters:
Name | Type | Description |
---|---|---|
productTitle |
string | The product title to look for. |
args |
object | Config options. Default { qty: 1 }. |
- Source:
Returns:
Promise that evaluates to true
if item is displayed in the cart, false
otherwise.
- Type
- Promise
hasNoItem() → {Promise}
Check whether the cart is empty.
- Source:
Returns:
Promise that evaluates to true
if cart is empty, false
otherwise.
- Type
- Promise
hasSubtotal(subtotal) → {Promise}
Check whether the cart has a certain subtotal.
Parameters:
Name | Type | Description |
---|---|---|
subtotal |
string | The amount to look for. |
- Source:
Returns:
Promise that evaluates to true
if the subtotal is present, false
otherwise.
- Type
- Promise
returnToShop() → {Promise}
Click the "Return to Shop" link.
- Source:
Returns:
Promise that evaluates to true
if link is clicked successfully, false
otherwise.
- Type
- Promise
update() → {Promise}
Click the "Update cart" button.
- Source:
Returns:
Promise that evaluates to true
if button successfully clicked, false
otherwise.
- Type
- Promise