Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/find-data-by-id-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
# Extract variables from the api_test_counts.txt file
while IFS= read -r line; do
echo "::set-output name=${line%=*}::${line#*=}"
done < find_data_by_id_test_counts_${{ matrix.environment }}.txt
done < find_data_by_id_tests_counts_${{ matrix.environment }}.txt

- name: Archive test results
id: artifact-upload-step
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,19 @@ Features/DataDictionary/testCases/report.html
Features/DataDictionary/testCases/slack_charts
Features/DataDictionary/test_cases/report.html


#Ignoring compliled files of Powerbi_integration_exports
Features/Powerbi_integration_exports/settings.cfg
Features/Powerbi_integration_exports/report.html
Features/Powerbi_integration_exports/test_cases/report.html
Features/Powerbi_integration_exports/testCases/slack_charts

#Ignoring compliled files of Find by Data id
Features/FindDataById/testCases/test_cases/report.html
Features/FindDataById/testCases/testCases/slack_charts
Features/FindDataById/test_cases/report.html
Features/FindDataById/settings.cfg

#Ignoring compliled files of QA_Requests
QA_Requests/BHAStressTest/settings.cfg
QA_Requests/BHAStressTest/user_inputs/*.csv
Expand Down
57 changes: 57 additions & 0 deletions Features/FindDataById/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## Commcare Find Data by ID Test Script

These tests ensure that the [Find Data by ID] (https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143955380/Find+Data+by+ID)features work as expected and that there are no regressions
The automated tests comprises of [these Find Data by ID] (https://docs.google.com/spreadsheets/d/1w25sl855-Tc-MBlQWKR8XZRmgE2TCtW8VH4M24RBvKw/edit?gid=594000179#gid=594000179)
## Executing Scripts

### <ins> On Local Machine </ins>

#### Setting up test environment

```sh

# create and activate a virtualenv using your preferred method. Example:
python -m venv venv
source venv/bin/activate


# install requirements
pip install -r requires.txt

```

[More on setting up virtual environments](https://confluence.dimagi.com/display/GTD/QA+and+Python+Virtual+Environments)


#### Running Tests


- Copy `settings-sample.cfg` to `settings.cfg` and populate `settings.cfg` for
the environment you want to test.
- Run tests using pytest command like:

```sh

# To execute all the test cases
pytest -v --rootdir= Features/FindDataById/testCases

```
- You could also pass the following arguments
- ` -n 3 --dist=loadfile` - This will run the tests parallelly in 3 instances. The number of reruns is configurable.
- ` --reruns 1` - This will re-run the tests once in case of failures.The number of reruns is configurable too.

### <ins> Trigger Manually on Gitaction </ins>

<img align="right" width="400" src="https://user-images.githubusercontent.com/67914792/168757107-3ce9bb6a-57b5-4c15-b20d-e7883bf9ed65.PNG" alt="clone this repository" />

To manually trigger the script,
- Go to [FindById action](https://github.com/dimagi/dimagi-qa/actions/find-data-by-id-tests.yml)
- Run workflow
- Use workflow from ```master```
- Run!

If you are a part of the QA team, you'll receive emails for the result of the run after it's complete.

<img align="right" width="400" src="https://user-images.githubusercontent.com/67914792/168756705-88e4b330-b05a-4df2-a60c-7d45e8a2d002.PNG" alt="clone this repository" />

Besides, you should be able to find the zipped results in the **Artifacts** section, of the corresponding run (after it's complete).
Empty file.
22 changes: 22 additions & 0 deletions Features/FindDataById/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Stores information about all the libraries, modules, and packages that are used in this project.


flake8>=3.8.4
pandas>=1.2.2
pytest
py>=1.10.0
pytest-html>=3.1.1
pytest-json-report
selenium == 4.11.0
openpyxl
matplotlib >= 3.3.4
pytest-rerunfailures
pytest-xdist
pytest-xdist[psutil]
pytest-order
requests
imap-tools
beautifulsoup4
html5lib
pytest-metadata
pyotp >=2.6.0
12 changes: 12 additions & 0 deletions Features/FindDataById/settings-sample.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[default]
# This is the environment url of commcare
url = https://www.commcarehq.org/
# Login username of the webuser
login_username =
# Login password of the webuser
login_password =
# This is a preconfigured authentication key used for 2FA tests on staging - If 2FA enabled on staging.
staging_auth_key =
# This is a preconfigured authentication key used for 2FA tests on prod
prod_auth_key =

Empty file.
Loading
Loading