Forum Discussion
felipecferraz
2 years agoNew Contributor
I'm looking for a solution, too... I am almost done by passing a curl command into my .yml file but I'm stuck on this step because I cannot perform this POST even using Postman.
I don't know what to do anymore.
Here is my solution that doesn't work at all, I hope to help anyone that is luckier than me at the POST request
name: "e2e"
on: [push]
jobs:
test-e2e:
name: Run E2E tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run your tests
run: npx playwright test
- name: Upload allure report results
if: always()
uses: actions/upload-artifact@v2
with:
name: Allure Report
path: test-results
- name: Upload JUnit artifact
if: always()
uses: actions/upload-artifact@v2
with:
name: junit-artifact
path: playwright-report
- name: Download Artifact
if: always()
uses: actions/download-artifact@v2
with:
name: junit-artifact
path: download-artifact
- name: Get Path
id: file-path
if: always()
run: |
file_path=download-artifact/results.xml
echo "PATH LOG: $file_path"
echo "::set-output name=path::$file_path"
cd download-artifact
ls -R
- name: Get File Size
if: always()
id: file-size
run: |
file_size=$(stat -c%s "${{ steps.file-path.outputs.path }}")
echo "SIZE LOG: $file_size"
echo "::set-output name=size::$file_size"
- name: upload to Zephyr via curl
if: always()
run: >-
curl -X POST "${{ vars.ZEPHYR_BASE_URL }}/automations/executions/junit?projectKey=${{ vars.ZEPHYR_PROJECT_KEY }}&autoCreateTestCases=true" \
-H "Authorization: Bearer ${{ secrets.TOKEN }}" \
-H "Content-Length: ${{ steps.file-size.outputs.size }} "\
-H "Content-Type: application/json" \
--data-binary "@downloaded-artifact/results.xml" \
--data '{"testCycle": {"name": "Created by GitHub Actions", "description": "Something to think about", "folderId": "${{ vars.TESTCYCLE_FOLDER_ID }}"}}'
My solution was based on the docs: Zephyr Scale for Jira Cloud API
Related Content
- 2 years ago
- 3 years ago
- 4 years ago
- 6 years ago
Recent Discussions
- 7 days ago