Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda