Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda