Skip to content

Update all the things #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
matrix:
python-version:
- '3.12'
- '3.13'

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: browser-actions/setup-geckodriver@latest

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: tests/requirements/*.txt

- name: Install dependencies
run: uv pip install --system tox tox-uv

- name: NPM Install
run: npm install

- name: Run tox targets for ${{ matrix.python-version }}
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run lint
run: tox -e lint
61 changes: 0 additions & 61 deletions .travis.yml

This file was deleted.

13 changes: 1 addition & 12 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
# Community Participation Guidelines

This repository is governed by Mozilla's code of conduct and etiquette guidelines.
For more details, please read the
[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/).
This repository is governed by Django's code of conduct. See https://www.djangoproject.com/conduct/.

## How to Report
For more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/)' page.

<!--
## Project Specific Etiquette

In some cases, there will be additional project etiquette i.e.: (https://bugzilla.mozilla.org/page.cgi?id=etiquette.html).
Please update for your project.
-->
14 changes: 13 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
include LICENSE.txt README.rst axe_selenium_python/node_modules/axe-core/axe.min.js axe_selenium_python/tests/test_page.html
include CODE_OF_CONDUCT.md
include LICENSE.txt
include README.rst
include tox.ini
include axe_selenium_python/node_modules/axe-core/axe.min.js
include tests/test_page.html
include package.json
include package-lock.json
include axe_selenium_python/package-lock.json
include axe_selenium_python/package.json
recursive-include *.rst *.txt
recursive-include tests *.js
recursive-include tests *.py
recursive-include tests *.txt
36 changes: 12 additions & 24 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,25 @@ axe-selenium-python

axe-selenium-python integrates aXe and selenium to enable automated web accessibility testing.

**This version of axe-selenium-python is using axe-core@4.0.2.**
**This version of axe-selenium-python is using axe-core@4.10.2.**

.. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg
:target: https://github.com/mozilla-services/axe-selenium-python/blob/master/LICENSE.txt
:target: https://github.com/axe-selenium-python/axe-selenium-python/blob/master/LICENSE.txt
:alt: License
.. image:: https://img.shields.io/pypi/v/axe-selenium-python.svg
:target: https://pypi.org/project/axe-selenium-python/
:alt: PyPI
.. image:: https://img.shields.io/travis/mozilla-services/axe-selenium-python.svg
:target: https://travis-ci.org/mozilla-services/axe-selenium-python
:alt: Travis
.. image:: https://img.shields.io/github/issues-raw/mozilla-services/axe-selenium-python.svg
:target: https://github.com/mozilla-services/axe-selenium-python/issues
.. image:: https://img.shields.io/github/issues-raw/axe-selenium-python/axe-selenium-python.svg
:target: https://github.com/axe-selenium-python/axe-selenium-python/issues
:alt: Issues
.. image:: https://api.dependabot.com/badges/status?host=github&repo=mozilla-services/axe-selenium-python
:target: https://dependabot.com
:alt: Dependabot
.. image:: https://coveralls.io/repos/github/mozilla-services/axe-selenium-python/badge.svg?branch=master
:target: https://coveralls.io/github/mozilla-services/axe-selenium-python?branch=master
:alt: Coveralls



Requirements
------------

You will need the following prerequisites in order to use axe-selenium-python:

- selenium >= 3.0.0
- Python 2.7 or 3.6
- selenium >= 4.2
- Python 3.12+
- The appropriate driver for the browser you intend to use, downloaded and added to your path, e.g. geckodriver for Firefox:

- `geckodriver <https://github.com/mozilla/geckodriver/releases>`_ downloaded and `added to your PATH <https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path#answer-40208762>`_
Expand Down Expand Up @@ -88,16 +77,15 @@ You can run the tests using

$ tox

Resources
---------

- `Issue Tracker <http://github.com/mozilla-services/axe-selenium-python/issues>`_
- `Code <http://github.com/mozilla-services/axe-selenium-python/>`_
- `pytest-axe <http://github.com/mozilla-services/pytest-axe/>`_

CHANGELOG
^^^^^^^^^^^^^^

version 3.0
***********

- Bumped minimum Python version to 3.12
- Updated axe to ``axe-core@4.10.2``

version 2.1.5
*************
**Breaks backwards compatibility**:
Expand Down
7 changes: 3 additions & 4 deletions axe_selenium_python/axe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

import json
import os
from io import open

_DEFAULT_SCRIPT = os.path.join(
os.path.dirname(__file__), "node_modules", "axe-core", "axe.min.js"
)


class Axe(object):
class Axe:
def __init__(self, selenium, script_url=_DEFAULT_SCRIPT):
self.script_url = script_url
self.selenium = selenium
Expand All @@ -23,7 +22,7 @@ def inject(self):
:param script_url: location of the axe-core script.
:type script_url: string
"""
with open(self.script_url, "r", encoding="utf8") as f:
with open(self.script_url, encoding="utf8") as f:
self.selenium.execute_script(f.read())

def run(self, context=None, options=None):
Expand Down Expand Up @@ -110,6 +109,6 @@ def write_results(self, data, name=None):

with open(filepath, "w", encoding="utf8") as f:
try:
f.write(unicode(json.dumps(data, indent=4)))
f.write(json.dumps(data, indent=4))
except NameError:
f.write(json.dumps(data, indent=4))
24 changes: 18 additions & 6 deletions axe_selenium_python/package-lock.json

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

2 changes: 1 addition & 1 deletion axe_selenium_python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
},
"homepage": "https://github.com/kimberlythegeek/axe-selenium-python#readme",
"dependencies": {
"axe-core": ">=4.0.2"
"axe-core": "^4.10.2"
}
}
31 changes: 0 additions & 31 deletions axe_selenium_python/tests/conftest.py

This file was deleted.

2 changes: 0 additions & 2 deletions axe_selenium_python/tests/requirements/flake8.txt

This file was deleted.

4 changes: 0 additions & 4 deletions axe_selenium_python/tests/requirements/tests.txt

This file was deleted.

11 changes: 10 additions & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Integrate axe-core with python",
"main": "index.js",
"scripts": {
"install": "cd axe_selenium_python && npm install"
"install": "cd axe_selenium_python && npm install && npm ls"
},
"repository": {
"type": "git",
Expand Down
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[build-system]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "axe-selenium-python"
description = "Python library to integrate axe and selenium for web accessibility testing."
dynamic = ["version"]
readme = "README.rst"
authors = [
{name="Kimberly Sereduck", email="ksereduck@mozilla.com"}
]
license = {"text" = "Mozilla Public License 2.0 (MPL 2.0)"}
keywords = ["axe-core", "selenium", "pytest-selenium", "accessibility" , "automation", "mozilla"]
requires-python = ">=3.12"
dependencies = [
"selenium>=4.2",
"pytest>=3.0",
]

[project.urls]
"Homepage" = "https://github.com/axe-selenium-python/axe-selenium-python"
"Issues" = "https://github.com/axe-selenium-python/axe-selenium-python/issues"

[tool.setuptools_scm]
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

Loading