Esempio n. 1
0
 def setUp(self):
     if self.needCreateDriver:
         self.driver = driverFactory().createDriver()
     else:
         self.driver = driverFactory().getCurrentDriver()
         if self.driver is None:
             self.driver = driverFactory().createDriver()
     self.beginTest()
Esempio n. 2
0
        screenshotBase64 = self.driver.screenshot_base64(
            self.filePath(), 'login')
        self.assertTrue(imgBase64 == screenshotBase64)

    def test_sso_btn(self):
        queryDict = queryFactory().getQuery().login_login_SSOBtn()
        sso_btn = self.driver.findView(queryDict)
        self.driver.clickOnView(sso_btn)
        self.driver.waitForSeconds(5)
        filename = self.filePath() + "/" + "sso.png"
        self.driver.takeScreenshotAsPNGFileByPath(filename)

        imgBase64 = self.driver.page_base64(self.filePath(), 'sso')
        screenshotBase64 = self.driver.screenshot_base64(
            self.filePath(), 'sso')

        query_dict = queryFactory().getQuery().login_sso_backBtn()
        back_btn = self.driver.findView(query_dict)
        self.driver.clickOnView(back_btn)

        self.assertTrue(imgBase64 == screenshotBase64)

    def test_last_test(self):
        pass


suite = testLoader().loadAllTestsFromClass(False, None, welcome)
suite = testLoader().loadAllTestsFromClass(False, suite, login)
unittest.TextTestRunner(verbosity=2).run(suite)
driverFactory().stopDriver()
Esempio n. 3
0
 def tearDown(self):
     self.endTest()
     if self.needCreateDriver:
         driverFactory().stopDriver()