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

196
Views
Valide la URL de 'imagen de fondo' de CSS usando Cypress

Estoy tratando de validar si la URL de 'imagen de fondo' de CSS tiene el código de estado '200'. ¿Es posible validar la carga de imágenes usando Cypress? ¿Alguien puede sugerir?

 it('Validate the images displayed',() => { cy.get('.logo').each(($el,index,$list) => { expect($el).to.have.css('background-image','*should pass dynamic url image*') })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Después de obtener el elemento, puede usar una función JQuery para devolver el valor css background-image ( $el.css('css-property') ), y usarlo en una función cy.request() donde lo valida. un 200

 it('Validate the images displayed',() => { cy.get('.logo').each(($el) => { // $el.css('background-image') => may take some formatting to be just right, depending on what is returned by that function. cy.request($el.css('background-image')).then((res) => { expect(res.statusCode).to.eql(200); }); }); });
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!