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

feat: element option in page.accessibility.snapshot() #4318

Merged
merged 4 commits into from May 10, 2019

Conversation

JoelEinbinder
Copy link
Collaborator

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

@aslushnikov
Copy link
Contributor

High-level questions:

  • Is there any particular reason why this is not under page.accessibility namespace?
  • How does it actually help to solve the AXNode -> ElementHandle dilemma?

@JoelEinbinder JoelEinbinder changed the title feat: elementHandle.accessibilitySnapshot() feat: element option in page.accessibility.snapshot() May 9, 2019
@JoelEinbinder
Copy link
Collaborator Author

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.

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

double await?!

Copy link
Collaborator Author

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');
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

docs/api.md Outdated Show resolved Hide resolved
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