···167167}
168168169169export function getIframeScale(): number {
170170- const testerUi = window.parent.document.querySelector('#tester-ui') as HTMLElement | null
170170+ const testerUi = window.parent.document.querySelector(`iframe[data-vitest]`)?.parentElement
171171 if (!testerUi) {
172172 throw new Error(`Cannot find Tester element. This is a bug in Vitest. Please, open a new issue with reproduction.`)
173173 }
···99 getByTextSelector,
1010 getByTitleSelector,
1111} from 'ivya'
1212-import { getBrowserState } from '../../utils'
1312import { getIframeScale, processTimeoutOptions } from '../utils'
1413import { Locator, selectorEngine } from './index'
1514···106105}
107106108107function processDragAndDropOptions(options_?: UserEventDragAndDropOptions) {
109109- // only ui scales the iframe, so we need to adjust the position
110110- if (!options_ || !getBrowserState().config.browser.ui) {
108108+ if (!options_) {
111109 return options_
112110 }
113111 const options = options_ as NonNullable<
···123121}
124122125123function processHoverOptions(options_?: UserEventHoverOptions) {
126126- // only ui scales the iframe, so we need to adjust the position
127127- if (!options_ || !getBrowserState().config.browser.ui) {
124124+ if (!options_) {
128125 return options_
129126 }
130127 const options = options_ as NonNullable<
···137134}
138135139136function processClickOptions(options_?: UserEventClickOptions) {
140140- // only ui scales the iframe, so we need to adjust the position
141141- if (!options_ || !getBrowserState().config.browser.ui) {
137137+ if (!options_) {
142138 return options_
143139 }
144140 const options = options_ as NonNullable<