diff --git a/.github/workflows/newman.yml b/.github/workflows/newman.yml new file mode 100644 index 0000000..fd81a4a --- /dev/null +++ b/.github/workflows/newman.yml @@ -0,0 +1,41 @@ +name: Test-Build +on: + push: + branches: + - * +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@v1 + with: + node-version: '12.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 POSTMAN collection + run: | + newman run ./tests/pokemon-api-collection.json -e ./tests/pokemonapi-env.json -r htmlextra --reporter-htmlextra-export testResults/htmlreport.html --reporter-htmlextra-darkTheme > testResults/runreport1.html + + # Upload the contents of Test Results directory to workspace + - name: Output the run Details + uses: actions/upload-artifact@v2 + with: + name: RunReports + path: testResults +