def main(): driver = AppTestAppium.instantiate_driver() time.sleep(10) driver.get('https://www.headout.com/book/7563') time.sleep(5) homepage(driver).click_search_bar( ConfigReader.get_value('ENVIRONMENT', 'test_url')) select_date_svg(driver).select_date()
def test_logout(self): try: driver = self.driver hp = homepage(driver) hp.click_welcome() hp.click_logout() x = driver.title assert x == "OrangeHRM" except AssertionError as error: print("Assertion error occured") print(error) currenttime = moment.now().strftime("%d-%m-%y_%H-%M-%S") testname = util.whoami() screenshotname = testname + "_" + currenttime allure.attach(self.driver.get_screenshot_as_png(), name=screenshotname, attachment_type=allure.attachment_type.PNG) driver.get_screenshot_as_file( "D:/python_projects/Automation_framework/screenshots" + screenshotname + ".png") raise except: print("this was an exception") raise else: print("no exception occured") finally: print("I am inside finally block")
def test_logout(self, test_setup): try: home = homepage(driver) home.click_admin() home.click_logout() x = driver.title assert x == "OrangeHRM" except AssertionError as error: print("assertion error occureed") print(error) allure.attach(driver.get_screenshot_as_png(), name="screenshot", attachment_type=allure.attachment_type.PNG) raise except: print("this is exception") raise else: print("no exception occurred") finally: print("i am inside finally block")
def test_logout(self, test_setup): hp = homepage(driver) hp.click_welcome() hp.click_logout()
def test_logout(self): driver = self.driver logout = homepage(driver) logout.logouttab()