MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / grabAriaSnapshot

Method grabAriaSnapshot

lib/helper/Playwright.js:2935–2942  ·  view source on GitHub ↗

* 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')

Source from the content-addressed store, hash-verified

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 }}

Callers 2

captureSnapshotFunction · 0.80
Playwright_test.jsFile · 0.80

Calls 2

_locateMethod · 0.95
assertElementExistsFunction · 0.70

Tested by

no test coverage detected