Skip to content

Commit

Permalink
Merge pull request #377 from qase-tms/integration_docs
Browse files Browse the repository at this point in the history
add an example for integration with Qase
  • Loading branch information
sklmx authored Mar 7, 2023
2 parents def4385 + c995b50 commit f88121c
Show file tree
Hide file tree
Showing 7 changed files with 339 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Node package

on: [push]
on:
push:
paths-ignore:
- 'examples/**'

jobs:
test:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run tests

on:
workflow_dispatch:
inputs:
qase_api_base_url:
description: 'Qase API URL'
required: true
qase_report:
description: 'Enabled/disabled reporting to Qase'
required: true
qase_project_code:
description: 'Qase project code'
required: true
qase_run_id:
description: 'Qase Run ID'
required: true
qase_run_complete:
description: 'Complete Qase Run'
required: true

env:
QASE_API_BASE_URL: ${{ inputs.qase_api_base_url }}
QASE_REPORT: ${{ inputs.qase_report }}
QASE_PROJECT_CODE: ${{ inputs.qase_project_code }}
QASE_RUN_ID: ${{ inputs.qase_run_id }}
QASE_RUN_COMPLETE: ${{ inputs.qase_run_complete }}
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}

jobs:
build-js:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: qase-tms/qase-link-run@main
env:
QASE_API_TOKEN: ${{ env.QASE_API_TOKEN }}
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
1 change: 1 addition & 0 deletions examples/github-qase-integration/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
236 changes: 236 additions & 0 deletions examples/github-qase-integration/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions examples/github-qase-integration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "test-qase-gh-action",
"version": "1.0.0",
"description": "",
"main": "index.js",
"directories": {
"test": "tests"
},
"scripts": {
"test": "npx playwright test"
},
"author": "",
"license": "Apache License 2.0",
"dependencies": {
"@playwright/test": "^1.31.1",
"playwright-qase-reporter": "^1.2.0-alpha.5"
}
}
16 changes: 16 additions & 0 deletions examples/github-qase-integration/playwright.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const config = {
use: {
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
reporter: [
['list'],
[
'playwright-qase-reporter',
{
logging: true,
},
],
],
};
module.exports = config;
18 changes: 18 additions & 0 deletions examples/github-qase-integration/tests/playwright/test.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {test, expect} from '@playwright/test'
import {qase} from 'playwright-qase-reporter/dist/playwright'

test(qase(1, 'Several ids'), () => {
expect(true).toBe(true);
})

test(qase(2, 'Correct test'), () => {
expect(true).toBe(true);
})

test.skip(qase(3, 'Skipped test'), () => {
expect(true).toBe(true);
})

test(qase(4, 'Failed test'), () => {
expect(true).toBe(false);
})

0 comments on commit f88121c

Please sign in to comment.