Skip to content

Commit 1ed8a02

Browse files
postman-ci integration
1 parent d1dfcdf commit 1ed8a02

21 files changed

+1222
-31
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ workflows:
7777
context : org-global
7878
filters:
7979
branches:
80-
only: master
80+
only: master

.circleci/postman.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
jobs:
3+
Run-Newman-Test:
4+
docker:
5+
- image: circleci/node:12
6+
- image: tray/dynamodb-local
7+
command: "-inMemory -port 7777"
8+
- image: elasticsearch:6.8.13
9+
environment:
10+
discovery.type: "single-node"
11+
steps:
12+
- checkout
13+
- setup_remote_docker
14+
- run:
15+
name: 'newman test'
16+
command: |
17+
npm i
18+
cd local
19+
cd ..
20+
npm run create-tables:test
21+
cd mock
22+
(npm run mock-challenge-api&)
23+
(NODE_ENV=test npm start&)
24+
npm run test:newman
25+
workflows:
26+
version: 2
27+
Newman_Test:
28+
jobs:
29+
- Run-Newman-Test:
30+
context : org-global
31+
filters:
32+
branches:
33+
only:
34+
- automated-postman-testing

PoC-test.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@
3030
$ NODE_ENV=test npm start
3131
```
3232

33+
## newman test
34+
```bash
35+
$ npm run test:newman
36+
```
37+
3338
## Postman test
3439
Please refer to: https://drive.google.com/file/d/1VcTtNwI5_TXgnEKT4TruqG0Z-ts0J83G/view?usp=sharing
3540

41+
3642
## Postman mock server
3743
E2E tests use nock to mock `BUSAPI_URL`, where postman mock server could be used to replace nock.
3844
Please refer to: https://drive.google.com/file/d/1GXMzyqpzwix-LDBwieiRFfpJlJxrTIgI/view?usp=sharing

config/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module.exports = {
66
TERMS_API_URL: 'http://localhost:4000/v5/terms',
7-
BUSAPI_URL: 'http://localhost:4000/v5',
7+
BUSAPI_URL: 'https://65279208-4c97-4d1a-a925-041b2433787a.mock.pstmn.io/v5',
88
CHALLENGE_PHASES_API_URL: 'http://localhost:4000/v5/challenge-phases',
99
DYNAMODB: {
1010
AWS_ACCESS_KEY_ID: 'FAKE_ACCESS_KEY',

0 commit comments

Comments
 (0)