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

223
Visualizações
return type of collection elements cypress

Hey guys sometimes there few error messages shows up and i am trying to return a collection of elements which i specifying however it complains with the following, so my question is how to get list of elements in cypress and assign sufficient type to it

Type 'Chainable<HTMLAllCollection>' is not assignable to type 'Chainable<JQuery<HTMLAllCollection>>'.
  Types of property 'and' are incompatible.
    Type 'Chainer<HTMLAllCollection>' is not assignable to type 'Chainer<JQuery<HTMLAllCollection>>'.
      Types of parameters 'value' and 'value' are incompatible.
        Type 'JQuery<HTMLAllCollection>' is missing the following properties from type 'HTMLAllCollection': item, namedIte

    static get errorMessages(): Cypress.Chainable<JQuery<HTMLAllCollection>> {
    const arrayOfElements =  cy.get<HTMLAllCollection>('app-error');
    return arrayOfElements;
  }

enter image description here

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

You're typing is inconsistent - the function is declared to return a Chainable<JQuery<HTMLAllCollection>> but the actual type of the return object is Chainable<HTMLAllCollection>. If you fix this inconsistency, it may resolve your problem.

static get errorMessages(): Cypress.Chainable<JQuery<HTMLAllCollection>> {
    return cy.get<JQuery<HTMLAllCollection>>('app-error');
}
about 4 years ago · Santiago Gelvez 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