(uid: string)
| 335 | } |
| 336 | |
| 337 | async getElementByUid(uid: string): Promise<ElementHandle<Element>> { |
| 338 | if (!this.textSnapshot) { |
| 339 | throw new Error( |
| 340 | `No snapshot found for page ${this.id ?? '?'}. Use ${takeSnapshot.name} to capture one.`, |
| 341 | ); |
| 342 | } |
| 343 | const node = this.textSnapshot.idToNode.get(uid); |
| 344 | if (!node) { |
| 345 | throw new Error(`Element uid "${uid}" not found on page ${this.id}.`); |
| 346 | } |
| 347 | return this.#resolveElementHandle(node, uid); |
| 348 | } |
| 349 | |
| 350 | async #resolveElementHandle( |
| 351 | node: TextSnapshotNode, |
no test coverage detected