@govtechsg/oobee 0.10.20

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 (123) hide show
  1. package/.dockerignore +22 -0
  2. package/.github/pull_request_template.md +11 -0
  3. package/.github/workflows/docker-test.yml +54 -0
  4. package/.github/workflows/image.yml +107 -0
  5. package/.github/workflows/publish.yml +18 -0
  6. package/.idea/modules.xml +8 -0
  7. package/.idea/purple-a11y.iml +9 -0
  8. package/.idea/vcs.xml +6 -0
  9. package/.prettierrc.json +12 -0
  10. package/.vscode/extensions.json +5 -0
  11. package/.vscode/settings.json +10 -0
  12. package/CODE_OF_CONDUCT.md +128 -0
  13. package/DETAILS.md +163 -0
  14. package/Dockerfile +60 -0
  15. package/INSTALLATION.md +146 -0
  16. package/INTEGRATION.md +785 -0
  17. package/LICENSE +22 -0
  18. package/README.md +587 -0
  19. package/SECURITY.md +5 -0
  20. package/__mocks__/mock-report.html +1431 -0
  21. package/__mocks__/mockFunctions.ts +32 -0
  22. package/__mocks__/mockIssues.ts +64 -0
  23. package/__mocks__/mock_all_issues/000000001.json +64 -0
  24. package/__mocks__/mock_all_issues/000000002.json +53 -0
  25. package/__mocks__/mock_all_issues/fake-file.txt +0 -0
  26. package/__tests__/logs.test.ts +25 -0
  27. package/__tests__/mergeAxeResults.test.ts +278 -0
  28. package/__tests__/utils.test.ts +118 -0
  29. package/a11y-scan-results.zip +0 -0
  30. package/eslint.config.js +53 -0
  31. package/exclusions.txt +2 -0
  32. package/gitlab-pipeline-template.yml +54 -0
  33. package/jest.config.js +1 -0
  34. package/package.json +96 -0
  35. package/scripts/copyFiles.js +44 -0
  36. package/scripts/install_oobee_dependencies.cmd +13 -0
  37. package/scripts/install_oobee_dependencies.command +101 -0
  38. package/scripts/install_oobee_dependencies.ps1 +110 -0
  39. package/scripts/oobee_shell.cmd +13 -0
  40. package/scripts/oobee_shell.command +11 -0
  41. package/scripts/oobee_shell.sh +55 -0
  42. package/scripts/oobee_shell_ps.ps1 +54 -0
  43. package/src/cli.ts +401 -0
  44. package/src/combine.ts +240 -0
  45. package/src/constants/__tests__/common.test.ts +44 -0
  46. package/src/constants/cliFunctions.ts +305 -0
  47. package/src/constants/common.ts +1840 -0
  48. package/src/constants/constants.ts +443 -0
  49. package/src/constants/errorMeta.json +319 -0
  50. package/src/constants/itemTypeDescription.ts +11 -0
  51. package/src/constants/oobeeAi.ts +141 -0
  52. package/src/constants/questions.ts +181 -0
  53. package/src/constants/sampleData.ts +187 -0
  54. package/src/crawlers/__tests__/commonCrawlerFunc.test.ts +51 -0
  55. package/src/crawlers/commonCrawlerFunc.ts +656 -0
  56. package/src/crawlers/crawlDomain.ts +877 -0
  57. package/src/crawlers/crawlIntelligentSitemap.ts +156 -0
  58. package/src/crawlers/crawlLocalFile.ts +193 -0
  59. package/src/crawlers/crawlSitemap.ts +356 -0
  60. package/src/crawlers/custom/extractAndGradeText.ts +57 -0
  61. package/src/crawlers/custom/flagUnlabelledClickableElements.ts +964 -0
  62. package/src/crawlers/custom/utils.ts +486 -0
  63. package/src/crawlers/customAxeFunctions.ts +82 -0
  64. package/src/crawlers/pdfScanFunc.ts +468 -0
  65. package/src/crawlers/runCustom.ts +117 -0
  66. package/src/index.ts +173 -0
  67. package/src/logs.ts +66 -0
  68. package/src/mergeAxeResults.ts +964 -0
  69. package/src/npmIndex.ts +284 -0
  70. package/src/screenshotFunc/htmlScreenshotFunc.ts +411 -0
  71. package/src/screenshotFunc/pdfScreenshotFunc.ts +762 -0
  72. package/src/static/ejs/partials/components/categorySelector.ejs +4 -0
  73. package/src/static/ejs/partials/components/categorySelectorDropdown.ejs +57 -0
  74. package/src/static/ejs/partials/components/pagesScannedModal.ejs +70 -0
  75. package/src/static/ejs/partials/components/reportSearch.ejs +47 -0
  76. package/src/static/ejs/partials/components/ruleOffcanvas.ejs +105 -0
  77. package/src/static/ejs/partials/components/scanAbout.ejs +263 -0
  78. package/src/static/ejs/partials/components/screenshotLightbox.ejs +13 -0
  79. package/src/static/ejs/partials/components/summaryScanAbout.ejs +141 -0
  80. package/src/static/ejs/partials/components/summaryScanResults.ejs +16 -0
  81. package/src/static/ejs/partials/components/summaryTable.ejs +20 -0
  82. package/src/static/ejs/partials/components/summaryWcagCompliance.ejs +94 -0
  83. package/src/static/ejs/partials/components/topFive.ejs +6 -0
  84. package/src/static/ejs/partials/components/wcagCompliance.ejs +70 -0
  85. package/src/static/ejs/partials/footer.ejs +21 -0
  86. package/src/static/ejs/partials/header.ejs +230 -0
  87. package/src/static/ejs/partials/main.ejs +40 -0
  88. package/src/static/ejs/partials/scripts/bootstrap.ejs +8 -0
  89. package/src/static/ejs/partials/scripts/categorySelectorDropdownScript.ejs +190 -0
  90. package/src/static/ejs/partials/scripts/categorySummary.ejs +141 -0
  91. package/src/static/ejs/partials/scripts/highlightjs.ejs +335 -0
  92. package/src/static/ejs/partials/scripts/popper.ejs +7 -0
  93. package/src/static/ejs/partials/scripts/reportSearch.ejs +248 -0
  94. package/src/static/ejs/partials/scripts/ruleOffcanvas.ejs +801 -0
  95. package/src/static/ejs/partials/scripts/screenshotLightbox.ejs +71 -0
  96. package/src/static/ejs/partials/scripts/summaryScanResults.ejs +14 -0
  97. package/src/static/ejs/partials/scripts/summaryTable.ejs +78 -0
  98. package/src/static/ejs/partials/scripts/utils.ejs +441 -0
  99. package/src/static/ejs/partials/styles/bootstrap.ejs +12375 -0
  100. package/src/static/ejs/partials/styles/highlightjs.ejs +54 -0
  101. package/src/static/ejs/partials/styles/styles.ejs +1843 -0
  102. package/src/static/ejs/partials/styles/summaryBootstrap.ejs +12458 -0
  103. package/src/static/ejs/partials/summaryHeader.ejs +70 -0
  104. package/src/static/ejs/partials/summaryMain.ejs +75 -0
  105. package/src/static/ejs/report.ejs +420 -0
  106. package/src/static/ejs/summary.ejs +47 -0
  107. package/src/static/mustache/.prettierrc +4 -0
  108. package/src/static/mustache/Attention Deficit.mustache +11 -0
  109. package/src/static/mustache/Blind.mustache +11 -0
  110. package/src/static/mustache/Cognitive.mustache +7 -0
  111. package/src/static/mustache/Colorblindness.mustache +20 -0
  112. package/src/static/mustache/Deaf.mustache +12 -0
  113. package/src/static/mustache/Deafblind.mustache +7 -0
  114. package/src/static/mustache/Dyslexia.mustache +14 -0
  115. package/src/static/mustache/Low Vision.mustache +7 -0
  116. package/src/static/mustache/Mobility.mustache +15 -0
  117. package/src/static/mustache/Sighted Keyboard Users.mustache +42 -0
  118. package/src/static/mustache/report.mustache +1709 -0
  119. package/src/types/print-message.d.ts +28 -0
  120. package/src/types/types.ts +46 -0
  121. package/src/types/xpath-to-css.d.ts +3 -0
  122. package/src/utils.ts +332 -0
  123. package/tsconfig.json +15 -0
