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
feat: element option in page.accessibility.snapshot() #4318
Conversation
High-level questions:
|
08728ae
to
f627776
Compare
f627776
to
e979970
Compare
As we discussed offline, I changed the API to be part of page.accessibility.snapshot. We can look to adding something on elementHandle later. Same functionality. Pass an element to capture a snapshot rooted at that element. |
test/accessibility.spec.js
Outdated
await page.setContent(`<button>My Button</button>`); | ||
const button = await page.$('button'); | ||
await page.$eval('button', button => button.remove()); | ||
expect(await await page.accessibility.snapshot({element: button})).toEqual(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double await?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
name: 'My Button' | ||
}); | ||
|
||
const input = await page.$('input'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we split this into 3 tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Going from AXNode -> ElementHandle is turning out to be controversial. This patch instead adds a way to go from ElementHandle -> AXNode. If the API looks good, I'll add it into Firefox as well.
#3641