Skip to content

Commit 2365e32

Browse files
authored
Merge pull request #90 from dequelabs/release-202008018
feat: release v4.0.0
2 parents 33f6e6c + b6e3850 commit 2365e32

Some content is hidden

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

56 files changed

+5457
-742
lines changed

.circleci/config.yml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,88 @@ jobs:
1212
- checkout
1313
- restore_cache:
1414
key: v1-mvn-deps-{{ checksum "pom.xml" }}
15+
- restore_cache:
16+
key: v1-npm-deps-{{ checksum "package-lock.json" }}
1517
- run: mvn install -DskipTests
1618
- save_cache:
1719
key: v1-mvn-deps-{{ checksum "pom.xml" }}
1820
paths:
1921
- ~/.m2
22+
- save_cache:
23+
key: v1-npm-deps-{{ checksum "package-lock.json" }}
24+
paths:
25+
- node_modules
2026
tests:
2127
<<: *defaults
2228
steps:
2329
- checkout
2430
- restore_cache:
2531
key: v1-mvn-deps-{{ checksum "pom.xml" }}
32+
- restore_cache:
33+
key: v1-npm-deps-{{ checksum "package-lock.json" }}
2634
- run:
2735
command: node src/test/resources/test-app.js
2836
background: true
2937
- run: sleep 5 # sleep to allow the server some time to boot
3038
- run: mvn test
3139

40+
snapshot_release:
41+
<<: *defaults
42+
steps:
43+
- checkout
44+
- restore_cache:
45+
key: v1-mvn-deps-{{ checksum "pom.xml" }}
46+
- restore_cache:
47+
key: v1-npm-deps-{{ checksum "package-lock.json" }}
48+
- run: python .circleci/snapshot.py
49+
- run: .circleci/publish.sh
50+
51+
release:
52+
<<: *defaults
53+
steps:
54+
- checkout
55+
- restore_cache:
56+
key: v1-mvn-deps-{{ checksum "pom.xml" }}
57+
- restore_cache:
58+
key: v1-npm-deps-{{ checksum "package-lock.json" }}
59+
- run: .circleci/publish.sh
60+
61+
github_release:
62+
docker:
63+
- image: circleci/golang:1.10
64+
steps:
65+
- checkout
66+
- run: go get gopkg.in/aktau/github-release.v0
67+
- run:
68+
name: Download and run GitHub release script
69+
command: |
70+
curl https://raw.githubusercontent.com/dequelabs/attest-release-scripts/develop/src/java-github-release.sh -s -o ./java-github-release.sh
71+
chmod +x ./java-github-release.sh
72+
./java-github-release.sh
73+
74+
3275
workflows:
3376
version: 2
3477
build:
3578
jobs:
3679
- dependencies
3780
- tests:
3881
requires:
39-
- dependencies
82+
- dependencies
83+
- snapshot_release:
84+
requires:
85+
- dependencies
86+
- tests
87+
filters:
88+
branches:
89+
only: develop
90+
- release:
91+
requires:
92+
- dependencies
93+
- tests
94+
filters:
95+
branches:
96+
only: master
97+
- github_release:
98+
requires:
99+
- release

.circleci/publish.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
# This script will create a "global" settings file for Maven
4+
# to use for auth, then publish the project.
5+
6+
# Fail on first error.
7+
set -e
8+
9+
# Ensure directory exists.
10+
mkdir -p ~/.m2
11+
12+
echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd\">" > ~/.m2/settings.xml
13+
echo " <localRepository/>" >> ~/.m2/settings.xml
14+
echo " <interactiveMode/>" >> ~/.m2/settings.xml
15+
echo " <usePluginRegistry/>" >> ~/.m2/settings.xml
16+
echo " <offline/>" >> ~/.m2/settings.xml
17+
echo " <pluginGroups/>" >> ~/.m2/settings.xml
18+
echo " <servers>" >> ~/.m2/settings.xml
19+
echo " <server>" >> ~/.m2/settings.xml
20+
echo " <id>ossrh</id>" >> ~/.m2/settings.xml
21+
echo " <username>$OSSRH_USERNAME</username>" >> ~/.m2/settings.xml
22+
echo " <password><![CDATA[$OSSRH_PASSWORD]]></password>" >> ~/.m2/settings.xml
23+
echo " </server>" >> ~/.m2/settings.xml
24+
echo " </servers>" >> ~/.m2/settings.xml
25+
echo " <profiles>" >> ~/.m2/settings.xml
26+
echo " <profile>" >> ~/.m2/settings.xml
27+
echo " <id>ossrh</id>" >> ~/.m2/settings.xml
28+
echo " <activation>" >> ~/.m2/settings.xml
29+
echo " <activeByDefault>true</activeByDefault>" >> ~/.m2/settings.xml
30+
echo " </activation>" >> ~/.m2/settings.xml
31+
echo " <properties>" >> ~/.m2/settings.xml
32+
echo " <gpg.executable>gpg2</gpg.executable>" >> ~/.m2/settings.xml
33+
echo " <gpg.passphrase>$GPG_PASSPHRASE</gpg.passphrase>" >> ~/.m2/settings.xml
34+
echo " </properties>" >> ~/.m2/settings.xml
35+
echo " </profile>" >> ~/.m2/settings.xml
36+
echo " </profiles>" >> ~/.m2/settings.xml
37+
echo " <mirrors/>" >> ~/.m2/settings.xml
38+
echo " <proxies/>" >> ~/.m2/settings.xml
39+
echo " <activeProfiles/>" >> ~/.m2/settings.xml
40+
echo "</settings>" >> ~/.m2/settings.xml
41+
42+
chmod 0600 ~/.m2/settings.xml
43+
44+
mvn clean deploy -DskipTests

.circleci/snapshot.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import xml.etree.ElementTree as ET
2+
import sys
3+
4+
ns = 'http://maven.apache.org/POM/4.0.0'
5+
ss = '-SNAPSHOT'
6+
7+
# hack: register the namespace to avoid `.write`
8+
# from writing the `ns0` all over the place
9+
ET.register_namespace('', ns)
10+
tree = ET.parse('pom.xml')
11+
12+
root = tree.getroot()
13+
version_node = root.find('{%s}version' % ns)
14+
15+
assert version_node is not None, 'No <version> key'
16+
17+
if version_node.text.endswith(ss):
18+
sys.exit()
19+
20+
version_node.text = version_node.text + ss
21+
22+
tree.write('pom.xml', xml_declaration = True, encoding = 'utf-8', method = 'xml')
23+
print 'Added %s to version' % ss
24+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
<< Describe the changes >>
2-
3-
Closes issue:
4-
51
## Reviewer checks
62

73
**Required fields, to be filled out by PR reviewer(s)**
8-
- [ ] Follows the commit message policy, appropriate for next version
9-
- [ ] Has documentation updated, a DU ticket, or requires no documentation change
10-
- [ ] Includes new tests, or was unnecessary
11-
- [ ] Code is reviewed for security by: << Name here >>
4+
- [ ] Code is reviewed for security
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Sync master/develop branches
2+
on:
3+
pull_request:
4+
types: [closed]
5+
branches: master
6+
jobs:
7+
create_sync_pull_request:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: dequelabs/action-sync-branches@v1.0.0
11+
with:
12+
github-token: \${{ secrets.GITHUB_TOKEN }}
13+
pr-title: "chore: merge master into develop"
14+
pr-reviewers: AdnoC,stephenmathieson
15+
pr-labels: chore
16+
pr-template: .github/PULL_REQUEST_TEMPLATE.md

