https://github.com/areal060781/mobile-taf-pytest
E2E UI automation project for a mobile application
https://github.com/areal060781/mobile-taf-pytest
appium e2e python3 selenium
Last synced: about 2 months ago
JSON representation
E2E UI automation project for a mobile application
- Host: GitHub
- URL: https://github.com/areal060781/mobile-taf-pytest
- Owner: areal060781
- Created: 2021-06-09T14:18:02.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-10T23:18:27.000Z (over 3 years ago)
- Last Synced: 2026-01-02T05:40:14.766Z (6 months ago)
- Topics: appium, e2e, python3, selenium
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# E2E Automation testing project
## Requirements
* Python 3.9
* Pipenv
* Selenium webdriver
* Appium
## Installation
Install dependencies and activate the virtual environment
From project root, run:
```sh
pipenv install --dev
pipenv shell
```
## Configuration
Adjust the valuies in data.py,
## Executing testcases
From project root, run:
```sh
pytest
pytest file.py::Class::test_case
pytest tests/test_name.py -s -v
```
### Executing testcases and publish results with ZS4J
From project root, run the following command to use ZS4J Report API, a .report.json file will be generated and a new text execution will be created automatically
[`POST /testexecutions`](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#operation/createTestExecution)
```sh
pytest --tm4j
```
### Executing tests and uploading results to Zephyr Scale manually
In order to instruct pytest to generate the JUnit XML results file, all that is required is to execute the tests with `--junitxml` parameter followed by the xml file name. Here is an example:
```
pytest --junitxml=output/junitxml_report.xml
```
The command line above will execute the pytest tests and generate the JUnit XML results file `output/junitxml_report.xml`. Then, this file containing the test results can be uploaded to Zephyr Scale using the following API endpoint: [`POST /automations/executions/junit`](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#operation/createJUnitExecutions).
The above mentioned API accepts either a single XML file as well as a .zip file containing multiple XML files. The POST request will create a new test cycle in Zephyr Scale containing the results and will respond with the key of the created test cycle.
Below, an example using curl of how to use the API endpoint for uploading one single file:
```
curl -H "Authorization: Bearer ${TOKEN}" -F "file=@TestSuites.xml;type=application/xml" https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey="JQA"&autoCreateTestCases=true
```
Note the query parameters on the URL. The projectKey specifies what project will be used to create the test cycle. The autoCreateTestCase will create a test case using the pytest test method name when no matching test case is found.
## Planned project structure
```
automation-project/
├── conf/ # Configuration files
├── output/ # Testing execution results
| ├── logs/
| ├── reports/
| └── screenshoots/
├── pageobjects/ # Page Object Model classes
├── tests/ # Test cases
| ├── fixtures/
| └── test_login.py
└── utils/ # Libraries for common use
├── pytest_zs4j_reporter/
└── zs4j_reporter_api/
```