@govtechsg/oobee 0.10.21 → 0.10.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.github/workflows/docker-test.yml +1 -1
  2. package/DETAILS.md +40 -25
  3. package/Dockerfile +41 -47
  4. package/INSTALLATION.md +1 -1
  5. package/LICENSE-3RD-PARTY-REPORT.txt +448 -0
  6. package/LICENSE-3RD-PARTY.txt +19913 -0
  7. package/README.md +10 -2
  8. package/__mocks__/mock-report.html +1503 -1360
  9. package/package.json +8 -4
  10. package/scripts/decodeUnzipParse.js +29 -0
  11. package/scripts/install_oobee_dependencies.command +2 -2
  12. package/scripts/install_oobee_dependencies.ps1 +3 -3
  13. package/src/cli.ts +3 -2
  14. package/src/combine.ts +1 -0
  15. package/src/constants/cliFunctions.ts +17 -3
  16. package/src/constants/common.ts +29 -5
  17. package/src/constants/constants.ts +28 -26
  18. package/src/constants/questions.ts +4 -1
  19. package/src/crawlers/commonCrawlerFunc.ts +159 -187
  20. package/src/crawlers/crawlDomain.ts +29 -30
  21. package/src/crawlers/crawlIntelligentSitemap.ts +7 -1
  22. package/src/crawlers/crawlLocalFile.ts +1 -1
  23. package/src/crawlers/crawlSitemap.ts +1 -1
  24. package/src/crawlers/custom/flagUnlabelledClickableElements.ts +546 -472
  25. package/src/crawlers/customAxeFunctions.ts +2 -2
  26. package/src/index.ts +0 -2
  27. package/src/mergeAxeResults.ts +608 -220
  28. package/src/screenshotFunc/pdfScreenshotFunc.ts +3 -3
  29. package/src/static/ejs/partials/components/wcagCompliance.ejs +10 -29
  30. package/src/static/ejs/partials/footer.ejs +10 -13
  31. package/src/static/ejs/partials/scripts/categorySummary.ejs +2 -2
  32. package/src/static/ejs/partials/scripts/decodeUnzipParse.ejs +3 -0
  33. package/src/static/ejs/partials/scripts/reportSearch.ejs +1 -0
  34. package/src/static/ejs/partials/scripts/ruleOffcanvas.ejs +54 -52
  35. package/src/static/ejs/partials/styles/styles.ejs +4 -0
  36. package/src/static/ejs/partials/summaryMain.ejs +15 -42
  37. package/src/static/ejs/report.ejs +21 -12
  38. package/src/utils.ts +10 -2
  39. package/src/xPathToCss.ts +186 -0
  40. package/a11y-scan-results.zip +0 -0
  41. package/src/types/xpath-to-css.d.ts +0 -3
@@ -36,7 +36,7 @@ jobs:
36
36
  run: |
