Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
03f3adc
Minor refactoring and changed the test patterns to for better readabi…
ayydevara Apr 14, 2023
06b84fd
add test cases for general
Apr 14, 2023
510b94e
add test cases for gtfsflex
Apr 14, 2023
346ddbe
add test cases for gtfs pathways
Apr 14, 2023
9123edc
cleanup
Apr 14, 2023
26cd3b0
update test case mentioning recordId
Apr 14, 2023
89ef74b
change to typed versions.data.versions
Apr 14, 2023
d0a3069
Merge pull request #3 from TaskarCenterAtUW/test-harness
iAKM Apr 14, 2023
074bc69
flex payload
priya-badmanji Apr 14, 2023
c384ac1
flex + Pathways upload
priya-badmanji Apr 14, 2023
342f437
removing pathways upload as it is conflicting
priya-badmanji Apr 14, 2023
5d7a392
removing pathways upload as it is conflicting
priya-badmanji Apr 14, 2023
2600c6c
added back
priya-badmanji Apr 14, 2023
da388f6
formats
priya-badmanji Apr 14, 2023
1fbb66a
Merge pull request #5 from TaskarCenterAtUW/feature-flex-changes
susrisha Apr 14, 2023
c39fae5
test case for GTFS pathways file upload
Apr 14, 2023
e1d4e18
Merge pull request #4 from TaskarCenterAtUW/feature-pathway-testing
susrisha Apr 15, 2023
717021f
Adding instructions and cleanup existing test files (#6)
ayydevara Apr 15, 2023
59698e8
Update package.json
susrisha Apr 17, 2023
c195b88
Merge pull request #9 from TaskarCenterAtUW/featre-multi-config
priya-badmanji Apr 17, 2023
7a7f6ff
Update README.md
susrisha Apr 18, 2023
f60ee30
Added Seeder to testing
Apr 19, 2023
014ef4f
Fixed review comments
Apr 19, 2023
9993d3c
Removed testing code
Apr 19, 2023
b6dd059
Added 2 more functions to activate or de-activate organisation
Apr 19, 2023
81af3b8
Merge pull request #10 from TaskarCenterAtUW/feature-seeder
sujata-m Apr 19, 2023
28a7bdd
Merge pull request #11 from TaskarCenterAtUW/feature-seeder-requirements
sujata-m Apr 20, 2023
b861dce
Create TDEI-metadata-validation.postman_collection.json
susrisha Apr 28, 2023
05b7a1f
Merge pull request #13 from TaskarCenterAtUW/feature-regression-postman
susrisha Apr 29, 2023
5536535
General tests refactored
susrisha May 3, 2023
4eb86b1
Merge pull request #14 from TaskarCenterAtUW/feature-refactor-test
susrisha May 4, 2023
604ef1c
Update gtfsflex.test.ts
susrisha May 4, 2023
3278f44
Upload code partial
susrisha May 4, 2023
160f4c6
added post cases
susrisha May 4, 2023
0a00352
Update gtfsflex.test.ts
susrisha May 4, 2023
45bc419
Update gtfsflex.test.ts
susrisha May 4, 2023
1f74f39
Merge pull request #15 from TaskarCenterAtUW/feature-flex-refactor
susrisha May 5, 2023
d24f318
Update gtfspathways.test.ts
susrisha May 5, 2023
fbeb617
Update gtfsflex.test.ts
susrisha May 5, 2023
66a5573
Update gtfspathways.test.ts
susrisha May 5, 2023
eec122a
Update osw.test.ts
susrisha May 5, 2023
dbe420d
Update osw.test.ts
susrisha May 5, 2023
e30f923
Update gtfspathways.test.ts
susrisha May 5, 2023
8b99065
Merge pull request #16 from TaskarCenterAtUW/feature-pathways-tests
susrisha May 5, 2023
67e0e3e
Merge pull request #17 from TaskarCenterAtUW/feature-osw-tests
susrisha May 5, 2023
d238d9e
Testing collection updated
susrisha May 7, 2023
23e2514
Update how-to-test.md
susrisha May 7, 2023
7ccfe48
Update how-to-test.md
susrisha May 7, 2023
0dea21d
Merge pull request #18 from TaskarCenterAtUW/feature-collection-update
rdevalap May 7, 2023
bd2aee9
Update package-lock.json
susrisha May 11, 2023
661c35d
Added download cases
susrisha May 11, 2023
f9c6130
Merge pull request #19 from TaskarCenterAtUW/feature-download-cases
susrisha May 11, 2023
35ab4e0
contract validation for general tests
May 26, 2023
f91b02a
contract validation for gtfsflex tests
May 26, 2023
09870b9
contract validation for gtfspathways tests
May 26, 2023
9e9a13a
contract validation for osw tests
May 26, 2023
dbc9ab4
remove unnecessary assertion
May 26, 2023
6701079
replace polygon assertion of empty object with null or GeoJsonObject
May 29, 2023
16c083e
replace static with variables for better maintenance
May 29, 2023
54ce080
Merge pull request #21 from TaskarCenterAtUW/contract-validation
MashB May 29, 2023
16388d2
refactor polygon assertion to avoid test cases failing in null situat…
May 31, 2023
8e803c8
set global timeout of 15secs
May 31, 2023
6170092
Merge pull request #22 from TaskarCenterAtUW/expect-polygon
MashB Jun 1, 2023
b2c189c
temp folder changes
MashB Sep 25, 2023
5bd8254
Merge pull request #24 from TaskarCenterAtUW/feature-krakenD-changes
MashB Sep 25, 2023
8e3927a
updated faker data
MashB Sep 26, 2023
cecddad
Merge pull request #25 from TaskarCenterAtUW/feature-krakenD-changes
MashB Sep 26, 2023
bfe3811
Auth changes refactoring
MashB Nov 10, 2023
ae59ce0
Merge pull request #26 from TaskarCenterAtUW/feature-krakenD-changes
MashB Nov 10, 2023
4028a94
add environment
Dec 12, 2023
7636e5b
add dotenv package
Dec 12, 2023
d4ddef7
replace config with environment
Dec 12, 2023
7196b4c
add github workflow
Dec 12, 2023
1f71a2c
replace test-harness.json with .env file
rdevalap Dec 14, 2023
685197d
Adjusted workflow to write .env file
rdevalap Dec 14, 2023
23f4a6b
Adjusted Line indentation
rdevalap Dec 14, 2023
ae6ab5e
Added code to send email
rdevalap Dec 15, 2023
f515cfb
Added code to send email
rdevalap Dec 15, 2023
2f398d2
Added code to send email
rdevalap Dec 15, 2023
e7a35c5
Added code to send email
rdevalap Dec 15, 2023
f0f76fb
Added code to send email
rdevalap Dec 15, 2023
8079342
Trying another action provider
rdevalap Dec 15, 2023
d5a95b1
Trying another action provider
rdevalap Dec 15, 2023
90e8244
Trying another action provider
rdevalap Dec 15, 2023
8d21fe6
Trying another action provider
rdevalap Dec 15, 2023
1dd1ea6
Added attachment
rdevalap Dec 15, 2023
2d1928e
Added repository dispatch event
rdevalap Dec 15, 2023
ff3bf16
GitHub workflow (#28)
iAKM Dec 15, 2023
28dfdca
Main to branch (#29)
rdevalap Dec 18, 2023
aa922cb
Adjusted Email body
rdevalap Dec 18, 2023
259379a
Merge remote-tracking branch 'origin/feature-github-workflow' into fe…
rdevalap Dec 18, 2023
722543e
Merge branch 'dev' into feature-github-workflow
rdevalap Dec 18, 2023
974b897
Merge pull request #30 from TaskarCenterAtUW/feature-github-workflow
iAKM Dec 18, 2023
1a52c22
Added custom client
susrisha Dec 29, 2023
9990222
update OswDownload object for listOswFiles
Dec 29, 2023
6cf30bc
remove unused code
Dec 29, 2023
1e2953f
update OswDownload object params
Dec 29, 2023
59812f8
replace dataset_area datatype to expect an object. To be later replac…
Dec 29, 2023
a22c649
number to string page_size conversion
Jan 2, 2024
04ad547
change commit id to include missing files in dist
Jan 3, 2024
1f554d6
add tests for osw
Jan 3, 2024
45aa18e
remove unused service
Jan 3, 2024
1db4cde
comment upload service to refactor axios later
Jan 3, 2024
b22608e
remove await to avoid error
Jan 3, 2024
8dec486
- reorder test suites
Jan 4, 2024
442fcbe
comment unsued variable
Jan 4, 2024
bdeec20
update commit id
Jan 6, 2024
c655b96
rearrange test cases to match swagger order
Jan 6, 2024
fb2d422
Failed cases fix
susrisha Jan 16, 2024
2f9fb79
Merge pull request #31 from TaskarCenterAtUW/feature-osw-update-payload
susrisha Jan 16, 2024
7bc7642
updated test cases
susrisha Jan 16, 2024
d8795c9
Merge pull request #33 from TaskarCenterAtUW/feature-axios-upgrade-test
susrisha Jan 16, 2024
f794c47
enhancement
MashB Jan 18, 2024
928b4ea
download test case
MashB Jan 18, 2024
ef761a6
metadat test
MashB Jan 18, 2024
27039c7
added run details
MashB Jan 18, 2024
2ce5771
test fix
MashB Jan 18, 2024
900276f
Merge pull request #34 from TaskarCenterAtUW/feature-invalidate-meta-…
susrisha Jan 19, 2024
0ff35c1
api enhancement for metadata filters
MashB Jan 25, 2024
fea84a6
workflow fix
MashB Jan 25, 2024
cb7a996
test improvement
MashB Jan 27, 2024
abb6f02
workflow fix
MashB Jan 27, 2024
2ea96d5
html generation
MashB Jan 27, 2024
4de3fb7
increased timeout
MashB Jan 27, 2024
e57212f
syntax
MashB Jan 27, 2024
81edfc6
message improvement
MashB Feb 2, 2024
6da3e32
Merge pull request #35 from TaskarCenterAtUW/feature-invalidate-meta-…
MashB Feb 2, 2024
930ad67
backend service api tester coverage
MashB Mar 6, 2024
c1e3bc6
record changes
MashB Mar 6, 2024
10fd0b6
Merge pull request #36 from TaskarCenterAtUW/feature-backend-features
MashB Mar 7, 2024
f9efce4
API tester for DB unification
MashB Mar 26, 2024
7e32491
node
MashB Mar 26, 2024
d41cee6
907,908,909
MashB Mar 29, 2024
5d74a4e
retry
MashB Mar 29, 2024
8bb508f
test case added
MashB Apr 2, 2024
9cf34ca
Merge pull request #37 from TaskarCenterAtUW/feature-unify-db
MashB Apr 2, 2024
1be9e7f
Description update and library
MashB Apr 17, 2024
d659b14
workflow zip
MashB Apr 18, 2024
0c23ad2
second approach as html
MashB Apr 18, 2024
741badc
scrapping reference js files
MashB Apr 18, 2024
68a8906
dependent file adding
MashB Apr 18, 2024
7d0c52a
Merge pull request #38 from TaskarCenterAtUW/feature-unify-db
susrisha May 3, 2024
9de1f50
test personas
MashB May 27, 2024
24a4138
Delete seed.data.json
MashB May 27, 2024
e1b06f0
ignore seed file
MashB May 27, 2024
d2a474d
api tester enhancement
MashB May 30, 2024
16715b2
config update
MashB May 30, 2024
1b4f19a
file read issue fix
MashB May 30, 2024
4367605
console remove , bug fix
MashB May 30, 2024
fbdb048
Merge pull request #39 from TaskarCenterAtUW/feature-860
MashB May 31, 2024
e60cefc
api tester clone dataset
MashB Jun 9, 2024
adda765
Merge pull request #40 from TaskarCenterAtUW/feature-clone-dataset
MashB Jun 10, 2024
35c73a7
Updated package and job test details
susrisha Jun 27, 2024
c8f251e
Added changes for flex and pathways
susrisha Jun 27, 2024
3578737
Merge pull request #41 from TaskarCenterAtUW/feature-990
susrisha Jun 27, 2024
4a95b9d
Added checks for quality metric
susrisha Jun 27, 2024
a5c67de
added changes to the source
susrisha Jun 27, 2024
9391884
Update osw.test.ts
susrisha Jun 27, 2024
e50b219
redid the dataset id
susrisha Jun 27, 2024
c9aace8
Merge pull request #42 from TaskarCenterAtUW/feature-993
MashB Jun 28, 2024
fb76053
Added job and schedule in workflow to store test output in azure
pramodbontha Jul 11, 2024
a12e040
Removed tee and added always if condition to some jobs
pramodbontha Jul 11, 2024
a47cd0f
Fixed issue with log file creation
pramodbontha Jul 11, 2024
269d707
fix for log file creation
pramodbontha Jul 11, 2024
0b2cc64
Issue with Time stamp and directory creation resolved
pramodbontha Jul 11, 2024
f73e0b7
Debugging steps for timestamp method
pramodbontha Jul 11, 2024
232a886
fixed npm run test command
pramodbontha Jul 11, 2024
d0081ca
Added detailed debugging for test running
pramodbontha Jul 11, 2024
691c47e
Fixed code to save logs even if error
pramodbontha Jul 11, 2024
7a0c6a3
Added code to store test report html file
pramodbontha Jul 12, 2024
5f40cee
Enabled condition always for scrap js step
pramodbontha Jul 12, 2024
43e2a5e
Added timestamp to test report html while uploading to container
pramodbontha Jul 12, 2024
c8f8b1d
Removed debug step
pramodbontha Jul 13, 2024
c47d3b1
Merge pull request #44 from TaskarCenterAtUW/1021-periodic-execution-…
MashB Jul 26, 2024
2ce3b89
spatial join test coverage
MashB Jun 28, 2024
0b97a43
Api tester enhancement
MashB Jul 25, 2024
a1c7a49
package update
MashB Jul 25, 2024
53d40a2
max thread set to one
MashB Jul 26, 2024
c1c9d9f
sleep timeout
MashB Jul 26, 2024
9965d19
extend the timeout
MashB Jul 26, 2024
2d3ae27
--runInBand for sequesntial run
MashB Jul 29, 2024
0ef5299
Merge pull request #43 from TaskarCenterAtUW/feature-spatial-join
MashB Aug 14, 2024
f4f80af
improvement
MashB Aug 30, 2024
08d55b7
osw test improvements
MashB Aug 31, 2024
1bfd6d8
Report Improvements
MashB Sep 30, 2024
ff39ee6
Jmeter plan
MashB Sep 30, 2024
3b6dffd
Readme file
MashB Sep 30, 2024
1afc813
Merge pull request #45 from TaskarCenterAtUW/feature-report-improveme…
susrisha Oct 3, 2024
1fc0716
Update seeder.ts
susrisha Oct 7, 2024
a90ae35
added inputs to the file
susrisha Oct 7, 2024
e6af6b0
Merge pull request #47 from TaskarCenterAtUW/bugfix-1311
MashB Oct 24, 2024
347bf9c
API review feedback coverage
MashB Oct 30, 2024
1dea590
union and dataset api changes
MashB Oct 30, 2024
e2585b6
api review changes
MashB Nov 2, 2024
6c315bf
api review changes
MashB Nov 2, 2024
03ecd53
Union changes
MashB Nov 6, 2024
d450885
Merge pull request #48 from TaskarCenterAtUW/feature-api-review-changes
MashB Nov 7, 2024
17b371c
Fixed following issues -
sujata-m Dec 18, 2024
82824ea
Fixed pipeline
sujata-m Dec 18, 2024
3812d60
Fixed test cases
sujata-m Dec 18, 2024
aa41138
Fixed pipeline
sujata-m Dec 18, 2024
059035d
Updated pipeline
sujata-m Dec 18, 2024
8733a58
Fixed pipeline
sujata-m Dec 18, 2024
b18ffeb
Added new unit test cases
sujata-m Dec 19, 2024
5c027e5
Fixed unit test cases
sujata-m Dec 20, 2024
8067b8e
Fixed unit test cases
sujata-m Dec 20, 2024
2cecbb6
Fixed unit test cases
sujata-m Dec 20, 2024
287ec66
uncomment to see if pipeline passed
sujata-m Dec 20, 2024
4809979
Merge pull request #49 from TaskarCenterAtUW/feature-1298
sujata-m Dec 23, 2024
e01667e
## DevBoard Task
sujata-m Feb 24, 2025
da401c9
Added additional files
sujata-m Feb 24, 2025
55d0142
Updated unit test cases
sujata-m Feb 26, 2025
d4ed0a2
Updated unit test cases
sujata-m Feb 26, 2025
6423299
Updated timeout
sujata-m Feb 26, 2025
3e2081b
Merge pull request #50 from TaskarCenterAtUW/feature-added-additional…
sujata-m Feb 26, 2025
776f43b
Trying to fix the pipeline
sujata-m Mar 3, 2025
a1a75d4
Updated pipeline
sujata-m Mar 4, 2025
b048a8d
Updated pipeline
sujata-m Mar 4, 2025
4511ea3
Updated pipeline
sujata-m Mar 4, 2025
037b482
Merge pull request #52 from TaskarCenterAtUW/feature-fixed-pipeline
sujata-m Mar 4, 2025
1209a56
Fixed timestamp issue
sujata-m Mar 4, 2025
87d0f53
1609 changes
MashB Mar 18, 2025
bb445f8
Merge pull request #54 from TaskarCenterAtUW/feature-1609
MashB Mar 19, 2025
6515978
readme updates
MashB Mar 20, 2025
a879e6e
Merge pull request #55 from TaskarCenterAtUW/feature-1609
MashB Mar 20, 2025
510181d
pathways fix dataset
MashB Mar 21, 2025
43b4551
Merge pull request #56 from TaskarCenterAtUW/feature-1609
MashB Jun 16, 2025
759c454
Merge pull request #53 from TaskarCenterAtUW/feature-fix-timestamp
MashB Jun 16, 2025
c13ba5d
Task 2027
MashB Jun 16, 2025
a8583e1
Merge pull request #57 from TaskarCenterAtUW/feature-2027
MashB Jun 16, 2025
92a1d77
fixed 404 status
MashB Nov 11, 2025
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
112 changes: 112 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: run_api_tests

on:
push:
branches-ignore:
- "**"
# Remove the line above to run when pushing to master
pull_request:
branches: [ main, dev ]
repository_dispatch:
types: [ run_api_tests ]
schedule:
- cron: "0 0 * * 0" # Runs every day at midnight (UTC)

jobs:
UnitTest:
name: Unit Test Cases
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Install npm dependencies
run: npm install

- name: Determine output folder
id: set_output_folder
run: |
# For pull_request events, use the base branch; otherwise use the current branch reference
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
branch_name=$GITHUB_BASE_REF
else
branch_name=$GITHUB_REF_NAME
fi

if [[ $branch_name == "main" ]]; then
echo "output_folder=stage" >> $GITHUB_ENV
elif [[ $branch_name == "dev" ]]; then
echo "output_folder=dev" >> $GITHUB_ENV
else
echo "Unknown branch: $branch_name"
exit 1
fi

- name: Create env file
run: |
# For pull requests, choose the env file based on the base branch
if [ "${{ github.event_name }}" = "pull_request" ]; then
if [ "${{ github.event.pull_request.base.ref }}" = "main" ]; then
echo "${{ secrets.STAGE_ENV_FILE }}" > .env
else
echo "${{ secrets.ENV_FILE }}" > .env
fi
else
# For non-PR events (push, schedule, repository_dispatch), use the stage env file
echo "${{ secrets.STAGE_ENV_FILE }}" > .env
fi

- name: Set TIMESTAMP
run: |
# Save the timestamp as an environment variable for reuse in subsequent steps.
echo "TIMESTAMP=$(date '+%d.%m.%Y_%H.%M.%S')" >> $GITHUB_ENV

- name: Run tests with coverage
run: |
# Use the TIMESTAMP variable from the environment.
mkdir -p test_results
log_file="test_results/${TIMESTAMP}_report.log"
echo -e "\nTest Cases Report\n" >> "$log_file"
# Run the tests and append output to the log file
npm run test >> "$log_file" 2>&1
# Copy and rename the generated test report with the timestamp
cp test-report.html test_results/test-report_${TIMESTAMP}.html

- name: Set Date Folder
run: |
DATE_FOLDER=$(date '+%d.%m.%Y')
echo "date_folder=${DATE_FOLDER}" >> $GITHUB_ENV

- name: Upload report to Azure
uses: LanceMcCarthy/Action-AzureBlobUpload@v2
with:
source_folder: 'test_results'
destination_folder: '${{ env.date_folder }}'
connection_string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
container_name: 'api-tester'
clean_destination_folder: false
delete_if_exists: false

- name: send email notification
if: always()
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{ secrets.EMAIL_USER }}
password: ${{ secrets.EMAIL_PASSWORD }}
subject: ${{ job.status }} - API Testing Report | ${{ github.event_name == 'pull_request' && format('{0}-{1}', 'PR', github.event.pull_request.title) || 'Triggered via Schema Changed' }}
to: [email protected]
cc: [email protected]
bcc: [email protected], [email protected]
from: Workflow Notification
attachments: test-report.html
html_body: |
<h2>API Testing Report</h2>
<p>Workflow: <a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">${{ github.workflow }}</a></p>
<p>Repository: <a href="${{ github.server_url }}/${{ github.repository }}">${{ github.repository }}</a></p>
${{ github.event_name == 'pull_request' && format('<p>Pull Request: <a href="{0}">{1}</a></p>', github.event.pull_request.html_url, github.event.pull_request.title) || '<br>' }}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ typings/
# Nuxt.js build / generate output
.nuxt
dist
build

# Gatsby files
.cache/
Expand All @@ -104,4 +105,9 @@ dist
.tern-port
.DS_Store
src/test-harness.json
test-report.html
test-report.html
wallaby.js

jest-html-reporters-attach
seed.data.json
.idea/
149 changes: 144 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,126 @@
# TDEI-api-tester
API tester for the client-API received from swagger

This service repository contains automated test cases for TDEI API endpoints to verify their functionality and generate a comprehensive test report. The API specifications are received from Swagger (OpenAPI), ensuring tests are aligned with the latest API definition and remain reliable, functional, and compliant with their specifications

1. Automated Testing of API Endpoints
- Executes test cases for all TDEI API endpoints to validate expected responses.
2. Test Case Management
- Covers positive, negative, and edge cases to ensure robustness.
3. Report Generation
- Generates a detailed test report after execution.
- Includes test results for all endpoints, status codes, response validation, and errors.
4. Integration with CI/CD
- Can be integrated into GitHub Workflows or any CI/CD pipeline.

## System requirements
| Software | Version|
|----|---|
| NodeJS | 18.16.0|
| Typescript | 4.8.2 |

## Environment variables

Application configuration is read from .env file. Below are the list of environemnt variables service is dependent on. Description of environment variable is presented in below table

|Name| Description |
|--|--|
| PROVIDER | Provider for cloud service or local (optional)|
|SEED_BASE_URL | User management portal api url |
|SEED_ADMIN_USER | admin user name|
|SEED_ADMIN_PASSWORD |admin password|
|SYSTEM_BASE_URL | TDEI API url|
|ENVIRONMENT | Environement to run api tester dev, stage, prod|


## API Tester Environment Data

The API Tester requires environment-specific data to execute test cases. This data is essential for ensuring that tests run successfully with the required dependencies.

Environment Data Dependencies stored in api.input.json.

Types of Environment Data Included:
1. User Accounts:
- Pre-verified users to bypass email verification in user registration tests.
- Includes credentials for different roles like admin, data generators, API key testers, etc.
2. Dataset IDs:
- Used for testing both positive and negative cases in dataset-related API endpoints.
3. Other API-Specific Dependencies:
- Any additional environment-specific data required by the API test cases.

By maintaining this structured environment input data, the API Tester can run consistent and reliable test cases across different environments. 🚀

## Seeder requirements
- To enhance the testing with different personas and varied systems, it is imperative that we generate some scripts that allow generation of users and other seed data required for testing.

Here are the requirements for seed data generation

- Create an project group with random project group data
- Assign the roles to the users for the generated project group
- Create a service
- Assign role to the users.

When we start test , seeder process will start and start with above seed generation and generate one file with `seed.data.json` which is used while testing the API's with different personas. Json format shown below:

```json
{
"project_group": {
"tdei_project_group_id": "<PROJECT_GROUP_ID>",
"name": "<PROJECT_GROUP_NAME>"
},
"services": [
{
"tdei_service_id": "<SERVICE_ID_1>",
"service_type": "<SERVICE_TYPE_1>",
"service_name": "<SERVICE_NAME_1>",
"tdei_project_group_id": "<PROJECT_GROUP_ID>"
},
{
"tdei_service_id": "<SERVICE_ID_2>",
"service_type": "<SERVICE_TYPE_2>",
"service_name": "<SERVICE_NAME_2>",
"tdei_project_group_id": "<PROJECT_GROUP_ID>"
},
{
"tdei_service_id": "<SERVICE_ID_3>",
"service_type": "<SERVICE_TYPE_3>",
"service_name": "<SERVICE_NAME_3>",
"tdei_project_group_id": "<PROJECT_GROUP_ID>"
}
],
"users": {
"poc": {
"username": "<POC_USERNAME>",
"password": "<POC_PASSWORD>"
},
"flex_data_generator": {
"username": "<FLEX_USERNAME>",
"password": "<FLEX_PASSWORD>"
},
"pathways_data_generator": {
"username": "<PATHWAYS_USERNAME>",
"password": "<PATHWAYS_PASSWORD>"
},
"osw_data_generator": {
"username": "<OSW_USERNAME>",
"password": "<OSW_PASSWORD>"
},
"api_key_tester": {
"username": "<API_KEY_TESTER_USERNAME>",
"password": "<API_KEY_TESTER_PASSWORD>"
},
"default_user": {
"username": "<DEFAULT_USER_USERNAME>",
"password": "<DEFAULT_USER_PASSWORD>"
}
},
"api_key": "<API_KEY>",
"api_key_tester": "<API_KEY_TESTER>"
}

```

# Steps
- The testing rig is currently configured based on `test-harness.json` file.
- An example of the file is already given as `test-harness.example.json`
- The testing rig is currently configured based on `.env` file.
- `npm i`
- `npm run test`

Expand All @@ -15,6 +132,28 @@ The above code runs the tests and generates a `test-report.html` (already includ
- name it in the format `<group>.test.ts`
- Write test cases based on [jest](https://jestjs.io/docs/getting-started)

## Important notes on writing tests for better readability
- Consider Adding tests in the below format
> Given
- Setup test data in this step
- Give a line break
> When
- Perform some action
- Give a line break
> Then
- Assert result

```
describe('my-awesome-test', () => {
const getTestData => return {};
it('should validate schema response', () => {
let testData = getTestData();
let api = new myAwesomeApi();

const result = api.getVersions();

## TODO:
Document on what the component is and where it helps
expect(result.status).toBe(200);
expect(result.myAwesomeField).toBe('valid');
});
});
```
77 changes: 77 additions & 0 deletions api.input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"dev": {
"osw": {
"published_dataset": "40566429d02c4c80aee68c970977bed8",
"pre_release_dataset": "1978d16b-46f6-4d0c-b1d1-78123178a65b",
"test_dataset": "f5fd7445fbbf4f248ea1096f0e17b7b3",
"spatial_target_dataset": "fa8e12ea-6b0c-4d3e-8b38-5b87b268e76b",
"spatial_source_dataset": "0d661b69495d47fb838862edf699fe09"
},
"flex": {
"published_dataset": "309dea0b-0fb2-4c19-a771-9f3719b48030",
"pre_release_dataset": "8b0cac15-4f96-4ea8-aac7-934dad1e0367"
},
"pathways": {
"published_dataset": "cb472b40-38cf-4006-abab-5c819682b08c",
"pre_release_dataset": "b8e068b9-67b4-4fe9-8ddb-c1d64d3702ce"
},
"users": {
"poc": "[email protected]",
"flex_data_generator": "[email protected]",
"pathways_data_generator": "[email protected]",
"osw_data_generator": "[email protected]",
"api_key_tester": "[email protected]",
"default_user": "[email protected]"
}
},
"stage": {
"osw": {
"published_dataset": "047c8e5f-bfce-48ee-8dd0-3cdc16d72624",
"pre_release_dataset": "42982431-d983-4c0a-aadb-c88b4ef7d2b8",
"test_dataset": "74d2d6fc-db4a-4f72-8042-e521ef5c3520",
"spatial_target_dataset": "892897ec-d75e-47f5-84ed-efc08ca6a8c6",
"spatial_source_dataset": "0c384536b471477db07a4c6e9d8476bf"
},
"flex": {
"published_dataset": "3cb8a738-b274-4c6c-a8d4-a212de9a7623",
"pre_release_dataset": "80548cc3-0d49-4642-aa40-ec8da7f63fef"
},
"pathways": {
"published_dataset": "7912bddf-5333-4a6e-9af8-81b1efd01707",
"pre_release_dataset": "cc186aa4-8576-4d6e-bd89-f5df4e2e5851"
},
"users": {
"poc": "[email protected]",
"flex_data_generator": "[email protected]",
"pathways_data_generator": "[email protected]",
"osw_data_generator": "[email protected]",
"api_key_tester": "[email protected]",
"default_user": "[email protected]"
}
},
"prod": {
"osw": {
"published_dataset": "40566429d02c4c80aee68c970977bed8",
"pre_release_dataset": "26f0ec82-1434-4944-ae8c-dea8aa5e0075",
"test_dataset": "f5fd7445fbbf4f248ea1096f0e17b7b3",
"spatial_target_dataset": "fa8e12ea-6b0c-4d3e-8b38-5b87b268e76b",
"spatial_source_dataset": "0d661b69495d47fb838862edf699fe09"
},
"flex": {
"published_dataset": "309dea0b-0fb2-4c19-a771-9f3719b48030",
"pre_release_dataset": "8b0cac15-4f96-4ea8-aac7-934dad1e0367"
},
"pathways": {
"published_dataset": "cb472b40-38cf-4006-abab-5c819682b08c",
"pre_release_dataset": "b8e068b9-67b4-4fe9-8ddb-c1d64d3702ce"
},
"users": {
"poc": "[email protected]",
"flex_data_generator": "[email protected]",
"pathways_data_generator": "[email protected]",
"osw_data_generator": "[email protected]",
"api_key_tester": "[email protected]",
"default_user": "[email protected]"
}
}
}
Binary file not shown.
Loading
Loading