Skip to content

Commit e653250

Browse files
authored
Create separate artifacts for screen reader binaries (#9)
1 parent edb37b5 commit e653250

File tree

832 files changed

+488
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

832 files changed

+488
-22
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export SRTL_DEV=true

.github/workflows/ci.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ defaults:
1616
jobs:
1717
test:
1818
runs-on: windows-latest
19+
env:
20+
SRTL_DEV: true
1921

2022
steps:
2123
- uses: actions/checkout@v2
@@ -30,32 +32,40 @@ jobs:
3032
- run: yarn test:ci
3133
- name: "examples/node/test.example.ps1"
3234
run: |
35+
# Required config
3336
# The path you cloned this repository to
3437
$REPO_PATH = "${{ github.workspace }}"
38+
39+
# Optional config
3540
# The path where NVDA speech output is logged. Need read/write access.
3641
$LOG_FILE_PATH = "$REPO_PATH\nvda-node.log"
42+
# The path where your package manager installed the "screen-reader-testing-library" package.
43+
$PACKAGE_PATH = "$REPO_PATH\node_modules\screen-reader-testing-library"
3744
3845
# End of configuration. Changing anything below at your own risk
39-
$NVDA_VENDOR = "$REPO_PATH\src\nvda"
40-
$NVDA_BIN = "$NVDA_VENDOR\portable\nvda.exe"
41-
& $NVDA_BIN --log-file=$LOG_FILE_PATH --config-path=$NVDA_VENDOR\settings
46+
$NVDA_BIN = "$PACKAGE_PATH\bin\nvda.ps1"
47+
& $NVDA_BIN -logFile $LOG_FILE_PATH
4248
node $REPO_PATH\examples\node\index.js $LOG_FILE_PATH
43-
& $NVDA_BIN -q
49+
& $NVDA_BIN -quit
4450
4551
- name: "examples/jest/test.example.ps1"
4652
run: |
53+
# Required config
4754
# The path you cloned this repository to
4855
$REPO_PATH = "${{ github.workspace }}"
56+
57+
# Optional config
4958
# The path where NVDA speech output is logged. Need read/write access.
5059
$LOG_FILE_PATH = "$REPO_PATH\nvda-jest.log"
60+
# The path where your package manager installed the "screen-reader-testing-library" package.
61+
$PACKAGE_PATH = "$REPO_PATH\node_modules\screen-reader-testing-library"
5162
5263
# End of configuration. Changing anything below at your own risk
53-
$NVDA_VENDOR = "$REPO_PATH\src\nvda"
54-
$NVDA_BIN = "$NVDA_VENDOR\portable\nvda.exe"
64+
$NVDA_BIN = "$PACKAGE_PATH\bin\nvda.ps1"
5565
$Env:LOG_FILE_PATH = $LOG_FILE_PATH
56-
& $NVDA_BIN --log-file=$Env:LOG_FILE_PATH --config-path=$NVDA_VENDOR\settings
66+
& $NVDA_BIN -logFilePath $Env:LOG_FILE_PATH
5767
yarn jest -c $REPO_PATH\examples\jest\jest.config.js
58-
& $NVDA_BIN -q
68+
& $NVDA_BIN -quit
5969
- uses: actions/upload-artifact@v2
6070
if: ${{ always() }}
6171
with:

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
/.env
12
node_modules/
23
/nvda.log
34
/nvda-old.log
4-
test.ps1
5+
/vendor/*.zip

CONTRIBUTING.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Contributing
22

3+
Before you install you need to make sure the install script uses the checked-in version of NVDA.
4+
You have to set the environment variable `SRTL_DEV` to `true` before you install local packages.
5+
Otherwise it will download the binaries from a the GitHub release for the currently checked out version of this library.
6+
7+
```bash
8+
$ source .env.example
9+
$ yarn
10+
```
11+
312
## Common workflows
413

514
### Bump NVDA

examples/jest/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ An example using jest as a test runner.
44

55
## Installation
66

7+
- Windows with powershell
78
- node 14.x
89
- install dependencies via `yarn`
9-
- NVDA `2020.2`
1010

1111
## Getting started
1212

examples/jest/test.example.ps1

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
# Required config
12
# The path you cloned this repository to
23
$REPO_PATH = "C:\Users\eps1lon\Development\nvda-snapshot-testing"
4+
5+
# Optional config
36
# The path where NVDA speech output is logged. Need read/write access.
47
$LOG_FILE_PATH = "$REPO_PATH\nvda.log"
8+
# The path where your package manager installed the "screen-reader-testing-library" package.
9+
$PACKAGE_PATH = "$REPO_PATH\node_modules\screen-reader-testing-library"
510

611
# End of configuration. Changing anything below at your own risk
7-
$NVDA_VENDOR = "$REPO_PATH\src\nvda"
8-
$NVDA_BIN = "$NVDA_VENDOR\portable\nvda.exe"
12+
$NVDA_BIN = "$PACKAGE_PATH\bin\nvda.ps1"
913
$Env:LOG_FILE_PATH = $LOG_FILE_PATH
10-
& $NVDA_BIN --log-file=$Env:LOG_FILE_PATH --config-path=$NVDA_VENDOR\settings
14+
& $NVDA_BIN -logFilePath $Env:LOG_FILE_PATH
1115
yarn jest -c $REPO_PATH\examples\jest\jest.config.js
12-
& $NVDA_BIN -q
16+
& $NVDA_BIN -quit

examples/node/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ This is the initial prototype for this project.
44

55
## Installation
66

7+
- Windows with powershell
78
- node 14.x
89
- install dependencies via `yarn`
9-
- NVDA `2020.2`
1010

1111
## Getting started
1212

examples/node/test.example.ps1

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
# Required config
12
# The path you cloned this repository to
23
$REPO_PATH = "C:\Users\eps1lon\Development\nvda-snapshot-testing"
4+
5+
# Optional config
36
# The path where NVDA speech output is logged. Need read/write access.
47
$LOG_FILE_PATH = "$REPO_PATH\nvda.log"
8+
# The path where your package manager installed the "screen-reader-testing-library" package.
9+
$PACKAGE_PATH = "$REPO_PATH\node_modules\screen-reader-testing-library"
510

611
# End of configuration. Changing anything below at your own risk
7-
$NVDA_VENDOR = "$REPO_PATH\src\nvda"
8-
$NVDA_BIN = "$NVDA_VENDOR\portable\nvda.exe"
9-
& $NVDA_BIN --log-file=$LOG_FILE_PATH --config-path=$NVDA_VENDOR\settings
12+
$NVDA_BIN = "$PACKAGE_PATH\bin\nvda.ps1"
13+
& $NVDA_BIN -logFile $LOG_FILE_PATH
1014
node $REPO_PATH\examples\node\index.js $LOG_FILE_PATH
11-
& $NVDA_BIN -q
15+
& $NVDA_BIN -quit

src/bin/nvda.ps1

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
param ([switch] $quit, $logFilePath)
2+
3+
$CACHE_DIR = "$HOME\AppData\Local\screen-reader-testing-library"
4+
$NVDA_VENDOR = "$CACHE_DIR\screen-readers\nvda-2020.3"
5+
$NVDA_BIN = "$NVDA_VENDOR\portable\nvda.exe"
6+
7+
if ($logFilePath) {
8+
& $NVDA_BIN --config-path=$NVDA_VENDOR\settings --log-file=$logFilePath
9+
}
10+
elseif ($quit) {
11+
& $NVDA_BIN -q
12+
}
13+
else {
14+
throw "Either pass a -logFilePath or -quit NVDA."
15+
}

0 commit comments

Comments
 (0)