forked from smarthaut/Daemon_AutoFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_baidu.py
More file actions
40 lines (29 loc) · 1011 Bytes
/
Copy pathtest_baidu.py
File metadata and controls
40 lines (29 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/4/12 16:29
# @Author : huanghe
# @Site :
# @File : test_baidu.py
# @Software: PyCharm
import time
import unittest
from src.test.suit.baidu.search_page import SearchPage
from src.utils.browser import Browser
from src.utils.config import Config
from src.utils.file_reader import ExcelReader
from src.utils.config import DATA_PATH
excel = DATA_PATH
dates = ExcelReader(DATA_PATH).data
class SearchTest(unittest.TestCase):
def setUp(self):
self.driver =Browser().get_browserdriver()
self.search_page = SearchPage(self.driver)
self.search_page.url = Config().get('BaiDuURl')
self.search_page.visit()
def tearDown(self):
pass
#self.search_page.quit_browser()
def test_search(self):
self.search_page.set_value(element=self.search_page.rec_search_input(), text=dates[1]['search'])
self.search_page.click_search_btn()
self.search_page.get_windows_img()