From ddf8fc70045456a03a67b2ebad938faedb10398c Mon Sep 17 00:00:00 2001 From: Sarah Abderemane Date: Sun, 25 Sep 2022 16:08:18 +0200 Subject: [PATCH 1/3] Refs #33620 -- Accessibility in pipeline --- .github/workflows/accessibility.yml | 48 +++++++++++++++++++++++++++++ pa11y.json | 30 ++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/accessibility.yml create mode 100644 pa11y.json diff --git a/.github/workflows/accessibility.yml b/.github/workflows/accessibility.yml new file mode 100644 index 000000000000..8b1707f69e27 --- /dev/null +++ b/.github/workflows/accessibility.yml @@ -0,0 +1,48 @@ +name: Accessibility + +on: + pull_request: + branches: + - main + + +jobs: + accessibility: + runs-on: ubuntu-latest + + steps: + - name: Checkout Django core + uses: actions/checkout@v4 + - name: Checkout Django admin demo + uses: actions/checkout@v4 + with: + repository: knyghty/django-admin-demo + ref: a58fa374767a1904dbf0e45e9cc0df1cd2692838 + path: demo + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + cache: 'pip' + cache-dependency-path: 'demo/requirements.txt' + - name: Set up Node + uses: actions/setup-node@v4 + - name: Install Requirements + run: pip install -r demo/requirements.txt + - name: Launch migrations + run: python demo/manage.py migrate + - name: Install pa11y + run: npm install -g pa11y + - name: Run the project and pa11y + run: >- + python demo/manage.py runserver + & (sleep 10 && pa11y http://127.0.0.1:8000/ + --config ./pa11y.json + --runner axe + --include-warnings) + && pa11y http://127.0.0.1:8000/en/admin/demo/artist/ + --config ./pa11y.json + --runner axe + --include-warnings + # TODO: remove this when the errors are fixed. + continue-on-error: true diff --git a/pa11y.json b/pa11y.json new file mode 100644 index 000000000000..7c96db0609ac --- /dev/null +++ b/pa11y.json @@ -0,0 +1,30 @@ +{ + "defaults": { + "timeout": 10000 + }, + "chromeLaunchConfig": { + "args": [ + "--no-sandbox", + "--disable-setuid-sandbox", + "--disable-dev-shm-usage", + "--disable-gpu", + "--headless" + ] + }, + "actions": [ + "navigate to http://127.0.0.1:8000/en/admin/login/", + "wait for element #login-form to be visible", + "set field #id_username to admin", + "set field #id_password to correcthorsebatterystaple", + "click element input[type=submit]", + "wait for url to be http://127.0.0.1:8000/en/admin/" + ], + "urls": [ + "http://127.0.0.1:8000/en/admin/", + "http://127.0.0.1:8000/en/admin/demo/artist/", + "http://127.0.0.1:8000/en/admin/demo/artist/7zX2wRWDKLiW2V5QlI4QXU/change/", + "http://127.0.0.1:8000/en/admin/demo/release/", + "http://127.0.0.1:8000/en/admin/demo/release/7xxg6PunBVeuTliClh4H5p/change/" + + ] +} From 60451e2bf25a4cc10de6f9158d9822265193ce37 Mon Sep 17 00:00:00 2001 From: Sarah Abderemane Date: Thu, 14 Aug 2025 16:20:57 +0300 Subject: [PATCH 2/3] testing on sprints --- .github/workflows/accessibility.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/accessibility.yml b/.github/workflows/accessibility.yml index 8b1707f69e27..b30f77fb63ad 100644 --- a/.github/workflows/accessibility.yml +++ b/.github/workflows/accessibility.yml @@ -36,13 +36,9 @@ jobs: - name: Run the project and pa11y run: >- python demo/manage.py runserver - & (sleep 10 && pa11y http://127.0.0.1:8000/ + & (sleep 10 && pa11y http://127.0.0.1:8000/en/admin/demo/artist/ --config ./pa11y.json --runner axe --include-warnings) - && pa11y http://127.0.0.1:8000/en/admin/demo/artist/ - --config ./pa11y.json - --runner axe - --include-warnings # TODO: remove this when the errors are fixed. continue-on-error: true From eecae9471da1c057aa238519636f98051b619cf8 Mon Sep 17 00:00:00 2001 From: Sarah Abderemane Date: Thu, 14 Aug 2025 16:37:08 +0300 Subject: [PATCH 3/3] testing on sprints #2 --- .github/workflows/accessibility.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/accessibility.yml b/.github/workflows/accessibility.yml index b30f77fb63ad..895992949679 100644 --- a/.github/workflows/accessibility.yml +++ b/.github/workflows/accessibility.yml @@ -40,5 +40,9 @@ jobs: --config ./pa11y.json --runner axe --include-warnings) + && pa11y http://127.0.0.1:8000/en/admin/demo/artist/7zX2wRWDKLiW2V5QlI4QXU/change/ + --config ./pa11y.json + --runner axe + --include-warnings # TODO: remove this when the errors are fixed. continue-on-error: true