コード例 #1
0
 def test_login(self, test_setup):
     driver.get("https://opensource-demo.orangehrmlive.com/")
     time.sleep(10)
     login = LoginPage(driver)
     login.enter_username("Admin")
     login.enter_password("admin123")
     login.click_login()
     home = HomePage(driver)
     home.click_welcome()
     home.click_logout()
コード例 #2
0
    def test_logout(self):
        try:
            driver = self.driver

            homepage = HomePage(driver)  #objects created
            homepage.click_welcome()
            homepage.click_logout()
            x = driver.title
            assert x == "abc"

        except:
            print("There was an exception")
コード例 #3
0
    def test_login_valid(self):
        driver = self.driver
        driver.get("http://medechat-client.qa.butterfly.com.au/")

        login = LoginPage(driver)
        login.enter_email("*****@*****.**")
        login.enter_password("But3as2flying")
        login.click_login()
        time.sleep(2)

        homepage = HomePage(driver)
        homepage.click_logout()
コード例 #4
0
    def test_login(self):
        driver = self.driver
        driver.get(
            "https://opensource-demo.orangehrmlive.com/index.php/auth/login")

        login = LoginPage(driver)
        login.enter_username("Admin")
        login.enter_password("admin123")
        login.click_login()

        homepage = HomePage(driver)
        homepage.click_welcome()
        homepage.click_logout()
        """
コード例 #5
0
    def test_login_valid(self):
        driver = self.driver
        driver.get("https://apply.tesco-careers.com/members/index.php")

        login = LoginPage(driver)
        login.enter_username("*****@*****.**")
        login.enter_password("Reading123")
        login.click_login_button()

        home = HomePage(driver)
        home.click_welcome()
        home.click_logout()
        time.sleep(2)
        '''
コード例 #6
0
    def test_login_valid(self):
        driver = self.driver

        driver.get("https://opensource-demo.orangehrmlive.com/")

        login = LoginPage(driver)
        login.enter_username("Admin")
        login.enter_password("admin123")
        login.click_login()

        homepage = HomePage(driver)
        homepage.click_welcome()
        homepage.click_logout()

        #self.driver.find_element_by_id("txtUsername").send_keys("Admin")
        #self.driver.find_element_by_id("txtPassword").send_keys("admin123")
        #self.driver.find_element_by_id("btnLogin").click()
        ## self.driver.find_element_by_id("welcome").click()
        #self.driver.find_element_by_link_text("Logout").click()
        time.sleep(2)
コード例 #7
0
    def test_logout(self):

        try:
            driver = self.driver
            homepage = HomePage(driver)
            homepage.click_welcome()
            homepage.click_logout()
            x = driver.title
            assert x == "OrangeHRM"
        except AssertionError as error:
            print("it was an Assertion error")
            print(error)
            captureTime = moment.now().strftime("%H-%M-%S_%D-%M-%Y")
            testName = utils.whoami()
            screenshotName = testName + "_" + captureTime
            allure.attach(self.driver.get_screenshot_as_png(),
                          name=screenshotName,
                          attachment_type=allure.attachment_type.PNG)
            self.driver.get_screenshot_as_file(
                "/Users/yatin/Desktop/AutomationFramework_1/Screenshots/ " +
                screenshotName + ".png")
            # driver.save_screenshot("/Users/yatin/Desktop/AutomationFramework_1/Screenshots/"+screenshotName + ".png")

            raise
        except:
            print("unable to go to homepage")
            captureTime = moment.now().strftime("%H-%M-%S_%D-%M-%Y")
            testName = utils.whoami()
            screenshotName = testName + "_" + captureTime
            allure.attach(self.driver.get_screenshot_as_png(),
                          name=screenshotName,
                          attachment_type=allure.attachment_type.PNG)
            self.driver.get_screenshot_as_file(
                "/Users/yatin/Desktop/AutomationFramework_1/Screenshots/" +
                screenshotName + ".png")
            raise
        else:
            print("NO exceptions")
        finally:
            print("i am inside finally block")
コード例 #8
0
    def test_logout(self):
        global driver
        try:
            driver = self.driver
            homepage = HomePage(driver)
            homepage.click_logout()
            x = driver.title
            print(x)
            assert x == "Start Center"
            # Start Center

        except AssertionError as error:
            print("Assertion error occured")
            print(error)
            currTime = moment.now().strftime("%d-%m-%Y_%H-%M-%S")
            testName = utils.whoami()
            screenshotsName = testName + "_" + currTime
            allure.attach(self.driver.get_screenshot_as_png(),
                          name=screenshotsName,
                          attachment_type=allure.attachment_type.PNG)
            driver.get_screenshot_as_file(
                "C:/Users/Vinay/PycharmProjects/MODECRegressionMaximo/screenshots/"
                + screenshotsName + ".png")
            raise
        except:
            print("There was an exception")
            currTime = moment.now().strftime("%d-%m-%Y_%H-%M-%S")
            testName = utils.whoami()
            screenshotsName = testName + "_" + currTime
            allure.attach(self.driver.get_screenshot_as_png(),
                          name=screenshotsName,
                          attachment_type=allure.attachment_type.PNG)
            raise
        else:
            print("No Exceptions occurred")
        finally:
            print("Login successful")