Skip to content

SeldomQA/seldom-pytest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

seldom-pytest

seldom support pytest

installation

> pip install -U git+https://github.com/SeldomQA/seldom-pytest@main

or

> git clone https://github.com/SeldomQA/seldom-pytest.git
> cd seldom-pytest
> python setup.py install

Example

Use the page fixture to write a basic test.

# test_demo.py

def test_baidu(page):
    page.get("https://www.baidu.com")
    assert "百度一下" in page.get_title


def test_bing(page):
    page.get("https://www.bing.com")
    assert page.get_title == "Bing"

To run your tests, use pytest CLI.

# Run tests (chrome by default)
> pytest

# Run tests in a different browser (chrome, firefox, safari)
> pytest --browser chrome
> pytest --browser firefox
> pytest --browser safari

# specify base-url 
> pytest --base-url http://www.sample.com

# pytest-html report 
> pytest --html ./report.html

More usage

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages