Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update puppeteer #640

Merged
merged 5 commits into from Jan 31, 2023
Merged

Update puppeteer #640

merged 5 commits into from Jan 31, 2023

Conversation

calebeby
Copy link
Member

@calebeby calebeby commented Jan 30, 2023

I needed to update puppeteer to fix an issue with updating pleasantest on c4/patterns. The latest puppeteer is v19, but @axe-core/puppeteer doesn't "support" it yet. v18 includes the fix we need, so I am going to release a version with that.

I needed to update it to fix an issue with updating pleasantest on c4/patterns.
The latest puppeteer is v19, but @axe-core/puppeteer doesn't "support" it yet.
v18 includes the fix we need, so I am going to release a version with that.
@@ -669,7 +669,7 @@ test(
);
```

To pass variables from the test environment into the browser, you can pass them in an array as the 2nd parameter. Note that they must either be JSON-serializable or they can be a [`JSHandle`](https://pptr.dev/api/puppeteer.jshandle) or an [`ElementHandle`](https://pptr.dev/#?product=Puppeteer&version=v13.0.0&show=api-class-elementhandle). The arguments will be received in the browser via `import.meta.pleasantestArgs`:
To pass variables from the test environment into the browser, you can pass them in an array as the 2nd parameter. Note that they must either be JSON-serializable or they can be a [`JSHandle`](https://pptr.dev/api/puppeteer.jshandle) or an [`ElementHandle`](https://pptr.dev/api/puppeteer.elementhandle/). The arguments will be received in the browser via `import.meta.pleasantestArgs`:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated but it was a link I missed changing when I went through to switch the links to their new docs site

@@ -9,20 +9,16 @@
],
"license": "MIT",
"peerDependencies": {
"@axe-core/puppeteer": "^4.4.4",
"axe-core": "^4.4.3"
"@axe-core/puppeteer": "^4.4.4"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this version range wider to avoid a breaking change (but it still kinda sorta is since the newer version of @axe-core/puppeteer is needed to make npm allow the newer puppeteer version, although it probably would work fine with passing --force to npm)

}
},
"devDependencies": {
"@ampproject/remapping": "2.2.0",
"@axe-core/puppeteer": "4.4.5",
"@axe-core/puppeteer": "4.6.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to satisfy the peerDep since puppeteer was updated

@@ -50,7 +50,7 @@ const getAccessibilityTree = async (
// eslint-disable-next-line @cloudfour/typescript-eslint/no-unnecessary-condition
element &&
typeof element === 'object' &&
element.constructor.name === 'Page'
element.constructor.name === 'CDPPage'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newer version of Puppeteer changes the name of this class

@@ -239,7 +239,7 @@ async function toPassAxeTests(
} catch {
throw removeFuncFromStackTrace(
new Error(
'Install @axe-core/puppeteer and axe-core to use the toPassAxeTests matcher',
'Install @axe-core/puppeteer to use the toPassAxeTests matcher',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that @axe-core/puppeteer comes with its own version of axe-core so it is not necessary for users to directly install axe-core.

@@ -13,7 +13,7 @@ test(
Violations found:

Images must have alternate text (image-alt)
https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axe-puppeteer
https://dequeuniversity.com/rules/axe/4.6/image-alt?application=axe-puppeteer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From updating @axe-core/puppeteer, axe-core was updated, so their URLs updated too.

@calebeby calebeby marked this pull request as ready for review January 30, 2023 16:49
Copy link
Member

@spaceninja spaceninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure your commit message reflects your comments here about why we no longer need to install axe-core directly.

@calebeby calebeby merged commit 893d9d5 into main Jan 31, 2023
@calebeby calebeby deleted the update-puppeteer branch January 31, 2023 17:01
@github-actions github-actions bot mentioned this pull request Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants