(locator)
| 693 | } |
| 694 | |
| 695 | async _withinBegin(locator) { |
| 696 | if (this.withinLocator) { |
| 697 | throw new Error("Can't start within block inside another within block") |
| 698 | } |
| 699 | |
| 700 | const frame = isFrameLocator(locator) |
| 701 | |
| 702 | if (frame) { |
| 703 | if (Array.isArray(frame)) { |
| 704 | return this.switchTo(null).then(() => frame.reduce((p, frameLocator) => p.then(() => this.switchTo(frameLocator)), Promise.resolve())) |
| 705 | } |
| 706 | await this.switchTo(frame) |
| 707 | this.withinLocator = new Locator(frame) |
| 708 | return |
| 709 | } |
| 710 | |
| 711 | const el = await this._locateElement(locator) |
| 712 | if (!el) { |
| 713 | throw new ElementNotFound(locator, 'Element for within context') |
| 714 | } |
| 715 | this.context = el |
| 716 | |
| 717 | this.withinLocator = new Locator(locator) |
| 718 | } |
| 719 | |
| 720 | async _withinEnd() { |
| 721 | this.withinLocator = null |
nothing calls this directly
no test coverage detected