Feature: support file array #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
test-method-get-on-existing-url: | |
name: "IT Test - Request Postman Echo GET" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/get' | |
method: 'GET' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-method-post-on-existing-url: | |
name: "IT Test - Request Postman Echo POST" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: "https://postman-echo.com/post" | |
method: 'POST' | |
data: '{ "key": "value" }' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-method-post-on-existing-url-with-unescaped-newline: | |
name: "IT Test - Request Postman Echo POST with Unescaped Newline" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: "https://postman-echo.com/post" | |
method: 'POST' | |
escapeData: 'true' | |
data: >- | |
{ | |
"key":"multi line\ntest | |
text" | |
} | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-basic-auth: | |
name: "IT Test - Request Postman Echo BasicAuth" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/basic-auth' | |
method: 'GET' | |
username: 'postman' | |
password: 'password' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-input-ignore-failure-code-404: | |
name: "IT Test - Request Postman Echo with 404 Response and ignore failure code" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/status/404' | |
method: 'GET' | |
ignoreStatusCodes: '404' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: 'success' | |
actual: ${{ steps.execution.outcome }} | |
comparison: exact | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '404' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-input-files: | |
name: "IT Test - Request Postman Echo POST Multipart" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Create Test File | |
run: | | |
echo "test" > testfile.txt | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/post' | |
method: 'POST' | |
data: '{ "key": "value" }' | |
files: '{ "file": "${{ github.workspace }}/testfile.txt" }' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-input-responseFile: | |
name: "IT Test - Request Postman Echo POST and persist response" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Create Test File | |
run: | | |
echo "test" > testfile2.txt | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/post' | |
method: 'POST' | |
file: "${{ github.workspace }}/testfile2.txt" | |
responseFile: "${{ github.workspace }}/response.json" | |
- name: Output responseFile | |
id: execution-response-file | |
run: | | |
echo "response_content=$(cat ${{ github.workspace }}/response.json)" >> $GITHUB_OUTPUT | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '{"args":{},"data":"test\n","files":{},"form":{},"headers":{"host":"postman-echo.com",' | |
actual: ${{ steps.execution-response-file.outputs.response_content }} | |
comparison: contains | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '"accept":"application/json, text/plain, */*","content-type":"application/json","user-agent"' | |
actual: ${{ steps.execution-response-file.outputs.response_content }} | |
comparison: contains | |
test-input-files-without-data: | |
name: "IT Test - Request Postman Echo POST Multipart without data" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Create Test File | |
run: | | |
echo "test" > testfile3.txt | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/post' | |
method: 'POST' | |
files: '{ "file": "${{ github.workspace }}/testfile3.txt" }' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-input-file-with-single-file: | |
name: "IT Test - Request Postman Echo POST single file" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Create Test File | |
run: | | |
echo "test" > testfile4.txt | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/post' | |
method: 'POST' | |
file: "${{ github.workspace }}/testfile4.txt" | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-input-data-with-url-encoded-string: | |
name: "IT Test - Request Postman Echo POST URLEncoded string data" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/post' | |
contentType : 'application/x-www-form-urlencoded' | |
method: 'POST' | |
data: 'key=value' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
test-input-data-with-url-encoded-json-data: | |
name: "IT Test - Request Postman Echo POST URLEncoded json data" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Given the gh-action is used with only mandatory fields | |
id: execution | |
uses: ./ | |
with: | |
url: 'https://postman-echo.com/post' | |
contentType : 'application/x-www-form-urlencoded' | |
method: 'POST' | |
data: '{"key":"value"}' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 200 as this URL exists | |
with: | |
expected: '200' | |
actual: ${{ steps.execution.outputs.status }} | |
comparison: exact | |
it-tests: | |
name: "All IT Tests have to pass" | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
# Add your tests here so that they prevent the merge of broken changes | |
- test-method-get-on-existing-url | |
- test-method-post-on-existing-url | |
- test-method-post-on-existing-url-with-unescaped-newline | |
- test-basic-auth | |
- test-input-ignore-failure-code-404 | |
- test-input-files | |
- test-input-responseFile | |
- test-input-files-without-data | |
- test-input-file-with-single-file | |
- test-input-data-with-url-encoded-string | |
- test-input-data-with-url-encoded-json-data | |
steps: | |
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 | |
with: | |
jobs: ${{ toJSON(needs) }} |