import { SelectOptions , selectOptionsInHandle } from '../../handle-actions' ; import { getHandleOf } from '../get-handle-of' ; import { WaitUntilOptions , defaultWaitUntilOptions } from '../../../utils' ; import { Frame , Page } from 'playwright' ; export async function selectOptionsInSelector ( selector , labels , page , options ) { if ( ! page ) { throw new Error ( `Cannot select options '${ labels }' because no browser has been launched` ) ; } const waitOptions = { ... defaultWaitUntilOptions , ... options , } ; const handle = await getHandleOf ( selector , page , waitOptions ) ; await selectOptionsInHandle ( handle , selector , labels , page , options ) ; }