@@ -142,16 +142,25 @@ export class PairingRowObject {
142142 clickCancel = false
143143 ) {
144144 if ( clickOnPairRow ) {
145- await this . pairRowForClick . dispatchEvent ( 'click' ) ;
145+ await this . pairRowForClick . evaluate ( ( el : HTMLElement ) => {
146+ const input = el . querySelector ( 'input[type="checkbox"]' ) as HTMLInputElement ;
147+ if ( input ) input . click ( ) ;
148+ } ) ;
146149 await this . page . waitForTimeout ( 500 ) ;
147150 if ( ( await this . pairRow . locator ( 'input' ) . isChecked ( ) ) !== pair ) {
148- await this . pairRowForClick . dispatchEvent ( 'click' ) ;
151+ await this . pairRowForClick . evaluate ( ( el : HTMLElement ) => {
152+ const input = el . querySelector ( 'input[type="checkbox"]' ) as HTMLInputElement ;
153+ if ( input ) input . click ( ) ;
154+ } ) ;
149155 await this . page . waitForTimeout ( 500 ) ;
150156 }
151157 } else {
152158 for ( let i = 0 ; i < this . pairCheckboxesForClick . length ; i ++ ) {
153159 if ( ( await this . pairCheckboxes [ i ] . locator ( 'input' ) . isChecked ( ) ) !== pair ) {
154- await this . pairCheckboxesForClick [ i ] . dispatchEvent ( 'click' ) ;
160+ await this . pairCheckboxesForClick [ i ] . evaluate ( ( el : HTMLElement ) => {
161+ const input = el . querySelector ( 'input[type="checkbox"]' ) as HTMLInputElement ;
162+ if ( input ) input . click ( ) ;
163+ } ) ;
155164 await this . page . waitForTimeout ( 500 ) ;
156165 }
157166 }
@@ -164,7 +173,10 @@ export class PairingRowObject {
164173 indexDeviceForPair : number ,
165174 clickCancel = false
166175 ) {
167- await this . pairCheckboxesForClick [ indexDeviceForPair ] . dispatchEvent ( 'click' ) ;
176+ await this . pairCheckboxesForClick [ indexDeviceForPair ] . evaluate ( ( el : HTMLElement ) => {
177+ const input = el . querySelector ( 'input[type="checkbox"]' ) as HTMLInputElement ;
178+ if ( input ) input . click ( ) ;
179+ } ) ;
168180 await this . page . waitForTimeout ( 1000 ) ;
169181 await this . pairingPage . savePairing ( clickCancel ) ;
170182 }
@@ -216,16 +228,25 @@ export class PairingColObject {
216228 clickCancel = false
217229 ) {
218230 if ( clickOnPairRow ) {
219- await this . pairColForClick . dispatchEvent ( 'click' ) ;
231+ await this . pairColForClick . evaluate ( ( el : HTMLElement ) => {
232+ const input = el . querySelector ( 'input[type="checkbox"]' ) as HTMLInputElement ;
233+ if ( input ) input . click ( ) ;
234+ } ) ;
220235 await this . page . waitForTimeout ( 500 ) ;
221236 if ( ( await this . pairCol . locator ( 'input' ) . isChecked ( ) ) !== pair ) {
222- await this . pairColForClick . dispatchEvent ( 'click' ) ;
237+ await this . pairColForClick . evaluate ( ( el : HTMLElement ) => {
238+ const input = el . querySelector ( 'input[type="checkbox"]' ) as HTMLInputElement ;
239+ if ( input ) input . click ( ) ;
240+ } ) ;
223241 await this . page . waitForTimeout ( 500 ) ;
224242 }
225243 } else {
226244 for ( let i = 0 ; i < this . pairCheckboxesForClick . length ; i ++ ) {
227245 if ( ( await this . pairCheckboxes [ i ] . locator ( 'input' ) . isChecked ( ) ) !== pair ) {
228- await this . pairCheckboxesForClick [ i ] . dispatchEvent ( 'click' ) ;
246+ await this . pairCheckboxesForClick [ i ] . evaluate ( ( el : HTMLElement ) => {
247+ const input = el . querySelector ( 'input[type="checkbox"]' ) as HTMLInputElement ;
248+ if ( input ) input . click ( ) ;
249+ } ) ;
229250 await this . page . waitForTimeout ( 500 ) ;
230251 }
231252 }
0 commit comments