Skip to content

Commit

Permalink
Merge pull request #23 from rtCamp/add/tesult
Browse files Browse the repository at this point in the history
Add/ tesult configuration
  • Loading branch information
pooja-muchandikar authored Dec 13, 2022
2 parents 7169539 + e2611bd commit 668740a
Show file tree
Hide file tree
Showing 5 changed files with 1,248 additions and 18 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ on:
jobs:
Run-wpe2e-TestCase:
# The type of runner that the job will run on
name: Run Mention-links
name: Run Mention links
runs-on: ubuntu-latest
env:
SHA: ${{ github.event.pull_request.head.sha }}
COMMIT_SHA: ${{ github.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
working-directory: ./tests/e2e-playwright
TESRESULT_TOKEN: ${{ secrets.TESRESULT_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it

- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
Expand All @@ -45,6 +52,11 @@ jobs:
name: report
path: ./tests/e2e-playwright/artifacts

- name: run PR status
if: ${{ always() }}
run: node ./tests/e2e-playwright/bin/pr-status.js
working-directory: ${{env.working_directory}}

- name: Cleanup
if: ${{ always() }}
uses: rtCamp/action-cleanup@master
uses: rtCamp/action-cleanup@master
21 changes: 21 additions & 0 deletions tests/e2e-playwright/bin/pr-status.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node
// Octokit.js
// https://github.com/octokit/core.js#readme

const { Octokit } = require("@octokit/core");

const octokit = new Octokit({
auth: process.env.TOKEN,
});

octokit.request("POST /repos/{org}/{repo}/statuses/{sha}", {
org: "rtCamp",
repo: "mention-links",
sha: process.env.SHA ? process.env.SHA : process.env.COMMIT_SHA,
state: "success",
conclusion: "success",
target_url:
"https://www.tesults.com/results/rsp/view/results/project/adc9cdec-9317-40aa-afd7-eb38cc1696ec",
description: "Successfully synced to Tesults",
context: "E2E Test Result",
});
5 changes: 4 additions & 1 deletion tests/e2e-playwright/e2e-test-utils-playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
"@wordpress/keycodes": "3.13.0",
"@wordpress/url": "3.14.0",
"form-data": "^4.0.0",
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"@octokit/core": "^2.5.4",
"@octokit/plugin-paginate-rest": "^1.1.1",
"playwright-tesults-reporter": "^1.0.0"
},
"peerDependencies": {
"@playwright/test": ">=1"
Expand Down
Loading

0 comments on commit 668740a

Please sign in to comment.