browser_elementFromPoint.js (998B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 addUiaTask( 8 ` 9 <button id="button">button</p> 10 <a id="a" href="#">a</a> 11 `, 12 async function () { 13 ok( 14 await runPython(` 15 global doc 16 doc = getDocUia() 17 button = findUiaByDomId(doc, "button") 18 rect = button.CurrentBoundingRectangle 19 found = uiaClient.ElementFromPoint(POINT(rect.left + 1, rect.top + 1)) 20 return uiaClient.CompareElements(button, found) 21 `), 22 "ElementFromPoint on button returns button" 23 ); 24 ok( 25 await runPython(` 26 a = findUiaByDomId(doc, "a") 27 rect = a.CurrentBoundingRectangle 28 found = uiaClient.ElementFromPoint(POINT(rect.left + 1, rect.top + 1)) 29 return uiaClient.CompareElements(a, found) 30 `), 31 "ElementFromPoint on a returns a" 32 ); 33 } 34 );