Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(java-accessibility-checker): Create new accessibility-checker package for Java #1983

Merged
merged 78 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
407cce8
Starter project
tombrunet Aug 2, 2024
7253048
Basic config files
tombrunet Aug 3, 2024
eb86a47
Config starter
tombrunet Aug 6, 2024
86ce40c
Merge branch 'master' into java2
tombrunet Aug 6, 2024
2936c7d
Process config files
tombrunet Aug 6, 2024
62c5400
Report signs of life
tombrunet Aug 7, 2024
5464d6c
First report
tombrunet Aug 8, 2024
fc99aa0
Baselines
tombrunet Aug 9, 2024
603b3a0
Scan summaries
tombrunet Aug 9, 2024
3cf03d4
Add jar build
tombrunet Aug 9, 2024
5b9c6c0
Merge branch 'master' into java2
tombrunet Aug 12, 2024
c4dd394
Merge branch 'master' into java2
tombrunet Aug 12, 2024
6ef30e8
Java test suite
tombrunet Aug 12, 2024
d363138
Add java test to PRs
tombrunet Aug 12, 2024
105622d
Make headless
tombrunet Aug 12, 2024
f7f0e3e
Git chromedriver
tombrunet Aug 12, 2024
1fc3cd5
debug
tombrunet Aug 12, 2024
72538c9
Add env
tombrunet Aug 12, 2024
b796bc7
Chrome driver dir
tombrunet Aug 12, 2024
cf70577
headless new
tombrunet Aug 12, 2024
c744a8f
debug
tombrunet Aug 12, 2024
71c19bf
debug
tombrunet Aug 12, 2024
3dd7077
Debug
tombrunet Aug 13, 2024
a18ad31
Set bin path
tombrunet Aug 13, 2024
ab39215
Fix test
tombrunet Aug 13, 2024
e70ef31
Output progress
tombrunet Aug 13, 2024
2458c28
change path
tombrunet Aug 13, 2024
b03f45f
Metrics and copyright
tombrunet Aug 13, 2024
f332d65
Don't record our own tests
tombrunet Aug 13, 2024
7d14a3a
Javadoc updates
tombrunet Aug 13, 2024
0af9784
Basic javadoc cleanup
tombrunet Aug 13, 2024
9464e4c
Test build
tombrunet Aug 13, 2024
92e73ab
yaml syntax
tombrunet Aug 13, 2024
cdaa7e3
working directory
tombrunet Aug 13, 2024
577b31c
Generate pom
tombrunet Aug 13, 2024
f7b122b
package write
tombrunet Aug 13, 2024
2f96ca1
switch token
tombrunet Aug 13, 2024
3362244
Generate pom
tombrunet Aug 13, 2024
d4e666f
Wrong gradle?
tombrunet Aug 13, 2024
b798ccc
creds
tombrunet Aug 13, 2024
eafb554
Add boilerplate
tombrunet Aug 13, 2024
e9fe1d1
Move files into equalaccess sub namespace
tombrunet Aug 13, 2024
d448817
Change boilerplate dependency version
tombrunet Aug 13, 2024
ef779d9
Flip expected, actual
tombrunet Aug 13, 2024
8ab3157
More isolation of selenium dependency
tombrunet Aug 14, 2024
255c209
CSV report / memory improvements
tombrunet Aug 15, 2024
a3d937a
A minimal issue params to the help urls
tombrunet Aug 15, 2024
0eb83ff
Tighten dependencies, IOException
tombrunet Aug 16, 2024
a6624cf
Tweak dependencies to not include selenium
tombrunet Aug 16, 2024
a011155
Handle large result
tombrunet Aug 24, 2024
60c3f7a
Debug
tombrunet Aug 24, 2024
6618d1a
Merge branch 'master' into java2
tombrunet Aug 24, 2024
00bfa8a
Switch from gradle to maven
tombrunet Sep 4, 2024
66f5921
fix maven test
tombrunet Sep 4, 2024
0b0b136
chromedriver missing in deploy
tombrunet Sep 4, 2024
dd0aff6
Start local rule server for testing
tombrunet Sep 4, 2024
5b3a594
Deploy test
tombrunet Sep 4, 2024
e12ce3b
Try deploy from git
tombrunet Sep 5, 2024
fbc70c1
ioctl error
tombrunet Sep 5, 2024
e26e72d
Try another way to pass key
tombrunet Sep 5, 2024
db70f27
gpg import
tombrunet Sep 5, 2024
47c8988
import key
tombrunet Sep 5, 2024
9fbc81b
gpg
tombrunet Sep 5, 2024
4d9afb1
param order
tombrunet Sep 5, 2024
c036524
gpg loopback
tombrunet Sep 5, 2024
570683c
Try jar package
tombrunet Sep 5, 2024
b4a8e76
maven compiler props
tombrunet Sep 5, 2024
19b09d9
Setup release deployments for java checker
tombrunet Sep 5, 2024
75552a4
Add note to README
tombrunet Sep 5, 2024
881454d
Add Playwright support
tombrunet Sep 6, 2024
80c6d79
Add Playwright support
tombrunet Sep 6, 2024
77a003d
Starting javadoc
tombrunet Sep 6, 2024
5073a47
Merge branch 'master' into java2
tombrunet Sep 6, 2024
3ece6d8
Javadoc updates
tombrunet Sep 6, 2024
3193a0d
Enable playwrite screenshots, and report.toString
tombrunet Sep 6, 2024
f706bd0
Add copyright statement to javadoc
tombrunet Sep 6, 2024
5ca20e4
Fix for Firefox
tombrunet Sep 6, 2024
0d33acc
Fixes for Firefox
tombrunet Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,46 @@ jobs:
BLUEMIX_USERID: apikey
BLUEMIX_PASS: ${{ secrets.BLUEMIX_PASS }}
CLOUD_PWD: ${{ secrets.CLOUD_PWD }}
TRAVIS_BRANCH: prod
TRAVIS_BRANCH: prod

