Test API (https://petstore.swagger.io/v2/pet)
- IMPORTANT: Give/Share access to work directory to Docker
- Run
sh run_with_docker.sh
if on Linux/MacOS - On Windows, use GitBash to run the above code.
- Python 3.7 (3.4+)
- Install dependencies from requirements.txt:
pip install -r requirements.txt
-
All Tests with junit xml
python runner.py
-
All Tests using unittest test detection
python -m unittest
-
Specific TestFile/TestClass/TestMethod
python -m unittest TestFile.TestClass.TestMethod
-
Examples:
python -m unittest tests.testPutEditPet
Runs all Test Classes and Test Methods insidetestPutEditPet
file.python -m unittest tests.testPutEditPet.TestPutEditPet
Runs all Test Methods insideTestPutEditPet
Class.python -m unittest tests.testPutEditPet.TestPutEditPet.test_PUT_04_EditPetWithInvalidJSON
Runs the specifictest_PUT_04_EditPetWithInvalidJSON
Test
-
- Test Reports will be generated in
test-reports
folder. - Test Script Log will be generated as
script.log