37
37
  docker exec oobee-container cat logs/*/*.txt || true
38
38
  - name: Copy Results from Docker Container
39
- run: docker cp oobee-container:/app/results ./results
39
+ run: docker cp oobee-container:/app/oobee/results ./results
40
40
 
41
41
  - name: Zip Results
42
42
  run: zip -r results.zip ./results
package/DETAILS.md CHANGED
@@ -14,31 +14,43 @@ Details of each issue and severity rating provided by the current scan engine.
14
14
 
15
15
  ## Conformance Covered
16
16
 
17
- | Conformance |
18
- | ----------- |
19
- | WCAG 1.1.1 |
20
- | WCAG 1.2.2 |
21
- | WCAG 1.3.1 |
22
- | WCAG 1.3.5 |
23
- | WCAG 1.4.1 |
24
- | WCAG 1.4.12 |
25
- | WCAG 1.4.2 |
26
- | WCAG 1.4.3 |
27
- | WCAG 1.4.4 |
28
- | WCAG 1.4.6 |
29
- | WCAG 2.1.1 |
30
- | WCAG 2.2.1 |
31
- | WCAG 2.2.2 |
32
- | WCAG 2.2.4 |
33
- | WCAG 2.4.1 |
34
- | WCAG 2.4.2 |
35
- | WCAG 2.4.4 |
36
- | WCAG 2.4.9 |
37
- | WCAG 3.1.1 |
38
- | WCAG 3.1.2 |
39
- | WCAG 3.3.2 |
40
- | WCAG 3.2.5 |
41
- | WCAG 4.1.2 |
17
+ Note: Level AAA are disabled by default. Please specify `enable-wcag-aaa` in ruleset flag to enable AAA rules.
18
+
19
+ | Conformance | Level |
20
+ |-------------|-------|
21
+ | WCAG 1.1.1 | A |
22
+ | WCAG 1.2.2 | A |
23
+ | WCAG 1.3.1 | A |
24
+ | WCAG 1.3.5 | AA |
25
+ | WCAG 1.4.1 | A |
26
+ | WCAG 1.4.2 | A |
27
+ | WCAG 1.4.3 | AA |
28
+ | WCAG 1.4.4 | AA |
29
+ | WCAG 1.4.6 | AAA |
30
+ | WCAG 1.4.12 | AA |
31
+ | WCAG 2.1.1 | A |
32
+ | WCAG 2.2.1 | A |
33
+ | WCAG 2.2.2 | A |
34
+ | WCAG 2.2.4 | AAA |
35
+ | WCAG 2.4.1 | A |
36
+ | WCAG 2.4.2 | A |
37
+ | WCAG 2.4.4 | A |
38
+ | WCAG 2.4.9 | AAA |
39
+ | WCAG 2.5.8 | AA |
40
+ | WCAG 3.1.1 | A |
41
+ | WCAG 3.1.2 | AA |
42
+ | WCAG 3.1.5 | AAA |
43
+ | WCAG 3.2.5 | AAA |
44
+ | WCAG 3.3.2 | A |
45
+ | WCAG 4.1.2 | A |
46
+
47
+ ### Summary
48
+ | Level | Count |
49
+ |-------|-------|
50
+ | A | 15 |
51
+ | AA | 5 |
52
+ | AAA | 5 |
53
+
42
54
 
43
55
  ## WCAG 2.0 Level A
44
56
 
@@ -99,6 +111,8 @@ Details of each issue and severity rating provided by the current scan engine.
99
111
  | td-headers-attr | Ensure that each cell in a table that uses the headers attribute refers only to other cells in that table | Must Fix | WCAG 1.3.1 |
100
112
  | th-has-data-cells | Ensure that `<th>` elements and elements with role=columnheader/rowheader have data cells they describe | Must Fix | WCAG 1.3.1 |
101
113
  | video-caption | Ensures `<video>` elements have captions | Must Fix | WCAG 1.2.2 |
114
+ | oobee-confusing-alt-text | The image alt text set as 'img', 'image', 'picture', 'photo', or 'graphic' is confusing or not useful | Must Fix | WCAG 1.1.1
115
+ | oobee-accessible-label | Clickable elements (i.e. elements with mouse-click interaction) must have accessible labels. | Must Fix | WCAG 2.1.1, WCAG 4.1.2 |
102
116
 
103
117
  ## WCAG 2.0 Level AA
104
118
 
@@ -128,6 +142,7 @@ Details of each issue and severity rating provided by the current scan engine.
128
142
  | color-contrast-enhanced | Ensure the contrast between foreground and background colors meets WCAG 2 AAA enhanced contrast ratio thresholds | Must Fix | WCAG 1.4.6 |
129
143
  | identical-links-same-purpose | Ensure that links with the same accessible name serve a similar purpose | Good to Fix | WCAG 2.4.9 |
130
144
  | meta-refresh-no-exceptions | Ensure <meta http-equiv="refresh"> is not used for delayed refresh | Good to Fix | WCAG 2.2.4, WCAG 3.2.5 |
145
+ | oobee-grading-text-contents | Text content should be clear and plain to ensure that it is easily understood. | Needs Review | WCAG 3.1.5 |
131
146
 
132
147
  ## Best Practice
133
148
 
package/Dockerfile CHANGED
@@ -1,60 +1,54 @@
1
- # Use Node LTS alpine distribution
2
- FROM node:lts-alpine3.18
3
-
4
- # Installation of packages for oobee and chromium
5
- RUN apk add build-base gcompat g++ make python3 zip bash git chromium openjdk11-jre
6
-
7
- # Installation of VeraPDF
8
- RUN echo $'<?xml version="1.0" encoding="UTF-8" standalone="no"?> \n\
9
- <AutomatedInstallation langpack="eng"> \n\
10
- <com.izforge.izpack.panels.htmlhello.HTMLHelloPanel id="welcome"/> \n\
11
- <com.izforge.izpack.panels.target.TargetPanel id="install_dir"> \n\
12
- <installpath>/opt/verapdf</installpath> \n\
13
- </com.izforge.izpack.panels.target.TargetPanel> \n\
14
- <com.izforge.izpack.panels.packs.PacksPanel id="sdk_pack_select"> \n\
15
- <pack index="0" name="veraPDF GUI" selected="true"/> \n\
16
- <pack index="1" name="veraPDF Batch files" selected="true"/> \n\
17
- <pack index="2" name="veraPDF Validation model" selected="false"/> \n\
18
- <pack index="3" name="veraPDF Documentation" selected="false"/> \n\
19
- <pack index="4" name="veraPDF Sample Plugins" selected="false"/> \n\
20
- </com.izforge.izpack.panels.packs.PacksPanel> \n\
21
- <com.izforge.izpack.panels.install.InstallPanel id="install"/> \n\
22
- <com.izforge.izpack.panels.finish.FinishPanel id="finish"/> \n\
23
- </AutomatedInstallation> ' >> /opt/verapdf-auto-install-docker.xml
24
-
25
- RUN wget "https://github.com/GovTechSG/oobee/releases/download/cache/verapdf-installer.zip" -P /opt
26
- RUN unzip /opt/verapdf-installer.zip -d /opt
27
- RUN latest_version=$(ls -d /opt/verapdf-greenfield-* | sort -V | tail -n 1) && [ -n "$latest_version" ] && \
28
- "$latest_version/verapdf-install" "/opt/verapdf-auto-install-docker.xml"
29
- RUN rm -rf /opt/verapdf-installer.zip /opt/verapdf-greenfield-*
30
-
31
- # Set oobee directory
32
- WORKDIR /app
1
+ # Use Microsoft Playwright image as base image
2
+ # Node version is v22
3
+ FROM mcr.microsoft.com/playwright:v1.50.0-noble
4
+
5
+ # Installation of packages for oobee and runner
6
+ RUN apt-get update && apt-get install -y zip git
7
+
8
+ WORKDIR /app/oobee
9
+
10
+ # Clone oobee repository
11
+ # RUN git clone --branch master https://github.com/GovTechSG/oobee.git /app/oobee
33
12
 
34
- # Copy package.json to working directory, perform npm install before copying the remaining files
35
- COPY package*.json ./
13
+ # OR Copy oobee files from local directory
14
+ COPY . .
36
15
 
37
16
  # Environment variables for node and Playwright
38
17
  ENV NODE_ENV=production
39
18
  ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD="true"
40
- ENV PLAYWRIGHT_BROWSERS_PATH="/opt/ms-playwright"
41
- ENV PATH="/opt/verapdf:${PATH}"
42
19
 
43
- # Install dependencies
44
- RUN npm install --force --omit=dev
20
+ # Install oobee dependencies
21
+ RUN npm ci --omit=dev
22
+
23
+ # Compile TypeScript for oobee
24
+ RUN npm run build || true # true exits with code 0 - workaround for TS errors
45
25
 
46
26
  # Install Playwright browsers
47
- RUN npx playwright install chromium webkit
27
+ RUN npx playwright install chromium
48
28
 
49
29
  # Add non-privileged user
50
- RUN addgroup -S oobee && adduser -S -G oobee oobee
51
- RUN chown -R oobee:oobee ./
30
+ # Create a group named "purple"
31
+ RUN groupadd -r purple
52
32
 
53
- # Run everything after as non-privileged user.
54
- USER oobee
33
+ # Create a user named "purple" and assign it to the group "purple"
34
+ RUN useradd -r -g purple purple
55
35
 
56
- # Copy application and support files
57
- COPY . .
36
+ # Create a dedicated directory for the "purple" user and set permissions
37
+ RUN mkdir -p /home/purple && chown -R purple:purple /home/purple
58
38
 
59
- # Compile TypeScript
60
- RUN npm run build || true # true exits with code 0 - temp workaround until errors are resolved
39
+ WORKDIR /app
40
+
41
+ # Set the ownership of the oobee directory to the user "purple"
42
+ RUN chown -R purple:purple /app
43
+
44
+ # Copy any application and support files
45
+ # COPY . .
46
+
47
+ # Install any app dependencies for your application
48
+ # RUN npm ci --omit=dev
49
+
50
+ # For oobee to be run from present working directory, comment out as necessary
51
+ WORKDIR /app/oobee
52
+
53
+ # Run everything after as non-privileged user.
54
+ USER purple
package/INSTALLATION.md CHANGED
@@ -6,7 +6,7 @@ Oobee (CLI) is provided as a portable distribution which minimises installation
6
6
 
7
7
  Oobee is a customisable, automated accessibility testing tool that allows software development teams to find and fix accessibility problems to improve persons with disabilities (PWDs) access to digital services.
8
8
 
9
- Oobee (CLI) allows software engineers to run Oobee as part of their software development environment as the command line, as well as [integrate it into their CI/CD pipleline](https://github.com/GovTechSG/oobee/blob/master/INTEGRATION.md).
9
+ Oobee (CLI) allows software engineers to run Oobee as part of their software development environment as the command line, as well as [integrate it into their CI/CD pipleline](INTEGRATION.md).
10
10
 
11
11
  ## System Requirements
12
12