Skip to content

Commit

Permalink
Add tests with assertions (#154)
Browse files Browse the repository at this point in the history
That way not only inputs are tested but also outputs
  • Loading branch information
sebastienvermeille authored Jul 29, 2024
1 parent 44816be commit aeef78b
Show file tree
Hide file tree
Showing 2 changed files with 315 additions and 103 deletions.
103 changes: 0 additions & 103 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,106 +69,3 @@ jobs:
- name: Repository Integrity Check
run: |
git diff --quiet dist
test:
if: >
!failure() &&
!cancelled()
needs:
- integrity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Request Postman Echo GET
uses: ./
with:
url: 'https://postman-echo.com/get'
method: 'GET'

- name: Request Postman Echo POST
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
data: '{ "key": "value" }'

- name: Request Postman Echo POST with Unescaped Newline
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
escapeData: 'true'
data: >-
{
"key":"multi line\ntest
text"
}
- name: Request Postman Echo BasicAuth
uses: ./
with:
url: 'https://postman-echo.com/basic-auth'
method: 'GET'
username: 'postman'
password: 'password'

- name: Request Postman Echo with 404 Response and ignore failure code
uses: ./
with:
url: 'https://postman-echo.com/status/404'
method: 'GET'
ignoreStatusCodes: '404'

- name: Create Test File
run: |
echo "test" > testfile.txt
- name: Request Postman Echo POST Multipart
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
data: '{ "key": "value" }'
files: '{ "file": "${{ github.workspace }}/testfile.txt" }'

- name: Request Postman Echo POST and persist response
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
file: "${{ github.workspace }}/testfile.txt"
responseFile: "${{ github.workspace }}/response.json"
- name: Output responseFile
run: |
cat "${{ github.workspace }}/response.json"
- name: Request Postman Echo POST Multipart without data
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
files: '{ "file": "${{ github.workspace }}/testfile.txt" }'

- name: Request Postman Echo POST single file
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
file: "${{ github.workspace }}/testfile.txt"

- name: Request Postman Echo POST URLEncoded string data
uses: ./
with:
url: 'https://postman-echo.com/post'
contentType : 'application/x-www-form-urlencoded'
method: 'POST'
data: 'key=value'

- name: Request Postman Echo POST URLEncoded json data
uses: ./
with:
url: 'https://postman-echo.com/post'
contentType : 'application/x-www-form-urlencoded'
method: 'POST'
data: '{"key":"value"}'
Loading

0 comments on commit aeef78b

Please sign in to comment.