forked from jobeasy-team/python-selenium-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdatedTC.py
More file actions
20 lines (16 loc) · 690 Bytes
/
UpdatedTC.py
File metadata and controls
20 lines (16 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from selenium import webdriver
from selenium.webdriver.common.by import By
# init driver
driver = webdriver.Chrome(executable_path="C:/ChoiLearning/Automation/python-selenium-automation/chromedriver.exe")
driver.maximize_window()
# open the url
driver.get('https://www.amazon.com/')
# Sign in Sign up page
driver.find_element(By.CSS_SELECTOR, "#nav-orders").click()
expected_title = 'Sign-In'
# Expected & Actual
actual_title = driver.find_element(By.CSS_SELECTOR, "h1.a-spacing-small").text
assert actual_title == expected_title, f'Expected {expected_title} but got{actual_title}'
#email is present
assert driver.find_element(By.CSS_SELECTOR, "#ap_email").is_displayed()
driver.quit();