الحصول على الحجم
الحصول على العرض والارتفاع لعنصر DOM.
الاستخدام
$(selector).getSize(prop)
المعلمات
الاسم | النوع | التفاصيل |
---|---|---|
prop اختياري | String | الحجم المراد استلامه [اختياري] ("width" أو "height") |
مثال
getSize.js
it('should demonstrate the getSize command', async () => {
await browser.url('http://github.com')
const logo = await $('.octicon-mark-github')
const size = await logo.getSize()
console.log(size) // outputs: { width: 32, height: 32 }
const width = await logo.getSize('width')
console.log(width) // outputs: 32
const height = await logo.getSize('height')
console.log(height) // outputs: 32
})