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

215
Views
How can I verify if a checkbox is selected using TestCafe?
import { Selector } from 'testcafe';

fixture("TestCafe Example")
    .page("http://devexpress.github.io/testcafe/example");

test("Fill out and submit form", async t => {

    await t.typeText("#developer-name", "Harun Jonuzi");
    //I Want to verify if these Checkboxes are Selected
    await t
        .click("#remote-testing")
        .click("#reusing-js-code")
        .click("#background-parallel-testing");


    await t.click("#macos");

    const preferredInterface = Selector("#preferred-interface");
    await t
        .click(preferredInterface)
        .click(preferredInterface.find("option").withText("JavaScript API"));
        

    const submitButton = Selector("#submit-button");
    await t
        .expect(submitButton.hasAttribute("disabled")).notOk();

    await t.click(submitButton);

    const headerInfo = Selector("#article-header");
    await t.expect(headerInfo.innerText).eql("Thank you, Harun Jonuzi!");
})

My question is commented out on the 6th line of the code as you can see it. I am trying o figure out how to add an assertion to verify that the checkboxes are actually checked, but I am new to TestCafe, just wanted to see If I can get some help from here.

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

0

You can use the checked property of the DOMNodeState Object, for example:

await t
    .click("#remote-testing")
    .expect(Selector('#remote-testing').checked).eql(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!