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

Method getBoundingBox

lib/element/WebElement.js:201–218  ·  view source on GitHub ↗

* Get bounding box of the element * @returns {Promise } Bounding box with x, y, width, height properties

()

Source from the content-addressed store, hash-verified

199 * @returns {Promise<Object>} Bounding box with x, y, width, height properties
200 */
201 async getBoundingBox() {
202 switch (this.helperType) {
203 case 'playwright':
204 return this.element.boundingBox()
205 case 'webdriver':
206 const rect = await this.element.getRect()
207 return {
208 x: rect.x,
209 y: rect.y,
210 width: rect.width,
211 height: rect.height,
212 }
213 case 'puppeteer':
214 return this.element.boundingBox()
215 default:
216 throw new Error(`Unsupported helper type: ${this.helperType}`)
217 }
218 }
219
220 /**
221 * Click the element

Callers 2

WebElement_test.jsFile · 0.80
els_test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected