示例#1
0
    def test_login(self):
        """test login with data driver"""
        if self.username is None:
            self.username = ''
        if self.password is None:
            self.password = ''

        logger.start_testcase('Testing %s' % self.cell['testcase ID'].value)
        loginPage.enter_username(self.username)
        logger.info('Enter useranme: "%s"' % self.username)

        loginPage.enter_password(self.password)
        logger.info('Enter password: "******"' % self.password)

        mepage = loginPage.login()
        logger.info('click the Login button')

        time.sleep(0.5)
        wd.get_screenshot_as_file('test_result/' + self.cell['testcase ID'].value + '.png')

        if mepage.is_load:
            logger.info('%s %s' % (self.cell['testcase ID'].value, '(success to login)'))
            wd.get_screenshot_as_file('test_result/' + self.cell['testcase ID'].value + '_success.png')
            self.wb.write_result(self.cell['result'], 'TRUE')
        else:
            logger.info('%s %s' % (self.cell['testcase ID'].value, '(fail to login)'))
            self.wb.write_result(self.cell['result'], 'FALSE')

        assert_true(self.wb.compare_expected(self.cell['expected'], self.cell['result'], self.cell['PASS/FAIL']))
示例#2
0
def close_and_save():
    """save the result to excel and quit the app"""
    logger.after_test('Finish YY Fin loging test')
    wb.save('test_result/login_test_result.xlsx')
    logger.info('Save the testing results to login_test_result.xlsx')
    wd.quit()
    logger.info('Close testing APP')
    logger.end_testcase()
示例#3
0
def setup():
    """open login page"""
    global wd, loginPage
    wd = MobileDriver.get_driver()
    logger.before_test('Init YY Fin login test')
    logger.info('YY Fin App launched')
    loginPage = LoginPage(wd)
    loginPage.open()
    logger.info('Open the login page')
    assert_true(loginPage.is_load)
示例#4
0
 def test_search(self):
     u"""测试Bing搜索功能"""
     logger.start_testcase('Bing test case')
     logger.info('test bing search')
     logger.end_testcase()
     self.assertEqual(True, True)
示例#5
0
 def test_search(self):
     u"""测试Google搜索功能"""
     logger.start_testcase('google test case')
     logger.info('test google search')
     logger.end_testcase()
     self.assertEqual(True, True)
示例#6
0
 def test_search(self):
     u"""测试百度搜索功能"""
     logger.start_testcase('Baidu test case')
     logger.info('test baidu search')
     logger.end_testcase()
     self.assertEqual(True, True)