clever-night-39043
03/14/2023, 4:33 AMheaders from api request by cy.wait. It was working before, and the code is basically copied from Cypress document:
describe('test', function () {
let headers;
beforeEach(function () {
cy.intercept(userApi).as('request');
cy.visit('/')
cy.wait('@request').its('request.headers').then((headers) => {
headers = headers;
})
});
it('test', function () {
...
})
But I get this error:
> Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
The line it points to is cy.visit()
Any idea why this would happen? Thanksmammoth-doctor-80867
03/14/2023, 8:21 AMgray-kilobyte-89541
03/14/2023, 11:39 AMclever-night-39043
03/17/2023, 5:10 AM