Skip to content

Commit

Permalink
MAINT - Pre-release cleanup (#37)
Browse files Browse the repository at this point in the history
* 🔧 Update pyproject file

* 🙈 Update gitignore

* 🔧 Update pyproject meta

* 🔧 Update flake8/ruff rules
  • Loading branch information
trallard authored Jul 13, 2023
1 parent 3844ceb commit 9f00f48
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 60 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ reports/
# editor
.vscode

# Ruff cache
.ruff_cache
38 changes: 29 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,36 @@ build-backend = "hatchling.build"
[project]
name = "jupyter-a11y-tests"
description = "Set of automated accessibility tests for JupyterLab"
version = "1.0.0"
readme = "README.md"
license = "BSD-3-Clause"
authors = [{ name = "Tania Allard", email = "tania@bitsandchips.me" }]
keywords = ["jupyter", "jupyterlab", "accessibility", "a11y"]
requires-python = ">=3.8"
authors = [
{ name = "Tania Allard", email = "tania@bitsandchips.me" },
{ name = "Gabriel Fouasnon", email = "gabriel@fouasnon.com" }
]
keywords = ["jupyter", "jupyterlab", "accessibility", "a11y", "testing"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Development Status :: 3 - Alpha",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Testing",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 3",
"Framework :: Jupyter :: JupyterLab :: 4"
]
requires-python = ">=3.8"
version = "0.0.1"

[project.urls]
Repository = "https://github.com/Quansight-Labs/jupyter-a11y-testing"
Issues = "https://github.com/Quansight-Labs/jupyter-a11y-testing/issues"

[tool.isort]
profile = "black"
Expand All @@ -39,11 +51,19 @@ addopts = "--nbval --sanitize-with docs/sanitize.cfg -pno:warnings --cov=schemin
[tool.hatch]

[tool.ruff]
# Never enforce `E501` (line length violations).
builtins = ["c"]
ignore = ["C", "D400", "E", "F401", "F841", "W", "E501"]
# E501 Line too long (158 > 100 characters)
# D400: First line should end with a period
# F401: Imported but unused
# F841: Local variable is assigned to but never used
ignore = ["D400", "F401", "F841", "E501"]
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
select = ["C4", "C9", "D", "E", "F", "W"]
# A: builtins
# F: Pyflakes
# E,W: pycodestyle
# C4: flake8-comprehensions
# D: pydocstyle
select = ["A", "B", "C", "C4", "C9", "D", "E", "F", "W", "ICN"]

[tool.ruff.pydocstyle]
convention = "google" # Accepts: "google", "numpy", or "pep257".
convention = "google"
2 changes: 1 addition & 1 deletion testing/jupyterlab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@jupyterlab/a11ytests",
"version": "0.0.1",
"private": true,
"description": "Run automated accessibility checks against JupyterLab",
"description": "Set of automated accessibility tests for JupyterLab",
"license": "BSD-3-Clause",
"author": "Project Jupyter",
"scripts": {
Expand Down
74 changes: 39 additions & 35 deletions testing/scripts/jupyterlab-testing-scripts.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# JupyterLab Testing Scripts

This is a series of [testing scripts](https://en.wikipedia.org/wiki/Test_script). designed to mimic common manual accessibility tests in an automated testing setting for JupyterLab. They currently reference [WCAG 2.1](https://www.w3.org/TR/WCAG21/), but ideally will be updated for future versions of WCAG or to align with [ACT-rules](https://act-rules.github.io/rules/).
This is a series of [testing scripts](https://en.wikipedia.org/wiki/Test_script).
Designed to mimic common manual accessibility tests in an automated testing setting for JupyterLab.
They currently reference [WCAG 2.1](https://www.w3.org/TR/WCAG21/), but ideally will be updated for future versions of WCAG or to align with [ACT-rules](https://act-rules.github.io/rules/).

Those unfamiliar with manual testing techniques may also find these scripts helpful in understanding what to do and observe in a manual testing setting as well.

Different scripts apply to different levels of JupyterLab (ie. the whole application versus a single extension). The ideal implementation of these tests is noted in their `Proposed JupyterLab success criteria` section.
Different scripts apply to different levels of JupyterLab (i.e. the whole application versus a single extension).
The ideal implementation of these tests is noted in their `Proposed JupyterLab success criteria` section.

If you are writing a testing script, please review the [Testing Script Template](testing-script-template.md) for more information.

Expand All @@ -20,17 +23,17 @@ This can be tested on the whole JupyterLab application.

#### Proposed testing script

| Step | Expected Behavior |
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1. Open default JupyterLab. | JupyterLab opens with unmodified workspace. |
| 2. Set viewport orientation to portrait (And/or mobile viewport?). | JupyterLab accepts the orientation change and doesn't error out. |
| 3. Check menu bar is in expected location. | Menu bar is at the top of the page and have all menu items visible (currently it has a scroll bar). |
| 4. Check left side bar is in expected location. | Left side bar is the leftmost part of the viewport . It stretches from the menu bar to status bar. All icons are visible. |
| 5. Check document area is in expected location. | Document area is the center and majority of the viewport. |
| 6. Check document area toolbar is in expected location. | The document area toolbar is at the top of the document area. All items are visible (currently it has a scroll bar). |
| 7. Check right side bar is in expected location. | Right side bar is the rightmost part of the viewport. It stretches from the menu bar to status bar. All icons are visible. (Right now, I believe this side bar is not able to be accessed in this mode.) |
| 8. Check status bar is in expected location. | The status bar is at the bottom of the page. All information is visible. |
| 9. Success if all main regions are in expected location. | |
| Step | Expected Behavior |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1. Open default JupyterLab. | JupyterLab opens with unmodified workspace. |
| 2. Set viewport orientation to portrait (And/or mobile viewport?). | JupyterLab accepts the orientation change and doesn't error out. |
| 3. Check menu bar is in expected location. | Menu bar is at the top of the page and have all menu items visible (currently it has a scroll bar). |
| 4. Check left sidebar is in expected location. | Left sidebar is the leftmost part of the viewport . It stretches from the menu bar to status bar. All icons are visible. |
| 5. Check document area is in expected location. | Document area is the center and majority of the viewport. |
| 6. Check document area toolbar is in expected location. | The document area toolbar is at the top of the document area. All items are visible (currently it has a scroll bar). |
| 7. Check right sidebar is in expected location. | Right sidebar is the rightmost part of the viewport. It stretches from the menu bar to status bar. All icons are visible. (Right now, I believe this sidebar is not able to be accessed in this mode.) |
| 8. Check status bar is in expected location. | The status bar is at the bottom of the page. All information is visible. |
| 9. Success if all main regions are in expected location. | |

### [2.1.2 No keyboard trap](https://www.w3.org/WAI/WCAG21/quickref/#no-keyboard-trap)

Expand All @@ -42,15 +45,15 @@ This can be tested on multiple regions of JupyterLab. For example, this script w

#### Proposed testing script

| Step | Expected Behavior |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| 1. Open default JupyterLab. | JupyterLab opens with unmodified workspace. |
| 2. Start focus at top of tree. | Focus goes to JupyterLab tab, may hit skip link. |
| 3. Tab into menu bar. | Focus goes to menu bar (whole). |
| 4. Open file menu. | Focus goes to File menu (within menu bar). Menu bar opens full list of menu items. |
| 5. Close file menu. | Focus stays on File menu, but menu bar is closed. |
| 6. Tab out of menu bar. | Focus moves from File menu, to other menu items until it leaves the region. Focus will move the left side bar/file browser. |
| 7. Success if focus switches to side bar/file browser. | |
| Step | Expected Behavior |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| 1. Open default JupyterLab. | JupyterLab opens with unmodified workspace. |
| 2. Start focus at top of tree. | Focus goes to JupyterLab tab, may hit skip link. |
| 3. Tab into menu bar. | Focus goes to menu bar (whole). |
| 4. Open file menu. | Focus goes to File menu (within menu bar). Menu bar opens full list of menu items. |
| 5. Close file menu. | Focus stays on File menu, but menu bar is closed. |
| 6. Tab out of menu bar. | Focus moves from File menu, to other menu items until it leaves the region. Focus will move the left sidebar/file browser. |
| 7. Success if focus switches to sidebar/file browser. | |

### [2.4.3 Focus Order](https://www.w3.org/WAI/WCAG21/quickref/#focus-order)

Expand All @@ -60,33 +63,34 @@ In JupyterLab, areas can be focused in the following order:

1. Skip link
2. Menu bar
3. Left side bar
4. Inside left side bar (selected section)
3. Left sidebar
4. Inside left sidebar (selected section)
5. Top of document area (document toolbar first if it has one)
6. Document (if there is no toolbar for the document type, users go immediately into the document)
7. Right side bar
8. Inside right side bar (selected section)
7. Right sidebar
8. Inside right sidebar (selected section)
9. Status bar

This can be tested on the whole JupyterLab application.

#### Proposed testing script

| Step | Expected Behavior |
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| 1. Open default JupyterLab. | JupyterLab opens with unmodified workspace. |
| 2. Tab to focus menu bar. | Tab until focus is on the menu bar. (Will this run into the skip link?) |
| 3. Tab through major regions as needed (see above section). | Tab to move focus through left side bar, inside left side bar, top of document area, document area, right side bar, and inside right side bar. |
| 4. Tab to focus status bar | Focus moves to status bar. |
| 5. Success if tab brings focus to status bar. | |
| Step | Expected Behavior |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| 1. Open default JupyterLab. | JupyterLab opens with unmodified workspace. |
| 2. Tab to focus menu bar. | Tab until focus is on the menu bar. (Will this run into the skip link?) |
| 3. Tab through major regions as needed (see above section). | Tab to move focus through left sidebar, inside left sidebar, top of document area, document area, right sidebar, and inside right sidebar. |
| 4. Tab to focus status bar | Focus moves to status bar. |
| 5. Success if tab brings focus to status bar. | |

### [2.5.6 Concurrent input mechanisms](https://www.w3.org/WAI/WCAG21/quickref/#concurrent-input-mechanisms)

#### Proposed JupyterLab success criteria

In JupyterLab, a single task can be completed using mouse, keyboard, and touch screen inputs. This works even when completing a single, continuous task.

This can be tested on multiple regions of JupyterLab. For example, this script will test that JupyterLab can open a new notebook from the launcher with mouse, keyboard, and touch screen inputs.
This can be tested on multiple regions of JupyterLab. For example, this script will test that JupyterLab can open a new notebook from the launcher with mouse,
keyboard, and touch screen inputs.

#### Proposed testing script

Expand All @@ -95,5 +99,5 @@ This can be tested on multiple regions of JupyterLab. For example, this script w
| 1. Open default JupyterLab | JupyterLab opens with unmodified workspace. |
| 2. Open the file menu with a mouse click. | File menu opens and full list of menu items appears. |
| 3. Navigate to menu item New Launcher with arrow keys. | Focus moves through the File menu list items until it reaches the New Launcher item. |
| 4. Use touch screen input to create new Notebook from Launcher. | The New Notebook from Launcher is selected and the command is initiated. |
| 4. Use touch screen input to create new Notebook from Launcher. | The New Notebook from Launcher is selected, and the command is initiated. |
| 5. Success if new notebook opens. | |
Loading

0 comments on commit 9f00f48

Please sign in to comment.