Skip to content
Merged
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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ workflows:
context : org-global
filters:
branches:
only: master
only: master
34 changes: 34 additions & 0 deletions .circleci/postman.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 2
jobs:
Run-Newman-Test:
docker:
- image: circleci/node:12
- image: tray/dynamodb-local
command: "-inMemory -port 7777"
- image: elasticsearch:6.8.13
environment:
discovery.type: "single-node"
steps:
- checkout
- setup_remote_docker
- run:
name: 'newman test'
command: |
npm i
cd local
cd ..
npm run create-tables:test
cd mock
(npm run mock-challenge-api&)
(NODE_ENV=test npm start&)
npm run test:newman
workflows:
version: 2
Newman_Test:
jobs:
- Run-Newman-Test:
context : org-global
filters:
branches:
only:
- automated-postman-testing
44 changes: 44 additions & 0 deletions PoC-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Postman PoC test
## Prerequisite
- start db and es:
```bash
$ cd resources-api/local
$ docker-compose up
```
- create tables:
```bash
$ cd resources-api

# NOTE:
# if tables and data already exist, please run first

# $ npm run drop-tables:test

# to drop data and tables

$ npm run create-tables:test
```
- start mock challenge api:
```
$ cd resources-api/mock
$ npm run mock-challenge-api
```
- start app
```bash
$ cd resources-api
$ source env.sh # set env variables
$ NODE_ENV=test npm start
```

## newman test
```bash
$ npm run test:newman
```

## Postman test
Please refer to: https://drive.google.com/file/d/1VcTtNwI5_TXgnEKT4TruqG0Z-ts0J83G/view?usp=sharing


## Postman mock server
E2E tests use nock to mock `BUSAPI_URL`, where postman mock server could be used to replace nock.
Please refer to: https://drive.google.com/file/d/1GXMzyqpzwix-LDBwieiRFfpJlJxrTIgI/view?usp=sharing
4 changes: 4 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,7 @@ npm run e2e
## Verification

Refer to the verification document `Verification.md`

## Postman PoC test

Refer to the PoC test document [**PoC-test.md**](PoC-test.md)
2 changes: 1 addition & 1 deletion config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module.exports = {
TERMS_API_URL: 'http://localhost:4000/v5/terms',
BUSAPI_URL: 'http://localhost:4000/v5',
BUSAPI_URL: 'https://65279208-4c97-4d1a-a925-041b2433787a.mock.pstmn.io/v5',
CHALLENGE_PHASES_API_URL: 'http://localhost:4000/v5/challenge-phases',
DYNAMODB: {
AWS_ACCESS_KEY_ID: 'FAKE_ACCESS_KEY',
Expand Down
7 changes: 7 additions & 0 deletions env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

export AUTH0_CLIENT_ID=

export AUTH0_CLIENT_SECRET=

export AUTH0_AUDIENCE=https://m2m.topcoder-dev.com/
Loading