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

221
Views
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 answers
Answer question

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 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!