CHANGELOG.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
1-
# [3.1.0](http://dequelabs/axe-selenium-java/compare/v3.0.0...v3.1.0) (2020-03-17)
1+
# [4.0.0](http://dequelabs/axe-core-maven-html/compare/v3.1.0...v4.0.0) (2020-08-24)
2+
3+
4+
### Features
5+
6+
* ability to remove sandbox from iframes ([#86](http://dequelabs/axe-core-maven-html/issues/86)) ([9357957](http://dequelabs/axe-core-maven-html/commits/9357957a3f1e9bbf338b921e8db35c8041cf43e7))
7+
* add ability to use list of WebElements ([#58](http://dequelabs/axe-core-maven-html/issues/58)) ([7e518f4](http://dequelabs/axe-core-maven-html/commits/7e518f47f28a7af53fb48543eba18a5b8bbaa2c8))
8+
* add axe-core v4 ([#85](http://dequelabs/axe-core-maven-html/issues/85)) ([52b4534](http://dequelabs/axe-core-maven-html/commits/52b453465c1e2e6ac6974c84c8d83e64be2d575f))
9+
* add a more complete API ([#75](https://github.com/dequelabs/axe-core-maven-html/pull/75)) ([2285cb9](https://github.com/dequelabs/axe-core-maven-html/commit/2285cb980f6357a2b69dbec0dfabc62740d45f4d))
10+
11+
### Breaking Changes
12+
13+
* Changed package group ID to "com.deque.html.axe-core"
14+
* Renamed the Java package name to "com.deque.html.axecore.selenium"
15+
16+
17+
# [3.1.0](http://dequelabs/axe-core-maven-html/compare/v3.0.0...v3.1.0) (2020-03-17)
218

319

420
### Bug Fixes
521

6-
* pass axe correct context when using include+exclude ([#43](http://dequelabs/axe-selenium-java/issues/43)) ([73a5009](http://dequelabs/axe-selenium-java/commits/73a5009b22afad5243d60db5f0d751de7165519a))
7-
* set minimum compiler source/target to java 7 ([8d19fed](http://dequelabs/axe-selenium-java/commits/8d19fedb271975b2457a8e27856a44f601b5a110))
22+
* pass axe correct context when using include+exclude ([#43](http://dequelabs/axe-core-maven-html/issues/43)) ([73a5009](http://dequelabs/axe-core-maven-html/commits/73a5009b22afad5243d60db5f0d751de7165519a))
23+
* set minimum compiler source/target to java 7 ([8d19fed](http://dequelabs/axe-core-maven-html/commits/8d19fedb271975b2457a8e27856a44f601b5a110))
24+
25+
826

27+
# [3.0.0](http://dequelabs/axe-core-maven-html/compare/v2.1.0...v3.0.0) (2019-02-08)
928

10-
# [3.0.0](https://github.com/dequelabs/axe-selenium-java/compare/v2.1.0...v3.0.0) (2019-02-08)
1129

1230
### Features
1331

14-
- **aXe 3.0+:** remove references to axe.a11yCheck, bump versions of Selenium webdriver, update axe to 2.6.1 in test/resources ([43145e7](https://github.com/dequelabs/axe-selenium-java/commit/43145e7))
15-
- add configurable script timeout ([#28](https://github.com/dequelabs/axe-selenium-java/issues/28)) ([0a7d0b9](https://github.com/dequelabs/axe-selenium-java/commit/0a7d0b9)), closes [#17](https://github.com/dequelabs/axe-selenium-java/issues/17)
16-
- update axe-core to v3.1.2 ([#23](https://github.com/dequelabs/axe-selenium-java/issues/23)) ([914a506](https://github.com/dequelabs/axe-selenium-java/commit/914a506))
32+
* **aXe 3.0+:** remove references to axe.a11yCheck, bump versions of Selenium webdriver, update axe to 2.6.1 in test/resources ([43145e7](http://dequelabs/axe-core-maven-html/commits/43145e7e431272807017ea5bd0e29e032a55b456))
33+
* add configurable script timeout ([#28](http://dequelabs/axe-core-maven-html/issues/28)) ([0a7d0b9](http://dequelabs/axe-core-maven-html/commits/0a7d0b9ef7520f587536caa543323b5a8e65042c)), closes [#17](http://dequelabs/axe-core-maven-html/issues/17)
34+
* update axe-core to v3.1.2 ([#23](http://dequelabs/axe-core-maven-html/issues/23)) ([914a506](http://dequelabs/axe-core-maven-html/commits/914a50693058c152891202d4fb9a764c8cbcf09b))
35+
36+
37+
38+
# 2.1.0 (2017-10-12)
1739

18-
### BREAKING CHANGES
1940

20-
- throw errors returned by axe-core's `run` method ([3617578](https://github.com/dequelabs/axe-selenium-java/commit/36175781a396fcbd87c146d763b67e70e208820f)) ([#27](https://github.com/dequelabs/axe-selenium-java/pull/27))
2141

README.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
# aXe Selenium (Java) Integration
1+
# axe-core Selenium (Java) Integration
22

33
[![CircleCI](https://circleci.com/gh/dequelabs/axe-selenium-java.svg?style=svg)](https://circleci.com/gh/dequelabs/axe-selenium-java)
44

5-
This example demonstrates how to use aXe to run web accessibility tests in Java projects with the Selenium browser automation tool and Java development tools.
5+
This example demonstrates how to use axe to run web accessibility tests in Java projects with the Selenium browser automation tool and Java development tools.
66

77
Selenium integration enables testing of full pages and sites.
88

99
## Requirements
1010

1111
- Chrome must be installed; follow the directions at https://www.google.com/chrome/ to install it. On Unix, ensure that Chrome is on your path.
12-
- Chrome Driver must be installed; follow the directions at: https://sites.google.com/a/chromium.org/chromedriver/getting-started to install it.
1312
- The Java SE Development Kit must be installed; follow the directions at http://www.oracle.com/technetwork/java/javase/downloads/index.html to install it.
1413
- Maven must be installed; follow the directions at http://maven.apache.org/ to install it. Ensure that it is on your path.
1514

1615
## To run the example
1716

18-
1. Move to the `selenium-java` directory.
19-
2. Ensure that `axe.min.js` is located in `/src/test/resources`.
20-
3. `node src/test/resources/test-app.js` to start the fixture server.
21-
4. `mvn test` to build and run the JUnit tests that drive Selenium against the fixture.
17+
1. Move to the `axe-core-maven-html` directory.
18+
2. `node src/test/resources/test-app.js` to start the fixture server.
19+
3. `mvn test` to build and run the JUnit tests that drive Selenium against the fixture.
2220

23-
This should launch an automated Firefox window, load and analyze the configured web pages, and then pass/fail a JUnit test depending on whether there are any accessibility violations detected.
21+
This should launch an automated Chrome window, load and analyze the configured web pages, and then pass/fail a JUnit test depending on whether there are any accessibility violations detected.
2422

2523
## To modify the example
2624

@@ -32,30 +30,27 @@ Include this library as a test-scoped dependency in your POM. Ensure the `versio
3230

3331
```xml
3432
<dependency>
35-
<groupId>com.deque</groupId>
36-
<artifactId>axe-selenium</artifactId>
37-
<version>3.0</version>
38-
<scope>test</scope>
33+
<groupId>com.deque.html.axe-core</groupId>
34+
<artifactId>selenium</artifactId>
35+
<version>3.1-SNAPSHOT</version>
36+
<scope>test</scope>
3937
</dependency>
4038
```
4139

42-
`axe.js` or `axe.min.js` must be available to your test fixtures as a `java.net.URL`. The simplest way to do this is to include it in your own `src.test.resources` and pass `MyTest.class.getResource("/axe.min.js")` to the `Builder` constructor as demonstrated in the `ExampleTest`.
40+
The `AxeBuilder` type is the main interface. Pass it a Selenium `WebDriver` instance, configure it,
41+
and run the `analyze` method to get results.
4342

44-
The `AXE` helper defines three public methods and a nested `Builder` class for your unit tests.
45-
46-
- `inject` will inject the required script into the page under test and any iframes. This only needs to be run against a given page once, and `Builder` will take care of it for you if you use that.
47-
- `report` will pretty-print a list of violations.
48-
- `writeResults` will write the JSON violations list out to a file with the specified name in the current working directory.
49-
50-
The `Builder` class allows tests to chain configuration and analyze pages. The constructor takes in a `WebDriver` that has already navigated to the page under test and a `java.net.URL` pointing to the aXe script; from there, you can set `options()`, `include()` and `exclude()` selectors, `skipFrames()`, and finally, `analyze()` the page.
51-
52-
- `options` wires a JSON string to aXe, allowing rules to be toggled on or off. See the `testAccessibilityWithOptions` unit test for a sample single-rule execution, and the [axe-core API documentation](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#b-options-parameter) for full documentation on the options object. The runOnly option with tags may be of particular interest, allowing aXe to execute all rules with the specified tag(s).
53-
- `include` adds to the list of included selectors. If you do not call `include` at all, aXe will run against the entire document.
43+
- `options` wires a JSON string to axe, allowing rules to be toggled on or off.
44+
See the `testAccessibilityWithOptions` unit test for a sample single-rule execution, and the
45+
[axe-core API documentation](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#b-options-parameter)
46+
for full documentation on the options object. The runOnly option with tags may be of particular interest, allowing axe to execute all rules with the specified tag(s).
47+
- `include` adds to the list of included selectors. If you do not call `include` at all, axe will run against the entire document.
5448
- `exclude` adds to the list of excluded selectors. Exclusions allow you to focus scope exactly where you need it, ignoring child elements you don't want to test.
55-
- `skipFrames` prevents aXe to be recursively injected into all iframes.
56-
- `analyze` executes aXe with any configuration you have previously defined. If you want to test a single `WebElement`, you may pass it into `analyze` instead of using `include` and `exclude`.
57-
58-
The aXe documentation should be consulted for more details on customizing and analyzing calls to `axe.run`.
49+
- `withOptions` takes an options object to be passed to the `axe.run` call.
50+
- `withTags` limits rules run to those that match specified tags.
51+
- `withOnlyRules` limites rules run to those specified.
52+
- `disabledRules` disables rules.
53+
- `analyze` executes axe with any configuration you have previously defined. If you want to test one or more `WebElement`s, you may pass them into `analyze` instead of using `include` and `exclude`.
5954

6055
## Contributing
6156

0 commit comments

Comments
 (0)