Skip to content

Commit 3a4b203

Browse files
Merge pull request #19 from TAMILKUMAR0027/Samiha
Samiha
2 parents 2c900a1 + 956f6ff commit 3a4b203

5 files changed

Lines changed: 89 additions & 2 deletions

File tree

actions/BaseAction.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from selenium.webdriver.support.ui import WebDriverWait
44
from selenium.webdriver.support import expected_conditions as EC
55

6-
76
class BaseAction:
87

98
def __init__(self, driver):
@@ -78,4 +77,4 @@ def dismiss_alert_if_present(self):
7877
alert.dismiss()
7978
return text
8079
except TimeoutException:
81-
return None
80+
return None

actions/checkoutAction.py

Whitespace-only changes.

configuration/config.ini

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,43 @@ mode = normal
66
url = https://ecommerce-playground.lambdatest.io/index.php?route=common/home
77
title = Your Store
88

9+
[credentials]
10+
email = testlogin@gmail.com
11+
password = testlogin
12+
913
[timeouts]
1014
explicit_wait = 15
1115
page_load_timeout = 30
1216

17+
[billing]
18+
first_name = John
19+
last_name = Doe
20+
company = TestCompany
21+
address1 = 123 Test Street
22+
city = New York
23+
postcode = 10001
24+
country = United States
25+
region = New York
26+
27+
[registration]
28+
reg_first_name = John
29+
reg_last_name = Doe
30+
reg_email = johndoe123456@example.com
31+
reg_telephone = 9876543210
32+
reg_password = Test@1234
33+
reg_confirm_password = Test@1234
34+
reg_company = TestCompany
35+
reg_address1 = 123 Test Street
36+
reg_address2 = Apt 4B
37+
reg_city = New York
38+
reg_postcode = 10001
39+
reg_country = United States
40+
reg_region = New York
41+
42+
[messages]
43+
login_success = My Account
44+
expected_order_msg = Your order has been placed!
45+
1346
[register credentials]
1447
fname=tommy
1548
lname=shelby

pages/checkoutPage.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
from selenium.webdriver.common.by import By
2+
3+
4+
class CheckoutPage:
5+
6+
NEW_ADDRESS_RADIO = (By.XPATH, "//label[@for='input-payment-address-new']")
7+
REGISTER_ACCOUNT_RADIO = (By.XPATH, "//label[@for='input-account-register']")
8+
9+
SVG_NAVBAR_CART = (By.XPATH, "//div[@id='entry_217825']//div[@class='icon svg-icon']")
10+
SIDEBAR_CHECKOUT_BTN = (By.XPATH, "//a[normalize-space()='Checkout']")
11+
12+
HP_PRODUCT_IMAGE = (By.XPATH,"//a[@id='mz-product-grid-image-47-212469']//div[@class='carousel-item active']//img[@title='HP LP3065']")
13+
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")
14+
15+
SHOPPING_CART_POPUP_LINK = (By.XPATH,"//div[@id='notification-box-top']//a[contains(text(),'shopping cart')]")
16+
CART_PAGE_CHECKOUT_BTN = (By.XPATH, "//div[@class='buttons d-flex']//a[text()='Checkout']")
17+
18+
FIRST_NAME_INPUT = (By.XPATH, "//input[@id='input-payment-firstname']")
19+
LAST_NAME_INPUT = (By.XPATH, "//input[@id='input-payment-lastname']")
20+
COMPANY_INPUT = (By.XPATH, "//input[@id='input-payment-company']")
21+
ADDRESS1_INPUT = (By.XPATH, "//input[@id='input-payment-address-1']")
22+
CITY_INPUT = (By.XPATH, "//input[@id='input-payment-city']")
23+
POSTCODE_INPUT = (By.XPATH, "//input[@id='input-payment-postcode']")
24+
COUNTRY_SELECT = (By.XPATH, "//select[@id='input-payment-country']")
25+
REGION_STATE_SELECT = (By.XPATH, "//select[@id='input-payment-zone']")
26+
27+
SAME_BILLING_ADDRESS_CHECKBOX = (By.XPATH, "//input[@id='input-shipping-address-same']")
28+
SAME_BILLING_ADDRESS_LABEL = (By.XPATH, "//label[@for='input-shipping-address-same']")
29+
30+
CONTINUE_CHECKOUT_BTN = (By.XPATH, "//button[@id='button-save']")
31+
CONFIRM_BTN = (By.XPATH, "//button[@id='button-confirm']")
32+
ORDER_CONFIRMATION_MSG = (By.XPATH, "//h1[normalize-space()='Your order has been placed!']")
33+
34+
COD_LABEL = (By.XPATH, "//label[@for='input-payment-method-cod']")
35+
FLAT_RATE_LABEL = (By.XPATH, "//label[@for='input-shipping-method-flat.flat']")
36+
TERMS_LABEL = (By.XPATH, "//label[@for='input-agree']")
37+
38+
REG_FIRST_NAME_INPUT = (By.XPATH, "//input[@id='input-payment-firstname']")
39+
REG_LAST_NAME_INPUT = (By.XPATH, "//input[@id='input-payment-lastname']")
40+
REG_EMAIL_INPUT = (By.XPATH, "//input[@id='input-payment-email']")
41+
REG_TELEPHONE_INPUT = (By.XPATH, "//input[@id='input-payment-telephone']")
42+
REG_PASSWORD_INPUT = (By.XPATH, "//input[@id='input-payment-password']")
43+
REG_CONFIRM_PASSWORD_INPUT = (By.XPATH, "//input[@id='input-payment-confirm']")
44+
REG_COMPANY_INPUT = (By.XPATH, "//input[@id='input-payment-company']")
45+
REG_ADDRESS1_INPUT = (By.XPATH, "//input[@id='input-payment-address-1']")
46+
REG_ADDRESS2_INPUT = (By.XPATH, "//input[@id='input-payment-address-2']")
47+
REG_CITY_INPUT = (By.XPATH, "//input[@id='input-payment-city']")
48+
REG_POSTCODE_INPUT = (By.XPATH, "//input[@id='input-payment-postcode']")
49+
REG_COUNTRY_SELECT = (By.XPATH, "//select[@id='input-payment-country']")
50+
REG_REGION_STATE_SELECT = (By.XPATH, "//select[@id='input-payment-zone']")
51+
PRIVACY_LABEL = (By.XPATH, "//label[@for='input-account-agree']")
52+
53+
CONFIRM_MESSAGE = (By.XPATH, "//h1[@class='page-title mb-3']")
54+
EMPTY_CART_MESSAGE = (By.XPATH, "//div[@id='content']//p")
55+

tests/test_checkout.py

Whitespace-only changes.

0 commit comments

Comments
 (0)