Skip to content

Commit 9997f7e

Browse files
author
ghosh-abhinaba
committed
updated tests.yml
1 parent 5455822 commit 9997f7e

File tree

12 files changed

+268
-374
lines changed

12 files changed

+268
-374
lines changed

.github/workflows/npm-release.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,12 @@ jobs:
7676
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
7777

7878
- name: Create GitHub Release
79-
uses: actions/create-release@v1
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
uses: softprops/action-gh-release@v1
8280
with:
8381
tag_name: v${{ steps.version.outputs.version }}
84-
release_name: Release v${{ steps.version.outputs.version }}
82+
name: Release v${{ steps.version.outputs.version }}
8583
body: |
86-
## What's Changed
87-
8884
See [CHANGELOG.md](https://github.com/abhinaba-ghosh/axe-playwright/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md) for detailed changes.
89-
90-
**Full Changelog**: https://github.com/abhinaba-ghosh/axe-playwright/blob/v${{ steps.version.outputs.version }}/CHANGELOG.md
9185
draft: false
9286
prerelease: false
87+
generate_release_notes: true

.github/workflows/tests.yml

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,20 @@ name: Test
22

33
on:
44
push:
5-
branches: [master, develop]
6-
pull_request:
75
branches: [master]
6+
pull_request:
87

98
jobs:
109
test:
1110
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
node-version: [16, 18, 20]
15-
1611
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v4
19-
20-
- name: Setup Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v4
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
2214
with:
23-
node-version: ${{ matrix.node-version }}
15+
node-version: '18'
2416
cache: 'npm'
25-
26-
- name: Install dependencies
27-
run: npm ci
28-
29-
- name: Build
30-
run: npm run build
31-
32-
- name: Install Playwright
33-
run: npx playwright install --with-deps chromium
34-
35-
- name: Run tests (continue on failure)
36-
run: npm test
17+
- run: npm ci
18+
- run: npm run build
19+
- run: npx playwright install --with-deps chromium
20+
- run: npm test
3721
continue-on-error: true
38-
39-
- name: Upload test results
40-
if: always()
41-
uses: actions/upload-artifact@v4
42-
with:
43-
name: test-results-node-${{ matrix.node-version }}
44-
path: |
45-
test-results/
46-
results/
47-
coverage/
48-
retention-days: 7

a11y-tests.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuites tests="2" failures="1" errors="0" skipped="0">
3+
<testsuite name="Page" tests="1" failures="1" errors="0" skipped="0">
4+
<testcase classname="color-contrast" name="Elements must have sufficient color contrast">
5+
<failure message="Expected the HTML found at $('.low-contrast') to have no violations:&#xA;&lt;div class=&quot;low-contrast&quot;>Text&lt;/div>&#xA;Received:&#xA;Elements must have sufficient color contrast (color-contrast)&#xA;Fix any of the following:&#xA; Element has insufficient color contrast&#xA;You can find more information on this issue here: &#xA;https://dequeuniversity.com/rules/axe/4.4/color-contrast&#xA;"/>
6+
</testcase>
7+
</testsuite>
8+
<testsuite name="Page" tests="0" failures="0" errors="0" skipped="0"/>
9+
<testcase name="Accesibility testing - A11Y"/>
10+
</testsuites>

jest.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module.exports = {
22
preset: 'jest-playwright-preset',
33
testEnvironment: 'node',
4-
testMatch: ['**/tests/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'],
5-
testPathIgnorePatterns: ['/node_modules/'],
4+
testMatch: ['**/test/**/*.(test|spec).(js|ts)'],
5+
testPathIgnorePatterns: ['/node_modules/', 'a11y.spec.ts'],
66
testTimeout: 30000,
77
transform: {
88
'^.+\\.tsx?$': 'ts-jest',
99
},
10-
}
10+
}

package.json

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "axe-playwright",
3-
"version": "2.2.0-0",
3+
"version": "2.1.0",
44
"description": "Custom Playwright commands to inject axe-core and test for a11y",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -19,7 +19,9 @@
1919
"scripts": {
2020
"prebuild": "rm -rf dist",
2121
"build": "tsc",
22-
"test": "jest",
22+
"test": "npm run test:unit && npm run test:integration",
23+
"test:unit": "jest test/unit --testEnvironment=node",
24+
"test:integration": "jest test/integration",
2325
"format": "npx prettier --write .",
2426
"prerelease": "npm run build",
2527
"release": "standard-version",
@@ -70,59 +72,6 @@
7072
"skip": {
7173
"commit": false,
7274
"tag": false
73-
},
74-
"types": [
75-
{
76-
"type": "feat",
77-
"section": "Features"
78-
},
79-
{
80-
"type": "fix",
81-
"section": "Bug Fixes"
82-
},
83-
{
84-
"type": "perf",
85-
"section": "Performance Improvements"
86-
},
87-
{
88-
"type": "revert",
89-
"section": "Reverts"
90-
},
91-
{
92-
"type": "docs",
93-
"section": "Documentation",
94-
"hidden": false
95-
},
96-
{
97-
"type": "style",
98-
"section": "Styles",
99-
"hidden": true
100-
},
101-
{
102-
"type": "chore",
103-
"section": "Maintenance",
104-
"hidden": true
105-
},
106-
{
107-
"type": "refactor",
108-
"section": "Code Refactoring",
109-
"hidden": false
110-
},
111-
{
112-
"type": "test",
113-
"section": "Tests",
114-
"hidden": true
115-
},
116-
{
117-
"type": "build",
118-
"section": "Build System",
119-
"hidden": true
120-
},
121-
{
122-
"type": "ci",
123-
"section": "CI",
124-
"hidden": true
125-
}
126-
]
75+
}
12776
}
128-
}
77+
}

0 commit comments

Comments
 (0)