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

297
Views
Verify the checkbox is checked in Cypress

I want to verify the checkbox is checked. This is the HTML for the checkbox

enter image description here

the js for it:

    localShopClerkcheckbox(){
        return cy.get("[name='isLocalClerk']")
        //return cy.get(':nth-child(4) > .dx-box-flex > :nth-child(2) > .dx-item-content > .dx-last-col > .dx-field-item-content > .dx-show-invalid-badge > .dx-checkbox-container > .dx-checkbox-icon')
    }

Then on step definition:

Then("I see the Local Shop clerk is selected",() =>{
    backofficeCreateDeleteClerkPage.localShopClerkcheckbox().should('have.attr','aria-checked',true)

})

strangely Cypress shows that the expected value was true but the value was true

enter image description here

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

0

You have to change true to 'true'. The true is a string.

backofficeCreateDeleteClerkPage
  .localShopClerkcheckbox()
  .should('have.attr', 'aria-checked', 'true')
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!