-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test runs fine individually but fails when "run all" is given #2028
Comments
I guess it was timing out. I increased the time out to work. it('should verify the file upload for channels', function() {
const fileName = 'channels.csv';
const method = 'POST';
const url = 'http://localhost:3000/api/channels';
const fileType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
const expectedAnswer = 'Successfully updated channels database';
// Get file from fixtures as binary
cy.fixture(fileName, 'binary').then((excelBin) => {
// File in binary format gets converted to blob so it can be sent as Form data
Cypress.Blob.binaryStringToBlob(excelBin, fileType).then((blob) => {
// Build up the form
const formData = new FormData();
formData.set('file', blob, fileName); //adding a file to the form
// Perform the request
cy.form_request(method, url, formData, function (response) {
console.log(response);
expect(response.status).to.equal(200)
expect(response.response).to.equal(expectedAnswer)
})
})
}).wait(55000)
}); |
You're not returning the You have to return promises to a Also - running "All Tests" from the GUI is not a good idea. We've documented this in detail in another issue, which is why we moved to running all of your specs in isolation with In other words, don't use |
Thank you @brian-mann |
@brian-mann : You wrote that 'running "All Tests" from the GUI is not a good idea'; |
Current behavior:
I am uploading a csv file using XHR and form data. It takes nearly a minute for the server to parse the .csv and write the content in the database. These test cases work fine when run by itself, when I click on run all it fails and it gets status 500 even when the server sends back 200 !
The text was updated successfully, but these errors were encountered: