PyTest Basics
import pytest
#Rules
# Start with test or End with Test
#Run the pytests from terminal with py.test command
#To run the particular file 'py.Test <PackageName>/<Filename.py>'
#To run the particular test from mutiple file 'py.test -k login -v'
#To run the test specific to particular marker '@pyTest.mark.login'....run 'py.Test -m login' from terminal
'''
To run the test specific to particular marker '@pyTest.mark.login' from particular package ....run
'py.Test <PackageName>/<Filename.py> -m login' from terminal
'''
#To run the test parallely use 'py.test -n 5(no. of thread)' from terminal line
#To run the test parallely from particular file use 'py.test <packageName>/<Filename.py> -n 5(no. of thread)' from terminal line
#Tu run the test without html logs 'pytest -v -s test_google_test.py
# To install the html package for pytest use 'pip install pytest-html'
#To generate the html logs for a test 'pytest test_google_test.py -v -s --html=google_test_report.html'
Comments
Post a Comment