diff --git a/.github/workflows/NewmanReport.yml b/.github/workflows/NewmanReport.yml new file mode 100644 index 0000000..49f0e06 --- /dev/null +++ b/.github/workflows/NewmanReport.yml @@ -0,0 +1,38 @@ +# This workflow will help you to produce newman test run + +name: Newman Tests +on: [push, pull_request] + +jobs: + test-api: + runs-on: ubuntu-latest + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # INstall Node on the runner + - name: Install Node + uses: actions/setup-node@v2 + with: + node-version: '16.x' + + # Install the newman command line utility and also install the html extra reporter + - name: Install newman + run: | + npm install -g newman + npm install -g newman-reporter-htmlextra + + # Make directory to upload the test results + - name: Make Directory for results + run: mkdir -p testResults + + # Run the POSTMAN collection + - name: Run API Tests + run: newman run https://api.getpostman.com/collections/${{secrets.COLLECTION_ID}}?apikey=${{secrets.POSTMAN_API_KEY}} -r htmlextra --reporter-htmlextra-export testResults/Jencyhtmlreport.html + + # Upload the contents of Test Results directory to workspace + - name: Output the run Details + uses: actions/upload-artifact@v2 + with: + name: JencyRunReport + path: testResults diff --git a/.github/workflows/NewmanTest.yml b/.github/workflows/NewmanTest.yml index 5e3ecef..6cf715f 100644 --- a/.github/workflows/NewmanTest.yml +++ b/.github/workflows/NewmanTest.yml @@ -21,4 +21,4 @@ jobs: run: npm install -g newman # Run the POSTMAN collection - name: Run Tests - run: newman run https://api.getpostman.com/collections/12559118-c097f106-044b-4b9c-9c27-0bd4658f5804?apikey=PMAK-62f1fd2a56d9256ffcb56f73-3c12b6b28917f1471d973d773179de9e47 + run: newman run https://api.getpostman.com/collections/${{secrets.COLLECTION_ID}}?apikey=${{secrets.POSTMAN_API_KEY}}