Skip to content

Commit 85065f3

Browse files
committed
update
1 parent 86e2a8e commit 85065f3

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

TestRepository/test_lu.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import unittest
22
import sys
3+
4+
from selenium import webdriver
5+
36
from utils import LogUtil
47
from utils import common
58
from utils.TestCaseInfo import TestCaseInfo
69
from utils.TestReport import TestReport
710

8-
sys.path.append("..")
11+
# sys.path.append("..")
912
from page import page_lu as page
1013

1114

1215
class TestLu(unittest.TestCase):
1316
def setUp(self):
17+
self.driver = webdriver.Chrome()
1418
self.base_url = 'http://www.lu.com'
1519
self.testCaseInfo = TestCaseInfo(id='2', name=self.__str__(), owner='Oliver')
1620
self.testReport = TestReport()
@@ -21,11 +25,12 @@ def setUp(self):
2125

2226
# @unittest.skip("skip test_login")
2327
def test_login(self):
28+
driver = self.driver
2429
try:
25-
main_page = page.MainPage()
30+
main_page = page.MainPage(driver)
2631
main_page.open(self.base_url)
2732
main_page.goto_login_page()
28-
login_page = page.LoginPage()
33+
login_page = page.LoginPage(page)
2934
login_page.authenticate()
3035
main_page.verify_login()
3136
except Exception as e:

spider/sephora.xls

0 Bytes
Binary file not shown.

start_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def LoadAndRunTestCases(self):
3333

3434

3535
if __name__ == '__main__':
36+
# verbosity参数可以控制执行结果的输出,
37+
# 0是简单报告、1是一般报告、2是详细报告
3638
# runner = unittest.TextTestRunner(verbosity=2)
3739
# runner = ReportUtil.get_html_report
3840
# runner.run(create_suite())

0 commit comments

Comments
 (0)