diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 1b4b0fe..6269a17 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -48,9 +48,8 @@ jobs: name: Publish to GitHub Packages Apache Maven uses: ./.github/workflows/maven.yaml + secrets: inherit with: maven-goal: deploy needs: release-please - - \ No newline at end of file diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 17b2dfa..ba2aa2b 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 - uses: whelk-io/maven-settings-xml-action@v22 with: - servers: '[{ "id":"github-vol-active-support", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } } ]' + servers: '[{ "id":"dvsa-github-packages", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } } ]' - run: mvn -B -P github ${{ inputs.maven-goal}} - \ No newline at end of file + diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 9a4e077..84e29a6 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -35,8 +35,8 @@ jobs: cache: maven - uses: whelk-io/maven-settings-xml-action@v22 with: - servers: '[{ "id":"github-vol-active-support", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } } ]' + servers: '[{ "id":"dvsa-github-packages", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } } ]' - run: snyk test --severity-threshold=${{ inputs.severity-threshold || 'high' }} -- -P github env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} \ No newline at end of file + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0ccbbd6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,32 @@ +# Changelog + +## [1.0.1](https://github.com/dvsa/vol-accessibility-lib/compare/v1.0.0...v1.0.1) (2024-05-17) + + +### Bug Fixes + +* env ([0d09507](https://github.com/dvsa/vol-accessibility-lib/commit/0d0950718a2015094e80d1e6923a0fc10264c7e9)) +* Update cd.yaml ([9a4f79f](https://github.com/dvsa/vol-accessibility-lib/commit/9a4f79ffbc9cc2f315a2c8c2cbc1334827157b13)) +* Update cd.yaml ([cae6e1f](https://github.com/dvsa/vol-accessibility-lib/commit/cae6e1f8d50fac9e6af3ecc6cb898fc5fdf9ab1d)) + +## 1.0.0 (2024-05-17) + + +### Features + +* axe core ([b4c300e](https://github.com/dvsa/vol-accessibility-lib/commit/b4c300ea36a522ef6d90fbc2332c063d62020b1c)) +* compiler ([c44e6ee](https://github.com/dvsa/vol-accessibility-lib/commit/c44e6ee668ddaad23bf02b7f37665bf540e99beb)) +* github packages ([411c290](https://github.com/dvsa/vol-accessibility-lib/commit/411c290ea233798573c4d27c3b07c72671bf72fb)) +* pom changes ([442af2c](https://github.com/dvsa/vol-accessibility-lib/commit/442af2c7693dacea1c78f50c4b4b4687bce17ffc)) +* snyk ([f697056](https://github.com/dvsa/vol-accessibility-lib/commit/f697056a07f18f78c8d2b4a1a0568d19abf432b9)) +* snyk ([ecbe0b8](https://github.com/dvsa/vol-accessibility-lib/commit/ecbe0b87e823375d973723a544bdf17ba26f21e6)) +* snyk ([fb2a0b1](https://github.com/dvsa/vol-accessibility-lib/commit/fb2a0b1adf603c3c927abb94ffb9c5ad167b767c)) +* snyk ignore ([1d4160a](https://github.com/dvsa/vol-accessibility-lib/commit/1d4160afb14470705eda69affb6637588b2de2ec)) + + +### Bug Fixes + +* revert scanner changes ([b5d01dc](https://github.com/dvsa/vol-accessibility-lib/commit/b5d01dc38b3bb4142e87c5f7b59bfcf10e123bf7)) +* Update cd.yaml ([de52a71](https://github.com/dvsa/vol-accessibility-lib/commit/de52a71d34734d013c01a28ed1d6523609a55671)) +* Update cd.yaml ([7929040](https://github.com/dvsa/vol-accessibility-lib/commit/79290401fb789291ae4c34aa9b7ca235e2fb1047)) +* version ([9f19a59](https://github.com/dvsa/vol-accessibility-lib/commit/9f19a59444254398f03e3cc348bfbf5a934946d2)) diff --git a/README.md b/README.md index c8903b5..f3bf706 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Description +# Description. Accessibility scanner library. This is a wrapper for the selenium axe framework. Once the scan has completed and any issues found, there will be a REPORT folder created in the project @@ -10,4 +10,15 @@ that consumes this library. # Rules This library uses AXE-CORE to scan for accessibility violations. The full rules that the scan covers -can be found on the following link https://dequeuniversity.com/rules/axe/3.2 \ No newline at end of file +can be found on the following link https://dequeuniversity.com/rules/axe/3.2 + +## Installation +Add the following Maven dependency to your project's `pom.xml` file: +```xml + + org.dvsa.testing.framework + accessibility-library + [insert latest version of package] + +``` + diff --git a/pom.xml b/pom.xml index d3f6e0e..8c47b20 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,10 @@ - + 4.0.0 org.dvsa.testing.lib accessibility-library - 2.9 + 1.0.2-SNAPSHOT UTF-8 @@ -47,30 +45,22 @@ - + github central https://repo1.maven.org/maven2 - - true - - - true - + true + true - github-vol-active-support + dvsa-github-packages GitHub dvsa Apache Maven Packages - https://maven.pkg.github.com/dvsa/vol-active-support - - true - - - true - + https://maven.pkg.github.com/dvsa/* + true + true diff --git a/src/main/java/scanner/AXEScanner.java b/src/main/java/scanner/AXEScanner.java index 0cab74d..8722789 100644 --- a/src/main/java/scanner/AXEScanner.java +++ b/src/main/java/scanner/AXEScanner.java @@ -4,6 +4,7 @@ import activesupport.driver.Browser; import com.deque.html.axecore.args.AxeRuleOptions; import com.deque.html.axecore.args.AxeRunOptions; +import com.deque.html.axecore.args.AxeRunOptions; import com.deque.html.axecore.results.Results; import com.deque.html.axecore.results.Rule; import com.deque.html.axecore.selenium.AxeBuilder; diff --git a/src/main/java/scanner/ReportGenerator.java b/src/main/java/scanner/ReportGenerator.java index 6a1dc76..422db5d 100644 --- a/src/main/java/scanner/ReportGenerator.java +++ b/src/main/java/scanner/ReportGenerator.java @@ -231,8 +231,7 @@ private static String readLinesAsInputStream(InputStream inputStream) throws IOE private static String readLines(String filePath) { StringBuilder contentBuilder = new StringBuilder(); try (Stream stream = Files.lines(Paths.get(filePath), StandardCharsets.UTF_8)) { - final StringBuilder finalContentBuilder = contentBuilder; - stream.forEach(s -> finalContentBuilder.append(s).append("\n")); + stream.forEach(s -> contentBuilder.append(s).append("\n")); } catch (IOException e) { e.printStackTrace(); }