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']))
def test_search(self): u"""测试Bing搜索功能""" logger.start_testcase('Bing test case') logger.info('test bing search') logger.end_testcase() self.assertEqual(True, True)
def test_search(self): u"""测试Google搜索功能""" logger.start_testcase('google test case') logger.info('test google search') logger.end_testcase() self.assertEqual(True, True)
def test_search(self): u"""测试百度搜索功能""" logger.start_testcase('Baidu test case') logger.info('test baidu search') logger.end_testcase() self.assertEqual(True, True)