Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Decisión de un botón por valor de entrada en ciprés

Tengo el siguiente código, que es responsable del estado de un control deslizante de casilla de verificación (activar/desactivar).

Cuando el botón está encendido:

 <div _ngcontent-ofr-c662="" class="pull-right switch switch-small"> <div _ngcontent-ofr-c662="" class="col-auto"><label _ngcontent-ofr-c662="" class="o-switch"> <input _ngcontent-ofr-c662="" type="checkbox" ng-reflect-model="true" ng-reflect-is-disabled="false" ng-reflect-options="[object Object]" class="ng-untouched ng-valid ng-dirty"><span _ngcontent-ofr-c662="" data-off="No" data-on="Yes" class="switch__obj"></span></label></div> <label _ngcontent-ofr-c662="" for="chkAllowCancelOrReschedule"></label> </div>

Y cuando el botón está apagado:

 <div _ngcontent-ofr-c662="" class="pull-right switch switch-small"> <div _ngcontent-ofr-c662="" class="col-auto"><label _ngcontent-ofr-c662="" class="o-switch"> <input _ngcontent-ofr-c662="" type="checkbox" ng-reflect-model="false" ng-reflect-is-disabled="false" ng-reflect-options="[object Object]" class="ng-untouched ng-valid ng-dirty"><span _ngcontent-ofr-c662="" data-off="No" data-on="Yes" class="switch__obj"></span></label></div> <label _ngcontent-ofr-c662="" for="chkAllowCancelOrReschedule"></label> </div>

El único estado que cambia es el de la variable ng-reflect-model

¿Cómo puedo verificar este estado y si es cierto, presione ese botón, y si está apagado, no pasa nada y la prueba continúa?

Espero haber puesto todos los detalles y no perderme nada.

Gracias.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Mire el valor del atributo usando jQuery .attr() , así

 cy.get('input').then($el => { if ($el.attr('ng-reflect-model') === 'false') { cy.wrap($el).check() } })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!