@@ -0,0 +1,146 @@
1
+ # Installation Guide
2
+
3
+ Oobee (CLI) is provided as a portable distribution which minimises installation steps required for Windows and Mac.
4
+
5
+ ## About Oobee (CLI)
6
+
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
+
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).
10
+
11
+ ## System Requirements
12
+
13
+ - Oobee (CLI) can run on MacOS version 12 Monterey or above, and a [supported](https://learn.microsoft.com/en-us/windows/release-health/supported-versions-windows-client) version of Windows 10 (64-bit) or Windows 11.
14
+ - Google Chrome browser is [installed](https://www.google.com/chrome).
15
+ - One-time Internet access is needed to download and install Oobee (CLI).
16
+ - You are recommended to be logged on to an admin user to run Oobee (CLI).
17
+
18
+ ## Windows
19
+
20
+ <details>
21
+ <summary>Click here for Windows setup instructions</summary>
22
+
23
+ ### Download Portable Copy
24
+
25
+ - Download and extract latest [oobee-portable-windows.zip](https://github.com/GovTechSG/oobee/releases/latest/download/oobee-portable-windows.zip).
26
+ - Tip: To extract files, right-click the Compressed zip file and click "Extract All…" in the context menu.
27
+
28
+ ### Run Oobee (CLI)
29
+
30
+ - Navigate to the folder containing Oobee (CLI)-portable-windows.
31
+ - Double-click `Oobee (CLI)_shell.cmd` (Windows Command Script file).
32
+ <img width="480" alt="Screenshot of Windows Explorer with oobee_shell.cmd selected" src="https://github.com/GovTechSG/oobee/assets/50561219/872c9fce-0d7f-405d-b6b6-c8a196c3e81a">
33
+
34
+ - A Windows Command Prompt window should open with contents as illustrated below. `oobee_shell` will automatically prepare your system to run Oobee (CLI).
35
+
36
+ ```
37
+ oobee Shell - Created By younglim - NO WARRANTY PROVIDED
38
+ ================================================================
39
+
40
+ INFO: Stored current working directory at C:\Users\oobee\Downloads\oobee-portable-windows
41
+ INFO: Set path to node for this session
42
+ INFO: Set path to node_modules for this session
43
+ INFO: Set path to npm-global for this session
44
+ INFO: Set path to Playwright cache for this session
45
+ INFO: Set path to ImageMagick for this session
46
+ INFO: Set path to oobee for this session
47
+
48
+
49
+ PS C:\Users\username\Downloads\oobee-portable-windows>
50
+ ```
51
+
52
+ - Type in the following commands into the window. The following commands will navigate your Command Prompt window to the `oobee` sub-directory and initiate a scan
53
+
54
+ ```
55
+ cd oobee
56
+ npm start
57
+ ```
58
+
59
+ - If a Windows Firewall prompt appears, if you have administrator rights, click "Allow" or "Allow access". Click "Cancel" if you do not have administrator rights.
60
+ <img width="261" alt="Newer Windows Firewall prompt for Allow" src="https://github.com/GovTechSG/oobee/assets/50561219/4ece401b-1195-4a90-a327-243c081690b9">
61
+ <img width="331" alt="Windows Firewall prompt for Allow access" src="https://github.com/GovTechSG/oobee/assets/2021525/d6d435c4-f534-4416-b418-a8b8e15f3b3f">
62
+
63
+ - You should then see your Windows Command Prompt window updated with the following contents
64
+
65
+ ```
66
+ PS C:\Users\username\Downloads\oobee-portable-windows> cd oobee
67
+ PS C:\Users\username\Downloads\oobee-portable-windows\oobee> npm start
68
+ ┌────────────────────────────────────────────────────────────┐
69
+ │ Welcome to A11y Accessibility Testing Tool! │
70
+ │ We recommend using Chrome browser for the best experience. │
71
+ │ │
72
+ │ Version: ░░░░░░ │
73
+ └────────────────────────────────────────────────────────────┘
74
+ ? What would you like to scan today? (Use arrow keys)
75
+ > sitemap
76
+ website
77
+ custom flow
78
+ ```
79
+
80
+ - Follow the steps at [Features](https://github.com/GovTechSG/oobee#features) for more information on how to run a scan.
81
+
82
+ </details>
83
+
84
+ ## MacOS
85
+
86
+ <details>
87
+ <summary>Click here for MacOS setup instructions</summary>
88
+
89
+ ### Download Portable Copy
90
+
91
+ - Download and extract [oobee-portable-mac.zip](https://github.com/GovTechSG/oobee/releases/latest/download/oobee-portable-mac.zip) version.
92
+ - Tip: To extract files in Mac, double-click on `oobee-portable-mac.zip` file, usually located at your Downloads folder. A new folder with the name `oobee-portable-mac` will appear in Finder.
93
+
94
+ ### Run Oobee (CLI)
95
+
96
+ - Navigate to the folder `oobee-portable-mac`, usually located at your Downloads folder.
97
+ - Right-click `oobee_shell.command`. Then click `Open` in the context menu.
98
+ <img width="480" alt="Screenshot of right-click oobee_shell.command and Open" src="https://github.com/GovTechSG/oobee/assets/152410523/15a0f577-c8c4-43e2-9c9d-ca4b960b8874">
99
+
100
+ - A prompt as follows will appear like below. Click `Open`.
101
+ <img width="240" alt="MacOS prompt for unidentified developer" src="https://github.com/GovTechSG/oobee/assets/152410523/85eb0d58-8dd9-477c-916a-b759cfb1afd6">
102
+
103
+ - A Terminal window should open with contents as illustrated below. `oobee_shell` will automatically prepare your system to run Oobee (CLI).
104
+
105
+ ```
106
+ Last login: Thu Mar 16 10:48:05 on ttys002
107
+ /Users/username/Downloads/oobee-portable-mac/oobee_shell.command ; exit;
108
+ username@hostname ~ % /Users/username/Downloads/oobee-portable-mac/oobee_shell.command ; exit;
109
+ oobee Shell - Created By younglim - NO WARRANTY PROVIDED
110
+ ================================================================
111
+
112
+ INFO: Setting path to node for this session
113
+ INFO: Set path to node_modules for this session
114
+ INFO: Set path to Playwright cache for this session
115
+ INFO: Set symbolic link to ImageMagick
116
+ INFO: Set path to ImageMagick binaries
117
+ INFO: Removing com.apple.quarantine attributes for required binaries to run
118
+ username@hostname oobee-portable-mac %
119
+ ```
120
+
121
+ - Type in the following commands into the window. The following commands will navigate your Terminal window to the `oobee` sub-directory and initiate a scan
122
+
123
+ ```
124
+ cd oobee
125
+ npm start
126
+ ```
127
+
128
+ - You should then see your Terminal window updated with the following contents
129
+
130
+ ```
131
+ username@hostname oobee-portable-mac % cd oobee
132
+ username@hostname oobee % npm start
133
+ ┌────────────────────────────────────────────────────────────┐
134
+ │ Welcome to A11y Accessibility Testing Tool! │
135
+ │ We recommend using Chrome browser for the best experience. │
136
+ │ │
137
+ │ Version: ░░░░░░ │
138
+ └────────────────────────────────────────────────────────────┘
139
+ ? What would you like to scan today? (Use arrow keys)
140
+ ❯ sitemap
141
+ website
142
+ custom flow
143
+ ```
144
+
145
+ - Follow the steps at [Features](https://github.com/GovTechSG/Oobee (CLI)#features) for more information on how to run a scan.
146
+ </details>