Skip to content

Commit

Permalink
Merge pull request #90 from dequelabs/release-202008018
Browse files Browse the repository at this point in the history
feat: release v4.0.0
  • Loading branch information
WilcoFiers authored Aug 25, 2020
2 parents 33f6e6c + b6e3850 commit 2365e32
Show file tree
Hide file tree
Showing 56 changed files with 5,457 additions and 742 deletions.
62 changes: 61 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,88 @@ jobs:
- checkout
- restore_cache:
key: v1-mvn-deps-{{ checksum "pom.xml" }}
- restore_cache:
key: v1-npm-deps-{{ checksum "package-lock.json" }}
- run: mvn install -DskipTests
- save_cache:
key: v1-mvn-deps-{{ checksum "pom.xml" }}
paths:
- ~/.m2
- save_cache:
key: v1-npm-deps-{{ checksum "package-lock.json" }}
paths:
- node_modules
tests:
<<: *defaults
steps:
- checkout
- restore_cache:
key: v1-mvn-deps-{{ checksum "pom.xml" }}
- restore_cache:
key: v1-npm-deps-{{ checksum "package-lock.json" }}
- run:
command: node src/test/resources/test-app.js
background: true
- run: sleep 5 # sleep to allow the server some time to boot
- run: mvn test

snapshot_release:
<<: *defaults
steps:
- checkout
- restore_cache:
key: v1-mvn-deps-{{ checksum "pom.xml" }}
- restore_cache:
key: v1-npm-deps-{{ checksum "package-lock.json" }}
- run: python .circleci/snapshot.py
- run: .circleci/publish.sh

release:
<<: *defaults
steps:
- checkout
- restore_cache:
key: v1-mvn-deps-{{ checksum "pom.xml" }}
- restore_cache:
key: v1-npm-deps-{{ checksum "package-lock.json" }}
- run: .circleci/publish.sh

github_release:
docker:
- image: circleci/golang:1.10
steps:
- checkout
- run: go get gopkg.in/aktau/github-release.v0
- run:
name: Download and run GitHub release script
command: |
curl https://raw.githubusercontent.com/dequelabs/attest-release-scripts/develop/src/java-github-release.sh -s -o ./java-github-release.sh
chmod +x ./java-github-release.sh
./java-github-release.sh
workflows:
version: 2
build:
jobs:
- dependencies
- tests:
requires:
- dependencies
- dependencies
- snapshot_release:
requires:
- dependencies
- tests
filters:
branches:
only: develop
- release:
requires:
- dependencies
- tests
filters:
branches:
only: master
- github_release:
requires:
- release
44 changes: 44 additions & 0 deletions .circleci/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# This script will create a "global" settings file for Maven
# to use for auth, then publish the project.

# Fail on first error.
set -e

# Ensure directory exists.
mkdir -p ~/.m2

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
echo " <localRepository/>" >> ~/.m2/settings.xml
echo " <interactiveMode/>" >> ~/.m2/settings.xml
echo " <usePluginRegistry/>" >> ~/.m2/settings.xml
echo " <offline/>" >> ~/.m2/settings.xml
echo " <pluginGroups/>" >> ~/.m2/settings.xml
echo " <servers>" >> ~/.m2/settings.xml
echo " <server>" >> ~/.m2/settings.xml
echo " <id>ossrh</id>" >> ~/.m2/settings.xml
echo " <username>$OSSRH_USERNAME</username>" >> ~/.m2/settings.xml
echo " <password><![CDATA[$OSSRH_PASSWORD]]></password>" >> ~/.m2/settings.xml
echo " </server>" >> ~/.m2/settings.xml
echo " </servers>" >> ~/.m2/settings.xml
echo " <profiles>" >> ~/.m2/settings.xml
echo " <profile>" >> ~/.m2/settings.xml
echo " <id>ossrh</id>" >> ~/.m2/settings.xml
echo " <activation>" >> ~/.m2/settings.xml
echo " <activeByDefault>true</activeByDefault>" >> ~/.m2/settings.xml
echo " </activation>" >> ~/.m2/settings.xml
echo " <properties>" >> ~/.m2/settings.xml
echo " <gpg.executable>gpg2</gpg.executable>" >> ~/.m2/settings.xml
echo " <gpg.passphrase>$GPG_PASSPHRASE</gpg.passphrase>" >> ~/.m2/settings.xml
echo " </properties>" >> ~/.m2/settings.xml
echo " </profile>" >> ~/.m2/settings.xml
echo " </profiles>" >> ~/.m2/settings.xml
echo " <mirrors/>" >> ~/.m2/settings.xml
echo " <proxies/>" >> ~/.m2/settings.xml
echo " <activeProfiles/>" >> ~/.m2/settings.xml
echo "</settings>" >> ~/.m2/settings.xml

chmod 0600 ~/.m2/settings.xml

mvn clean deploy -DskipTests
24 changes: 24 additions & 0 deletions .circleci/snapshot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import xml.etree.ElementTree as ET
import sys

ns = 'http://maven.apache.org/POM/4.0.0'
ss = '-SNAPSHOT'

# hack: register the namespace to avoid `.write`
# from writing the `ns0` all over the place
ET.register_namespace('', ns)
tree = ET.parse('pom.xml')

root = tree.getroot()
version_node = root.find('{%s}version' % ns)

assert version_node is not None, 'No <version> key'

if version_node.text.endswith(ss):
sys.exit()

version_node.text = version_node.text + ss

tree.write('pom.xml', xml_declaration = True, encoding = 'utf-8', method = 'xml')
print 'Added %s to version' % ss

9 changes: 1 addition & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<< Describe the changes >>

Closes issue:

## Reviewer checks

**Required fields, to be filled out by PR reviewer(s)**
- [ ] Follows the commit message policy, appropriate for next version
- [ ] Has documentation updated, a DU ticket, or requires no documentation change
- [ ] Includes new tests, or was unnecessary
- [ ] Code is reviewed for security by: << Name here >>
- [ ] Code is reviewed for security
16 changes: 16 additions & 0 deletions .github/workflows/sync-master-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Sync master/develop branches
on:
pull_request:
types: [closed]
branches: master
jobs:
create_sync_pull_request:
runs-on: ubuntu-latest
steps:
- uses: dequelabs/[email protected]
with:
github-token: \${{ secrets.GITHUB_TOKEN }}
pr-title: "chore: merge master into develop"
pr-reviewers: AdnoC,stephenmathieson
pr-labels: chore
pr-template: .github/PULL_REQUEST_TEMPLATE.md
38 changes: 29 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
# [3.1.0](http://dequelabs/axe-selenium-java/compare/v3.0.0...v3.1.0) (2020-03-17)
# [4.0.0](http://dequelabs/axe-core-maven-html/compare/v3.1.0...v4.0.0) (2020-08-24)


### Features

* ability to remove sandbox from iframes ([#86](http://dequelabs/axe-core-maven-html/issues/86)) ([9357957](http://dequelabs/axe-core-maven-html/commits/9357957a3f1e9bbf338b921e8db35c8041cf43e7))
* 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))
* add axe-core v4 ([#85](http://dequelabs/axe-core-maven-html/issues/85)) ([52b4534](http://dequelabs/axe-core-maven-html/commits/52b453465c1e2e6ac6974c84c8d83e64be2d575f))
* 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))

### Breaking Changes

* Changed package group ID to "com.deque.html.axe-core"
* Renamed the Java package name to "com.deque.html.axecore.selenium"


# [3.1.0](http://dequelabs/axe-core-maven-html/compare/v3.0.0...v3.1.0) (2020-03-17)


### Bug Fixes

* pass axe correct context when using include+exclude ([#43](http://dequelabs/axe-selenium-java/issues/43)) ([73a5009](http://dequelabs/axe-selenium-java/commits/73a5009b22afad5243d60db5f0d751de7165519a))
* set minimum compiler source/target to java 7 ([8d19fed](http://dequelabs/axe-selenium-java/commits/8d19fedb271975b2457a8e27856a44f601b5a110))
* 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))
* set minimum compiler source/target to java 7 ([8d19fed](http://dequelabs/axe-core-maven-html/commits/8d19fedb271975b2457a8e27856a44f601b5a110))



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

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

### Features

- **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))
- 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)
- 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))
* **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))
* 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)
* 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))



# 2.1.0 (2017-10-12)

### BREAKING CHANGES

- 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))

49 changes: 22 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# aXe Selenium (Java) Integration
# axe-core Selenium (Java) Integration

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

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.
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.

Selenium integration enables testing of full pages and sites.

## Requirements

- 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.
- Chrome Driver must be installed; follow the directions at: https://sites.google.com/a/chromium.org/chromedriver/getting-started to install it.
- 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.
- Maven must be installed; follow the directions at http://maven.apache.org/ to install it. Ensure that it is on your path.

## To run the example

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

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.
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.

## To modify the example

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

```xml
<dependency>
<groupId>com.deque</groupId>
<artifactId>axe-selenium</artifactId>
<version>3.0</version>
<scope>test</scope>
<groupId>com.deque.html.axe-core</groupId>
<artifactId>selenium</artifactId>
<version>3.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
```

`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`.
The `AxeBuilder` type is the main interface. Pass it a Selenium `WebDriver` instance, configure it,
and run the `analyze` method to get results.

The `AXE` helper defines three public methods and a nested `Builder` class for your unit tests.

- `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.
- `report` will pretty-print a list of violations.
- `writeResults` will write the JSON violations list out to a file with the specified name in the current working directory.

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.

- `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).
- `include` adds to the list of included selectors. If you do not call `include` at all, aXe will run against the entire document.
- `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).
- `include` adds to the list of included selectors. If you do not call `include` at all, axe will run against the entire document.
- `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.
- `skipFrames` prevents aXe to be recursively injected into all iframes.
- `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`.

The aXe documentation should be consulted for more details on customizing and analyzing calls to `axe.run`.
- `withOptions` takes an options object to be passed to the `axe.run` call.
- `withTags` limits rules run to those that match specified tags.
- `withOnlyRules` limites rules run to those specified.
- `disabledRules` disables rules.
- `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`.

## Contributing

Expand Down
Loading

0 comments on commit 2365e32

Please sign in to comment.