Skip to content

wessonlan/pyse2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyse2 Web UI 自动化项目

特点:

  • 整个测试过程只需要打开/关闭一次浏览器,大大缩短测试时间。

  • 测试用例运行失败自动截图。

  • 测试用例运行失败可以重跑。

  • 测试数据参数化。

依赖库:

selenium: Web自动化测试库 https://pypi.python.org/pypi/selenium

pytest: 单元测试框架 https://pypi.python.org/pypi/pytest

pytest-html: 生成html测试报告 https://pypi.python.org/pypi/pytest-html

pytest-rerunfailures: 失败重跑 https://pypi.python.org/pypi/pytest-rerunfailures

安装:

pip install -r requirements.txt

demo:

@pytest.mark.parametrize(
    "name, searchkey",
    [("1", "Selenium"),
     ("2", "pytest文档"),
     ])
def test_baidu_search(name, searchkey, browser):
    bd = BaiduPage(browser)
    bd.open()
    bd.search_input(searchkey)
    bd.search_button()
    sleep(1)
    title = bd.search_title()
    assert title == searchkey+"_百度搜索"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors