* Retrieves the ARIA snapshot for an element using Playwright's [`locator.ariaSnapshot`](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot). * This method returns a YAML representation of the accessibility tree that can be used for assertions. * If no locator is provided, it
(locator = '//body')
| 2933 | * @return {Promise<string>} YAML representation of the accessibility tree |
| 2934 | */ |
| 2935 | async grabAriaSnapshot(locator = '//body') { |
| 2936 | const matchedLocator = new Locator(locator) |
| 2937 | const els = await this._locate(matchedLocator) |
| 2938 | assertElementExists(els, locator) |
| 2939 | const snapshot = await els[0].ariaSnapshot() |
| 2940 | this.debugSection('Aria Snapshot', `${snapshot.split('\n').length} lines`) |
| 2941 | return snapshot |
| 2942 | } |
| 2943 | |
| 2944 | /** |
| 2945 | * {{> saveElementScreenshot }} |
no test coverage detected