Skip to content
Open
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
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,24 @@ Features/Lookuptable/settings.cfg
Features/Lookuptable/report.html
Features/Lookuptable/testCases/report.html

#Ignoring compliled files of DataDictionary
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 Expand Up @@ -277,6 +295,8 @@ LocustScripts/update-scripts/project-config/co-carecoordination-perf/mobile_work
/POCs/PercyWebApps/settings.cfg
/POCs/VisualComparison/settings.cfg



USH_Apps/WeeklyBHACleanup/testCases/report.html
USH_Apps/WeeklyBHACleanup/report.html
USH_Apps/WeeklyBHACleanup/report_*
Expand Down
57 changes: 57 additions & 0 deletions Features/DataDictionary/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## Commcare Data Dictionary Test Script

These tests ensure that the Data Dictionary (https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143944977/Data+Dictionary)features work as expected and that there are no regressions
The automated tests comprises of the Data dictionary functionality.](https://docs.google.com/spreadsheets/d/1Ixw1PC9PVpqYOlP7aq9a86pC0wZaJVgGNVL_4h9KLbM/edit#gid=195915568)
## 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/DataDictionary/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 [DataDictionary](https://github.com/dimagi/dimagi-qa/actions/lookuptable.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.
17 changes: 17 additions & 0 deletions Features/DataDictionary/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Stores information about all the libraries, modules, and packages that are used in this project.


pandas>=1.2.2
pytest>=6.2.5
pytest-html>=3.1.1
selenium == 4.11.2
openpyxl>=3.0.6
pytest-rerunfailures>=10.2
pytest-xdist>=2.4.0
pytest-xdist[psutil]
pyotp >=2.6.0
pytest-order
beautifulsoup4
pytest-metadata
matplotlib
py
12 changes: 12 additions & 0 deletions Features/DataDictionary/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 =

14 changes: 14 additions & 0 deletions Features/DataDictionary/settings.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[default]
# This is the environment url of commcare
url = https://staging.commcarehq.org/
# Login username of the webuser
login_username = [email protected]
# Login password of the webuser
login_password = pass@123
# 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