Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
defnngj committed Jan 29, 2019
1 parent a42855d commit 68d1db4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
selenium==3.141.0
pytest==4.0.1
pytest==4.1.1
pytest-html==1.16.1
pytest-rerunfailures==5.0
click==6.7
Expand Down
32 changes: 16 additions & 16 deletions test_dir/test_baidu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_baidu_search_case(self, browser, base_url):
""" 百度搜索:pytest """
page = BaiduPage(browser)
page.get(base_url)
page.search_input.send_keys("pytest")
page.search_input = "pytest"
page.search_button.click()
sleep(2)
assert browser.title == "pytest_百度搜索"
Expand All @@ -30,26 +30,26 @@ def test_baidu_search(self, name, search_key, browser, base_url):
"""百度搜索 --参数化"""
page = BaiduPage(browser)
page.get(base_url)
page.search_input.send_keys(search_key)
page.search_input = search_key
page.search_button.click()
sleep(2)
assert browser.title == search_key+"_百度搜索"


# class TestSearchSettings:
# """百度搜索设置"""
#
# def test_baidu_search_setting(self, browser, base_url):
# """百度搜索设置"""
# page = BaiduPage(browser)
# page.get(base_url)
# page.settings.click()
# page.search_setting.click()
# sleep(2)
# page.save_setting.click()
# alert_text = browser.switch_to.alert.text
# browser.switch_to.alert.accept()
# assert alert_text == "已经记录下您的使用偏好"
class TestSearchSettings:
"""百度搜索设置"""

def test_baidu_search_setting(self, browser, base_url):
"""百度搜索设置"""
page = BaiduPage(browser)
page.get(base_url)
page.settings.click()
page.search_setting.click()
sleep(2)
page.save_setting.click()
alert_text = page.get_alert_text
browser.switch_to.alert.accept()
assert alert_text == "已经记录下您的使用偏好"


if __name__ == '__main__':
Expand Down

0 comments on commit 68d1db4

Please sign in to comment.