Skip to content

Commit

Permalink
changes to with repo rename (#250)
Browse files Browse the repository at this point in the history
* changes to with repo rename

* bump package number
  • Loading branch information
Thumster authored Dec 8, 2023
1 parent bba0a2f commit 0977d30
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 50 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v3
with:
path: purple-hats
path: purple-a11y

- name: Copy scripts to parent directory
run: |
cp ${{github.workspace}}/purple-hats/scripts/*.ps1 ${{github.workspace}}
cp ${{github.workspace}}/purple-hats/scripts/*.cmd ${{github.workspace}}
cp ${{github.workspace}}/purple-hats/scripts/*.xml ${{github.workspace}}
cp ${{github.workspace}}/purple-a11y/scripts/*.ps1 ${{github.workspace}}
cp ${{github.workspace}}/purple-a11y/scripts/*.cmd ${{github.workspace}}
cp ${{github.workspace}}/purple-a11y/scripts/*.xml ${{github.workspace}}
- name: Install Purple dependencies for Windows
shell: pwsh
Expand Down Expand Up @@ -56,15 +56,15 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v3
with:
path: purple-hats
path: purple-a11y

- name: Grant execute permissions for user
run: chmod ugo+rwx ./scripts/*.command ./scripts/*.sh
working-directory: purple-hats
working-directory: purple-a11y

- name: Copy scripts to parent directory
run: |
cp ./purple-hats/scripts/{*.command,*.sh,*.xml} ${{ github.workspace }}
cp ./purple-a11y/scripts/{*.command,*.sh,*.xml} ${{ github.workspace }}
- name: Install Purple dependencies for MacOS
run: |
Expand All @@ -77,8 +77,8 @@ jobs:
# Paths to the binaries you want to sign
BINARIES=(
"./purple-hats/node_modules/playwright/node_modules/fsevents/fsevents.node"
"./purple-hats/node_modules/fsevents/fsevents.node"
"./purple-a11y/node_modules/playwright/node_modules/fsevents/fsevents.node"
"./purple-a11y/node_modules/fsevents/fsevents.node"
)
# Loop through the binary paths and sign each one with a secure timestamp
Expand Down
34 changes: 17 additions & 17 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Purple A11y is a customisable, automated accessibility testing tool that allows
<summary>Click here for Windows setup instructions</summary>

#### Download Portable Copy
* Download and extract latest [purple-a11y-portable-windows.zip](https://github.com/GovTechSG/purple-hats/releases/latest/download/purple-a11y-portable-windows.zip).
* Download and extract latest [purple-a11y-portable-windows.zip](https://github.com/GovTechSG/purple-a11y/releases/latest/download/purple-a11y-portable-windows.zip).
* Tip: To extract files, right-click the Compressed zip file and click "Extract All…" in the context menu.

#### Run Purple A11y
* Navigate to the folder containing purple-a11y-portable-windows.
* Double-click `a11y_shell.cmd` (Windows Command Script file).
<img width="480" alt="Screenshot of Windows Explorer with a11y_shell.cmd selected" src="https://github.com/GovTechSG/purple-hats/assets/50561219/872c9fce-0d7f-405d-b6b6-c8a196c3e81a">
<img width="480" alt="Screenshot of Windows Explorer with a11y_shell.cmd selected" src="https://github.com/GovTechSG/purple-a11y/assets/50561219/872c9fce-0d7f-405d-b6b6-c8a196c3e81a">

* A Windows Command Prompt window should open with contents as illustrated below. `a11y_shell` will automatically prepare your system to run Purple a11y.
```
Expand All @@ -35,25 +35,25 @@ INFO: Set path to node_modules for this session
INFO: Set path to npm-global for this session
INFO: Set path to Playwright cache for this session
INFO: Set path to ImageMagick for this session
INFO: Set path to purple-hats for this session
INFO: Set path to purple-a11y for this session
PS C:\Users\username\Downloads\purple-a11y-portable-windows>
```


* Type in the following commands into the window. The following commands will navigate your Command Prompt window to the `purple-hats` sub-directory and initiate a scan
* Type in the following commands into the window. The following commands will navigate your Command Prompt window to the `purple-a11y` sub-directory and initiate a scan
```
cd purple-hats
cd purple-a11y
node index
```
* If a Windows Firewall prompt appears, click "Allow access"
<img width="261" alt="Windows Firewall prompt for Allow access" src="https://github.com/GovTechSG/purple-hats/assets/50561219/4ece401b-1195-4a90-a327-243c081690b9">
<img width="261" alt="Windows Firewall prompt for Allow access" src="https://github.com/GovTechSG/purple-a11y/assets/50561219/4ece401b-1195-4a90-a327-243c081690b9">

* You should then see your Windows Command Prompt window updated with the following contents
```
PS C:\Users\username\Downloads\purple-a11y-portable-windows> cd purple-hats
PS C:\Users\username\Downloads\purple-a11y-portable-windows\purple-hats> node index
PS C:\Users\username\Downloads\purple-a11y-portable-windows> cd purple-a11y
PS C:\Users\username\Downloads\purple-a11y-portable-windows\purple-a11y> node index
┌────────────────────────────────────────────────────────────┐
│ Welcome to A11y Accessibility Testing Tool! │
│ We recommend using Chrome browser for the best experience. │
Expand All @@ -66,7 +66,7 @@ PS C:\Users\username\Downloads\purple-a11y-portable-windows\purple-hats> node in
custom flow
```

* Follow the steps at [Features](https://github.com/GovTechSG/purple-hats#features) for more information on how to run a scan.
* Follow the steps at [Features](https://github.com/GovTechSG/purple-a11y#features) for more information on how to run a scan.

</details>

Expand All @@ -75,16 +75,16 @@ PS C:\Users\username\Downloads\purple-a11y-portable-windows\purple-hats> node in
<summary>Click here for MacOS setup instructions</summary>

#### Download Portable Copy
* Download and extract [purple-a11y-portable-mac.zip](https://github.com/GovTechSG/purple-hats/releases/latest/download/purple-a11y-portable-mac.zip) version.
* Download and extract [purple-a11y-portable-mac.zip](https://github.com/GovTechSG/purple-a11y/releases/latest/download/purple-a11y-portable-mac.zip) version.
* Tip: To extract files in Mac, double-click on `purple-a11y-portable-mac.zip` file, usually located at your Downloads folder. A new folder with the name `purple-a11y-portable-mac` will appear in Finder.

#### Run Purple A11y
* Navigate to the folder `purple-a11y-portable-mac`, usually located at your Downloads folder.
* Right-click `a11y_shell.command`. Then click `Open` in the context menu.
<img width="480" alt="Screenshot of right-click a11y_shell.command and Open" src="https://github.com/GovTechSG/purple-hats/assets/152410523/15a0f577-c8c4-43e2-9c9d-ca4b960b8874">
<img width="480" alt="Screenshot of right-click a11y_shell.command and Open" src="https://github.com/GovTechSG/purple-a11y/assets/152410523/15a0f577-c8c4-43e2-9c9d-ca4b960b8874">

* A prompt as follows will appear like below. Click `Open`.
<img width="240" alt="MacOS prompt for unidentified developer" src="https://github.com/GovTechSG/purple-hats/assets/152410523/85eb0d58-8dd9-477c-916a-b759cfb1afd6">
<img width="240" alt="MacOS prompt for unidentified developer" src="https://github.com/GovTechSG/purple-a11y/assets/152410523/85eb0d58-8dd9-477c-916a-b759cfb1afd6">

* A Terminal window should open with contents as illustrated below. `a11y_shell` will automatically prepare your system to run Purple A11y.
```
Expand All @@ -103,16 +103,16 @@ INFO: Removing com.apple.quarantine attributes for required binaries to run
username@hostname purple-a11y-portable-mac %
```

* Type in the following commands into the window. The following commands will navigate your Terminal window to the `purple-hats` sub-directory and initiate a scan
* Type in the following commands into the window. The following commands will navigate your Terminal window to the `purple-a11y` sub-directory and initiate a scan
```
cd purple-hats
cd purple-a11y
node index
```

* You should then see your Terminal window updated with the following contents
```
username@hostname purple-a11y-portable-mac % cd purple-hats
username@hostname purple-hats % node index
username@hostname purple-a11y-portable-mac % cd purple-a11y
username@hostname purple-a11y % node index
┌────────────────────────────────────────────────────────────┐
│ Welcome to A11y Accessibility Testing Tool! │
│ We recommend using Chrome browser for the best experience. │
Expand All @@ -125,5 +125,5 @@ username@hostname purple-hats % node index
custom flow
```

* Follow the steps at [Features](https://github.com/GovTechSG/purple-hats#features) for more information on how to run a scan.
* Follow the steps at [Features](https://github.com/GovTechSG/purple-a11y#features) for more information on how to run a scan.
</details>
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ node cli.js -c 2 -o a11y-scan-results.zip -u http://localhost:8000 -w 360
```
## Accessibility Scan Results
For details on which accessibility scan results trigger "Must Fix" / "Good to Fix" findings, you may refer to [Scan Issue Details](https://github.com/GovTechSG/purple-hats/blob/master/DETAILS.md).
For details on which accessibility scan results trigger "Must Fix" / "Good to Fix" findings, you may refer to [Scan Issue Details](https://github.com/GovTechSG/purple-a11y/blob/master/DETAILS.md).
## Troubleshooting
Expand All @@ -456,7 +456,7 @@ SyntaxError: Invalid regular expression: /https?://(www\.)?[\p{L}0-9][-\p{L}0-9@
**Issue**: When you switch between different versions of Node.js in your environment, you may face the following error.
```shell
<user_path>/purple-hats/node_modules/bindings/bindings.js:91
<user_path>/purple-a11y/node_modules/bindings/bindings.js:91
throw e
^
Expand All @@ -475,11 +475,11 @@ the module (for instance, using `npm rebuild` or `npm install`).
```shell
dyld: lazy symbol binding failed: Symbol not found: __ZN2v87Isolate37AdjustAmountOfExternalAllocatedMemoryEx
Referenced from: <user_path>/purple-hats/node_modules/libxmljs/build/Release/xmljs.node
Referenced from: <user_path>/purple-a11y/node_modules/libxmljs/build/Release/xmljs.node
Expected in: flat namespace
dyld: Symbol not found: __ZN2v87Isolate37AdjustAmountOfExternalAllocatedMemoryEx
Referenced from: <user_path>/PURPLE_A11y/purple-hats/node_modules/libxmljs/build/Release/xmljs.node
Referenced from: <user_path>/PURPLE_A11y/purple-a11y/node_modules/libxmljs/build/Release/xmljs.node
Expected in: flat namespace
zsh: abort node index.js
Expand Down
4 changes: 2 additions & 2 deletions gitlab-pipeline-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ variables:
# A11Y_SCAN_TYPE: [choices: "sitemap", "website"]
A11Y_SCAN_TYPE: "website"
# A11Y_SCAN_DEVICE: "Desktop"
# A full list of devices is available at https://github.com/GovTechSG/purple-hats#mobile-device-options
# A full list of devices is available at https://github.com/GovTechSG/purple-a11y#mobile-device-options
A11Y_SCAN_DEVICE: "Desktop"
# A11Y_SCAN_MAX_NUM_PAGES: 100
A11Y_SCAN_MAX_NUM_PAGES: 100
Expand All @@ -18,7 +18,7 @@ a11y-scan:
tags:
# - some tag
image:
name: <some registry>/purple-hats:latest
name: <some registry>/purple-a11y:latest
entrypoint: [ "/bin/bash", "-lc" ]
script:
- cd /app
Expand Down
4 changes: 2 additions & 2 deletions 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
@@ -1,7 +1,7 @@
{
"name": "@govtechsg/purple-hats",
"main": "npmIndex.js",
"version": "0.9.37",
"version": "0.9.38",
"type": "module",
"imports": {
"#root/*.js": "./*.js"
Expand Down
2 changes: 1 addition & 1 deletion playwrightAxeGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ const waitForCaptcha = async (page, captchaLocator) => {

let customFlowScripts = './custom_flow_scripts';
// if (process.env.RUNNING_FROM_PH_GUI && os.platform() === 'darwin') {
// customFlowScripts = './Purple A11y Backend/purple-hats/custom_flow_scripts';
// customFlowScripts = './Purple A11y Backend/purple-a11y/custom_flow_scripts';
// } else {
// customFlowScripts = './custom_flow_scripts'
// }
Expand Down
4 changes: 2 additions & 2 deletions scripts/a11y_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fi
export PATH="$PATH_TO_NODE:$PATH"

echo "INFO: Set path to node_modules for this session"
if find ./purple-hats -name "node_modules" -maxdepth 1 -type l -ls &> /dev/null; then
export PATH="$PWD/purple-hats/node_modules/.bin:$PATH"
if find ./purple-a11y -name "node_modules" -maxdepth 1 -type l -ls &> /dev/null; then
export PATH="$PWD/purple-a11y/node_modules/.bin:$PATH"
else
export PATH="$PWD/node_modules/.bin:$PATH"
fi
Expand Down
10 changes: 5 additions & 5 deletions scripts/a11y_shell_ps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ $env:Path = "$env:JAVA_HOME\bin;$env:Path"
echo "INFO: Set path to VeraPDF for this session"
$env:Path = "$path_to_hats\verapdf;$env:Path"

if (Test-Path purple-hats) {
echo "INFO: Set path to purple-hats for this session"
$env:Path = "$path_to_hats\purple-hats;$env:Path"
if (Test-Path purple-a11y) {
echo "INFO: Set path to purple-a11y for this session"
$env:Path = "$path_to_hats\purple-a11y;$env:Path"
} else {
if (Test-Path package.json) {
echo "INFO: Set path to purple-hats for this session"
echo "INFO: Set path to purple-a11y for this session"
$env:Path = "$path_to_hats;$env:Path"
} else {
Write-Output "Could not find purple-hats"
Write-Output "Could not find purple-a11y"
}
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/install_purple_dependencies.command
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ fi

source "${__dir}/a11y_shell.sh"

if ! [ -f package.json ] && [ -d purple-hats ]; then
cd purple-hats
if ! [ -f package.json ] && [ -d purple-a11y ]; then
cd purple-a11y
fi

if [ -d "node_modules" ]; then
Expand Down
10 changes: 5 additions & 5 deletions scripts/install_purple_dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ if (Test-Path -Path .\jdk -PathType Container) {
}

# Install Node dependencies
if (Test-Path purple-hats) {
if (Test-Path purple-a11y) {
Write-Output "Installing node dependencies"
& ".\a11y_shell_ps.ps1" "cd purple-hats;npm ci --force"
& ".\a11y_shell_ps.ps1" "cd purple-a11y;npm ci --force"

# Omit installing Playwright browsers as it is not reuqired
# Write-Output "Install Playwright browsers"
# & ".\a11y_shell_ps.ps1" "npx playwright install chromium"

if (Test-Path purple-hats\.git) {
if (Test-Path purple-a11y\.git) {
Write-Output "Unhide .git folder"
attrib -s -h purple-hats\.git
attrib -s -h purple-a11y\.git
}

} else {
Expand All @@ -91,6 +91,6 @@ if (Test-Path purple-hats) {
}

} else {
Write-Output "Could not find purple-hats"
Write-Output "Could not find purple-a11y"
}
}

0 comments on commit 0977d30

Please sign in to comment.