@@ -142,14 +142,18 @@ export class PairingRowObject {
142142 clickCancel = false
143143 ) {
144144 if ( clickOnPairRow ) {
145- const input = this . pairRowForClick . locator ( 'input' ) ;
146- if ( pair ) { await input . check ( { force : true } ) ; } else { await input . uncheck ( { force : true } ) ; }
145+ await this . pairRowForClick . dispatchEvent ( 'click' ) ;
147146 await this . page . waitForTimeout ( 500 ) ;
147+ if ( ( await this . pairRow . locator ( 'input' ) . isChecked ( ) ) !== pair ) {
148+ await this . pairRowForClick . dispatchEvent ( 'click' ) ;
149+ await this . page . waitForTimeout ( 500 ) ;
150+ }
148151 } else {
149152 for ( let i = 0 ; i < this . pairCheckboxesForClick . length ; i ++ ) {
150- const input = this . pairCheckboxes [ i ] . locator ( 'input' ) ;
151- if ( pair ) { await input . check ( { force : true } ) ; } else { await input . uncheck ( { force : true } ) ; }
152- await this . page . waitForTimeout ( 500 ) ;
153+ if ( ( await this . pairCheckboxes [ i ] . locator ( 'input' ) . isChecked ( ) ) !== pair ) {
154+ await this . pairCheckboxesForClick [ i ] . dispatchEvent ( 'click' ) ;
155+ await this . page . waitForTimeout ( 500 ) ;
156+ }
153157 }
154158 }
155159 await this . pairingPage . savePairing ( clickCancel ) ;
@@ -160,8 +164,7 @@ export class PairingRowObject {
160164 indexDeviceForPair : number ,
161165 clickCancel = false
162166 ) {
163- const input = this . pairCheckboxesForClick [ indexDeviceForPair ] . locator ( 'input' ) ;
164- if ( pair ) { await input . check ( { force : true } ) ; } else { await input . uncheck ( { force : true } ) ; }
167+ await this . pairCheckboxesForClick [ indexDeviceForPair ] . dispatchEvent ( 'click' ) ;
165168 await this . page . waitForTimeout ( 1000 ) ;
166169 await this . pairingPage . savePairing ( clickCancel ) ;
167170 }
@@ -213,14 +216,18 @@ export class PairingColObject {
213216 clickCancel = false
214217 ) {
215218 if ( clickOnPairRow ) {
216- const input = this . pairColForClick . locator ( 'input' ) ;
217- if ( pair ) { await input . check ( { force : true } ) ; } else { await input . uncheck ( { force : true } ) ; }
219+ await this . pairColForClick . dispatchEvent ( 'click' ) ;
218220 await this . page . waitForTimeout ( 500 ) ;
221+ if ( ( await this . pairCol . locator ( 'input' ) . isChecked ( ) ) !== pair ) {
222+ await this . pairColForClick . dispatchEvent ( 'click' ) ;
223+ await this . page . waitForTimeout ( 500 ) ;
224+ }
219225 } else {
220226 for ( let i = 0 ; i < this . pairCheckboxesForClick . length ; i ++ ) {
221- const input = this . pairCheckboxes [ i ] . locator ( 'input' ) ;
222- if ( pair ) { await input . check ( { force : true } ) ; } else { await input . uncheck ( { force : true } ) ; }
223- await this . page . waitForTimeout ( 500 ) ;
227+ if ( ( await this . pairCheckboxes [ i ] . locator ( 'input' ) . isChecked ( ) ) !== pair ) {
228+ await this . pairCheckboxesForClick [ i ] . dispatchEvent ( 'click' ) ;
229+ await this . page . waitForTimeout ( 500 ) ;
230+ }
224231 }
225232 }
226233 await this . pairingPage . savePairing ( clickCancel ) ;
0 commit comments