Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions actions/BaseAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


class BaseAction:

def __init__(self, driver):
Expand Down Expand Up @@ -78,4 +77,4 @@ def dismiss_alert_if_present(self):
alert.dismiss()
return text
except TimeoutException:
return None
return None
Empty file added actions/checkoutAction.py
Empty file.
33 changes: 33 additions & 0 deletions configuration/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,43 @@ mode = normal
url = https://ecommerce-playground.lambdatest.io/index.php?route=common/home
title = Your Store

[credentials]
email = testlogin@gmail.com
password = testlogin

[timeouts]
explicit_wait = 15
page_load_timeout = 30

[billing]
first_name = John
last_name = Doe
company = TestCompany
address1 = 123 Test Street
city = New York
postcode = 10001
country = United States
region = New York

[registration]
reg_first_name = John
reg_last_name = Doe
reg_email = johndoe123456@example.com
reg_telephone = 9876543210
reg_password = Test@1234
reg_confirm_password = Test@1234
reg_company = TestCompany
reg_address1 = 123 Test Street
reg_address2 = Apt 4B
reg_city = New York
reg_postcode = 10001
reg_country = United States
reg_region = New York

[messages]
login_success = My Account
expected_order_msg = Your order has been placed!

[register credentials]
fname=tommy
lname=shelby
Expand Down
55 changes: 55 additions & 0 deletions pages/checkoutPage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from selenium.webdriver.common.by import By


class CheckoutPage:

NEW_ADDRESS_RADIO = (By.XPATH, "//label[@for='input-payment-address-new']")
REGISTER_ACCOUNT_RADIO = (By.XPATH, "//label[@for='input-account-register']")

SVG_NAVBAR_CART = (By.XPATH, "//div[@id='entry_217825']//div[@class='icon svg-icon']")
SIDEBAR_CHECKOUT_BTN = (By.XPATH, "//a[normalize-space()='Checkout']")

HP_PRODUCT_IMAGE = (By.XPATH,"//a[@id='mz-product-grid-image-47-212469']//div[@class='carousel-item active']//img[@title='HP LP3065']")
PRODUCT_PAGE_CHECKOUT_BTN1 = (By.XPATH,"//div[@class='entry-content content-button d-md-none d-lg-block order-1 order-md-0 order-lg-1']/child::button")

SHOPPING_CART_POPUP_LINK = (By.XPATH,"//div[@id='notification-box-top']//a[contains(text(),'shopping cart')]")
CART_PAGE_CHECKOUT_BTN = (By.XPATH, "//div[@class='buttons d-flex']//a[text()='Checkout']")

FIRST_NAME_INPUT = (By.XPATH, "//input[@id='input-payment-firstname']")
LAST_NAME_INPUT = (By.XPATH, "//input[@id='input-payment-lastname']")
COMPANY_INPUT = (By.XPATH, "//input[@id='input-payment-company']")
ADDRESS1_INPUT = (By.XPATH, "//input[@id='input-payment-address-1']")
CITY_INPUT = (By.XPATH, "//input[@id='input-payment-city']")
POSTCODE_INPUT = (By.XPATH, "//input[@id='input-payment-postcode']")
COUNTRY_SELECT = (By.XPATH, "//select[@id='input-payment-country']")
REGION_STATE_SELECT = (By.XPATH, "//select[@id='input-payment-zone']")

SAME_BILLING_ADDRESS_CHECKBOX = (By.XPATH, "//input[@id='input-shipping-address-same']")
SAME_BILLING_ADDRESS_LABEL = (By.XPATH, "//label[@for='input-shipping-address-same']")

CONTINUE_CHECKOUT_BTN = (By.XPATH, "//button[@id='button-save']")
CONFIRM_BTN = (By.XPATH, "//button[@id='button-confirm']")
ORDER_CONFIRMATION_MSG = (By.XPATH, "//h1[normalize-space()='Your order has been placed!']")

COD_LABEL = (By.XPATH, "//label[@for='input-payment-method-cod']")
FLAT_RATE_LABEL = (By.XPATH, "//label[@for='input-shipping-method-flat.flat']")
TERMS_LABEL = (By.XPATH, "//label[@for='input-agree']")

REG_FIRST_NAME_INPUT = (By.XPATH, "//input[@id='input-payment-firstname']")
REG_LAST_NAME_INPUT = (By.XPATH, "//input[@id='input-payment-lastname']")
REG_EMAIL_INPUT = (By.XPATH, "//input[@id='input-payment-email']")
REG_TELEPHONE_INPUT = (By.XPATH, "//input[@id='input-payment-telephone']")
REG_PASSWORD_INPUT = (By.XPATH, "//input[@id='input-payment-password']")
REG_CONFIRM_PASSWORD_INPUT = (By.XPATH, "//input[@id='input-payment-confirm']")
REG_COMPANY_INPUT = (By.XPATH, "//input[@id='input-payment-company']")
REG_ADDRESS1_INPUT = (By.XPATH, "//input[@id='input-payment-address-1']")
REG_ADDRESS2_INPUT = (By.XPATH, "//input[@id='input-payment-address-2']")
REG_CITY_INPUT = (By.XPATH, "//input[@id='input-payment-city']")
REG_POSTCODE_INPUT = (By.XPATH, "//input[@id='input-payment-postcode']")
REG_COUNTRY_SELECT = (By.XPATH, "//select[@id='input-payment-country']")
REG_REGION_STATE_SELECT = (By.XPATH, "//select[@id='input-payment-zone']")
PRIVACY_LABEL = (By.XPATH, "//label[@for='input-account-agree']")

CONFIRM_MESSAGE = (By.XPATH, "//h1[@class='page-title mb-3']")
EMPTY_CART_MESSAGE = (By.XPATH, "//div[@id='content']//p")

Empty file added tests/test_checkout.py
Empty file.
Loading