Skip to content

Commit b3c9456

Browse files
authored
Merge pull request #2 from automated-a11y/ci/workflow
Work Flow
2 parents 05a6072 + a445c7a commit b3c9456

File tree

13 files changed

+135
-83
lines changed

13 files changed

+135
-83
lines changed

.coveragerc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[run]
2+
omit =
3+
**/modal/*
4+
tests/*

.github/workflows/coverage.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Unit tests and Coverage
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [ opened, synchronize, reopened ]
8+
9+
jobs:
10+
test:
11+
name: Unit tests and Coverage
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: "3.10"
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r requirements.txt
23+
playwright install
24+
- name: Unit tests
25+
run: coverage run -m pytest
26+
- name: Generate Coverage Report
27+
run: coverage xml
28+
- name: Codacy Coverage
29+
uses: codacy/codacy-coverage-reporter-action@v1
30+
with:
31+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
32+
coverage-reports: coverage.xml

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
/dist/
66
/python_a11y_playwright.egg-info/
77
/python_a11y_playwright_test.egg-info/
8+
/.pytest_cache/
9+
/.coverage

automateda11y/pw/axerunner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def __init__(self, page):
1414

1515
def set_page_title(self, page_title):
1616
self.params.set_page_title(page_title)
17+
return self
1718

1819
def execute(self):
1920
data = self.a11y.execute(Engine.AXE, self.params)

automateda11y/pw/htmlcsrunner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ def __init__(self, page):
1212

1313
def set_standard(self, standard="WCAG2AA"):
1414
self.params.set_standard(standard)
15+
return self
1516

1617
def set_ignore_code(self, codes):
1718
self.params.set_ignore_codes(codes)
19+
return self
1820

1921
def set_page_title(self, page_title):
2022
self.params.set_page_title(page_title)
23+
return self
2124

2225
def execute(self):
2326
data = self.a11y.execute(Engine.HTMLCS, self.params)

pyproject.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "python-a11y-playwright"
7+
version = "0.0.2"
8+
authors = [
9+
{ name="Sridhar Bandi", email="sridhar.bandi.ece@gmail.com" },
10+
]
11+
license = {text = "MIT License"}
12+
description = "Automate Web Accessibility Testing using AXE/HTMLCS with Playwright Python"
13+
readme = "ReadMe.md"
14+
requires-python = ">=3.7"
15+
classifiers = [
16+
'License :: OSI Approved :: MIT License',
17+
'Programming Language :: Python',
18+
'Programming Language :: Python :: 3',
19+
'Programming Language :: Python :: 3.6',
20+
'Programming Language :: Python :: 3.7',
21+
'Programming Language :: Python :: 3.8',
22+
'Programming Language :: Python :: 3.9',
23+
'Programming Language :: Python :: 3.10',
24+
'Programming Language :: Python :: 3.11',
25+
]
26+
keywords = ["axe", "htmlcs", "accessibility", "playwright"]
27+
dependencies = [
28+
"marshmallow-dataclass"
29+
]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/automated-a11y/python-a11y-playwright"
33+
repository = "https://github.com/automated-a11y/python-a11y-playwright.git"
34+
35+
[tool.setuptools.packages.find]
36+
exclude = ["tests", "*.tests", "*.tests.*", "tests.*"]
37+
38+
[tool.setuptools.package-data]
39+
"automateda11y.pw.resources" = ["js/*.js"]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
playwright==1.29.1
22
marshmallow-dataclass==8.5.11
3-
marshmallow~=3.19.0
4-
pynguin~=0.30.0
3+
pytest-playwright==0.3.0
4+
coverage==7.1.0

setup.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

tests/axetest.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/htmlcstest.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)