MCPcopy
hub / github.com/codeceptjs/CodeceptJS / _withinBegin

Method _withinBegin

lib/helper/WebDriver.js:794–813  ·  view source on GitHub ↗
(locator)

Source from the content-addressed store, hash-verified

792 }
793
794 async _withinBegin(locator) {
795 const frame = isFrameLocator(locator)
796 if (frame) {
797 this.browser.isInsideFrame = true
798 if (Array.isArray(frame)) {
799 // this.switchTo(null);
800 await forEachAsync(frame, async f => this.switchTo(f))
801 return
802 }
803 await this.switchTo(frame)
804 return
805 }
806 this.context = locator
807
808 let res = await this.browser.$$(withStrictLocator(locator))
809 assertElementExists(res, locator)
810 res = usingFirstElement(res)
811 this.context = res.selector
812 this.$$ = res.$$.bind(res)
813 }
814
815 async _withinEnd() {
816 if (this.browser.isInsideFrame) {

Callers

nothing calls this directly

Calls 7

switchToMethod · 0.95
forEachAsyncFunction · 0.85
withStrictLocatorFunction · 0.85
usingFirstElementFunction · 0.85
$$Method · 0.80
isFrameLocatorFunction · 0.70
assertElementExistsFunction · 0.70

Tested by

no test coverage detected