Skip to content

Commit 7c64bbd

Browse files
committed
Added a few default values to the puppeteer example
1 parent 1f5dc04 commit 7c64bbd

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

README.markdown

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,29 @@ The test script assumes a recent version of Node.js to be available.
9797
```javascript
9898
const puppeteer = require('puppeteer-core');
9999

100+
// Replace with the path to the chrome executable in your file system. This one assumes MacOSX.
101+
const executablePath = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
102+
103+
// Replace with the url you wish to test.
104+
const url = 'https://www.squiz.net';
105+
100106
(async () => {
101107
const browser = await puppeteer.launch({
102-
executablePath: 'Google Chrome binary location'
108+
executablePath
103109
});
110+
104111
const page = await browser.newPage();
105-
page.on('console', msg => console.log(msg.text()));
106112

107-
await page.goto('web site URL');
113+
page.on('console', msg => {
114+
console.log(msg.text())
115+
});
116+
117+
await page.goto(url);
108118

109119
await page.addScriptTag({
110120
path: 'build/HTMLCS.js'
111121
});
122+
112123
await page.evaluate(function () {
113124
HTMLCS_RUNNER.run('WCAG2AA');
114125
});

0 commit comments

Comments
 (0)