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

284
Views
Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise cy.wait and cy.get

I have two blocks of tests that start similar but the second one always fails. In the JS code, I'm changing between "completed" and "canceled" with socket.io

[Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise

The command that returned the promise was:

cy.wait()

The cy command you invoked inside the promise was:

cy.get()] IMAGE

My code

describe('REMI: Logistic > History > Orders', () => {
  beforeEach(() => {
    cy.intercept('GET', '/v1/zones***').as('get-zones');
    cy.visit('/logistic/history');
  });
  
  it('Get the first canceled order and open modal', () => {
    cy.wait('@get-zones');
    cy.get('.css-6j8wv5-Input:first').click().type('san Jose{enter}');
    cy.get('.css-6j8wv5-Input').eq(1).click().type('canceled{enter}');
    cy.get('#date-init').type('2021-01-19');
    cy.get('.order-card:first').should('exist');

    cy.get('.order-card:first .view-order__text').click();
    cy.contains('Order #').should('exist');
  });

  it('Get the first completed order and open modal', () => {
    cy.wait('@get-zones');    
    cy.get('.css-6j8wv5-Input:first').click().type('san Jose{enter}');
    cy.get('.css-6j8wv5-Input').eq(1).click().type('completed{enter}');
    cy.get('#date-init').type('2021-01-19');
    cy.get('.order-card:first').should('exist');

    cy.get(
      'div.ordershistory-container > div.ordershistory-list > div.card_container:first > div:nth-child(3) > p'
    ).click();
    cy.contains('Order #').should('exist');
  });
});

about 4 years ago · Juan Pablo Isaza
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!