Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
chore: Release 1.0.0 #22
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers authored Jan 24, 2019
2 parents 3cd0e15 + 9af0bad commit df92ace
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 21 deletions.
37 changes: 36 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ jobs:
- restore_cache:
key: v1-npm-cache-{{ checksum "package.json" }}
- run: npm run lint
canary_release:
<<: *defaults
steps:
- checkout
- restore_cache:
key: v1-npm-cache-{{ checksum "package.json" }}
- run: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
- run: npm whoami
- run: .circleci/next-release.js
- run: npm publish --tag=next
release:
<<: *defaults
steps:
- checkout
- restore_cache:
key: v1-npm-cache-{{ checksum "package.json" }}
- run: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
- run: npm whoami
- run: npm publish

workflows:
version: 2
Expand All @@ -48,4 +67,20 @@ workflows:
- dependencies
- lint:
requires:
- dependencies
- dependencies
- release:
requires:
- dependencies
- tests
- lint
filters:
branches:
only: master
- canary_release:
requires:
- dependencies
- tests
- lint
filters:
branches:
only: develop
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @AdnoC
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<< 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 >>
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# 0.1.0 (2018-12-09)
# [1.0.0](http://dequelabs/axe-puppeteer/compare/v0.1.0...v1.0.0) (2019-01-23)


### Bug Fixes

- compile to es2015 to support older nodes ([21b2ed2](https://github.com/dequelabs/axe-puppeteer/commit/21b2ed2))
- do not depend on `puppeteer-core` ([c3f0ec9](https://github.com/dequelabs/axe-puppeteer/commit/c3f0ec9))
- **package-lock:** do not point at a private registry ([bf94ba5](https://github.com/dequelabs/axe-puppeteer/commit/bf94ba5))
* **package-lock:** do not point at a private registry ([bf94ba5](http://dequelabs/axe-puppeteer/commits/bf94ba5))
* compile to es2015 to support older nodes ([21b2ed2](http://dequelabs/axe-puppeteer/commits/21b2ed2))
* do not depend on `puppeteer-core` ([c3f0ec9](http://dequelabs/axe-puppeteer/commits/c3f0ec9))


### Features

- Initial implementation ([#2](https://github.com/dequelabs/axe-puppeteer/issues/2)) ([ee39774](https://github.com/dequelabs/axe-puppeteer/commit/ee39774))
* Initial implementation ([#2](http://dequelabs/axe-puppeteer/issues/2)) ([ee39774](http://dequelabs/axe-puppeteer/commits/ee39774))



42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,29 @@ This module uses a chainable API to assist in injecting, configuring and analyzi
Here is an example of a script that will drive Puppeteer to this repository, perform analysis and then log results to the console.

```js
const AxePuppeteer = require('axe-puppeteer')
const { AxePuppeteer } = require('axe-puppeteer')
const puppeteer = require('puppeteer')

const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.setBypassCSP(true)
;(async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.setBypassCSP(true)

await page.goto('https://dequeuniversity.com/demo/mars/')
await page.goto('https://dequeuniversity.com/demo/mars/')

const results = await new AxePuppeteer(page).analyze()
console.log(results)
const results = await new AxePuppeteer(page).analyze()
console.log(results)

await page.close()
await browser.close()
})()
```

Note: Usage examples make use of ES2017 async/await. Use of `await` can only be done in a function
declared `async`. If your project does not support async/await, you can just directly use the promise
`async` functions return. [Check here for more
information.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)

## Bypassing Content Security Policy

When trying to run axe, you might run into issues if the page you are checking has Content Security Policy enabled. To get around this, you must disable it through `Page#setBypassCSP` **before** navigating to the site.
Expand All @@ -49,13 +59,17 @@ It closes the page after `analyze` is called.
const { loadPage } = require('axe-puppeteer')
const puppeteer = require('puppeteer')

const browser = await puppeteer.launch()
const axeBuilder = await loadPage(
browser,
'https://dequeuniversity.com/demo/mars/'
)
const results = await axeBuilder.analyze()
console.log(results)
;(async () => {
const browser = await puppeteer.launch()
const axeBuilder = await loadPage(
browser,
'https://dequeuniversity.com/demo/mars/'
)
const results = await axeBuilder.analyze()
console.log(results)

await browser.close()
})()
```

### AxePuppeteer(page: Frame | Page[, axeSource: string])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axe-puppeteer",
"version": "0.1.0",
"version": "1.0.0",
"description": "Provides a chainable axe API for Puppeteer and automatically injects into all frames",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down

0 comments on commit df92ace

Please sign in to comment.