java-accessibility-checker-deploy:
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'semeru' # See 'Supported distributions' for available options
java-version: '17'
server-id: central
server-username: ${{ secrets.MVN_GITHUB_USER }}
server-password: ${{ secrets.MVN_GITHUB_TOKEN }}
- uses: s4u/[email protected]
with:
servers: |
[{
"id": "central",
"username": "${{ secrets.MVN_GITHUB_USER }}",
"password": "${{ secrets.MVN_GITHUB_TOKEN }}"
}]
- name: Configure GPG Key
run: echo "$GPG_SIGNING_KEY" >private.key
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Import GPG Key
run: gpg --pinentry-mode=loopback --passphrase "$GPG_SIGNING_KEY_PASS" --import private.key
env:
GPG_SIGNING_KEY_PASS: ${{ secrets.GPG_SIGNING_KEY_PASS }}
- name: Set version
run: sed -i'.old' -e 's/\<version\>3\.0\.0\<\/version\>/\<version\>'"${GITHUB_REF:10}"'\<\/version\>/g' ./pom.xml
working-directory: java-accessibility-checker
- name: Publish package
run: mvn --batch-mode deploy -DskipTests -Dgpg.passphrase=$GPG_SIGNING_KEY_PASS
working-directory: java-accessibility-checker
env:
GPG_SIGNING_KEY_PASS: ${{ secrets.GPG_SIGNING_KEY_PASS }}
71 changes: 71 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,77 @@ jobs:
- run: npm run wdio
working-directory: accessibility-checker/test/webdriverio

###############################################################################
# Java test
####
java-accessibility-checker-selenium-test:
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'semeru' # See 'Supported distributions' for available options
java-version: '17'
- name: Latest Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: latest
install-chromedriver: true
id: setup-chrome
- run: npm install
working-directory: rule-server
- run: npm run build
working-directory: rule-server
- run: node main.js &
working-directory: rule-server/dist
- run: sleep 10
working-directory: rule-server/dist
- name: Test package
run: mvn --batch-mode test -Dtest="AccessibilityCheckerSeleniumTest"
working-directory: java-accessibility-checker
env:
chromedriverpath: ${{ steps.setup-chrome.outputs.chromedriver-path }}
chromebinpath: ${{ steps.setup-chrome.outputs.chrome-path }}

java-accessibility-checker-playwright-test:
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'semeru' # See 'Supported distributions' for available options
java-version: '17'
- name: Latest Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: latest
install-chromedriver: true
id: setup-chrome
- run: npm install
working-directory: rule-server
- run: npm run build
working-directory: rule-server
- run: node main.js &
working-directory: rule-server/dist
- run: sleep 10
working-directory: rule-server/dist
- name: Test package
run: mvn --batch-mode test -Dtest="AccessibilityCheckerPlaywrightTest"
working-directory: java-accessibility-checker
env:
chromedriverpath: ${{ steps.setup-chrome.outputs.chromedriver-path }}
chromebinpath: ${{ steps.setup-chrome.outputs.chrome-path }}

###############################################################################
# Karma Tests
####
Expand Down
2 changes: 1 addition & 1 deletion accessibility-checker-engine/karmaaction.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = (config) => {
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
flags: ['--disable-web-security', '--no-sandbox']
flags: ['--disable-gpu', '--disable-web-security', '--no-sandbox']
}
},
preprocessors: {
Expand Down
9 changes: 9 additions & 0 deletions java-accessibility-checker/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

5 changes: 5 additions & 0 deletions java-accessibility-checker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.mvn
results
target
settings.xml
*.gpg
47 changes: 47 additions & 0 deletions java-accessibility-checker/README-DEV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Deployments found at https://central.sonatype.com/publishing/deployments

## Example maven commands

Run all tests:
```
mvn test
```

Run specific test
```
mvn test -Dtest="TheSecondUnitTest#whenTestCase2_thenPrintTest2_1"
```

Deploy
```
mvn -s ./settings.xml clean deploy -Dgpg.passphrase=yourpassphrase
```

Deployments show up on https://central.sonatype.com/publishing/deployments and then they can be Dropped or Published. Once Published, they cannot be Dropped.

Generate javadoc for local review (files in target/site/apidocs/)
```
mvn javadoc:javadoc
```

## PGP Key Management

Generate PGP key:
```
gpg --gen-key
> Real name: IBM Accessibility
> Email address: [email protected]
gpg --armor --output public-key.gpg --export [email protected]
```
Go to https://keyserver.ubuntu.com/, Click `Submit Key`, and paste in public-key.gpg

Export private key:
```
gpg --export-secret-keys -a 7A58C8C58C35FF078630FA3615954E19FBC774C4
```

Verify Key:
```
gpg --list-signatures
```
Go to https://keyserver.ubuntu.com/pks/lookup?search=7A58C8C58C35FF078630FA3615954E19FBC774C4&fingerprint=on&op=index and replace `7A58C8C58C35FF078630FA3615954E19FBC774C4` with the key signature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
commons-math3 = "3.6.1"
guava = "33.1.0-jre"
junit = "4.13.2"

[libraries]
commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
junit = { module = "junit:junit", version.ref = "junit" }
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading