def test_SignIn(): try: ## Step 1) Open Chrome browser object_lib = LIB() browser = object_lib.OpenBrowser() ## 2) Go to URL object_lib.PageLoad(browser) ## 3) Click to Sign In in Home page object_home = Home(browser) object_home.OpenSignIn(browser) ## 4) Fill email address and password object_signin = Sign_In(browser) object_signin.LoginPass(browser) ## 5)Click Sign In sign_in_button object_signin.ClickSignIn(browser) ## 6) Verify that you signed successfully assert "My account" in browser.title print("Test run Passed!") # except Exception as e: # print(e) # print("Test run Failed") finally: object_lib.CloseBrowser(browser)
def test_ContuctUs_pass(): try: ## 1. Go to URL object_lib = LIB() browser = object_lib.OpenBrowser() object_lib.PageLoad(browser) # 2. Click to Contact US sign_in_button object_home = Home(browser) contact_us_page = object_home.ContactUs(browser) ##browser.find_element(By.CSS_SELECTOR, "div#contact-link a").send_keys(Keys.ENTER) # 3. Fill all fields in Contact Us and click on Send button object_contactus = Contact_Us(browser) object_contactus.FillFeilds(browser) object_contactus.FillText(browser) object_contactus.ClickSend(browser) # 4. Validate that success message displayed assert "Your message has been successfully sent to our team." in browser.page_source # 5. Close browser print("Test run Passed!") # except Exception as e: # print(e) # print("Test run Failed") finally: object_lib.CloseBrowser(browser)