abramenal / cypress-file-upload

File upload testing made easy
https://npm.im/cypress-file-upload
MIT License
496 stars 89 forks source link

Running upload test after another upload test fails to trigger upload[Bug] #272

Closed teebu closed 2 years ago

teebu commented 3 years ago

Current behavior:

I can perform each test individually, doing a it.only(), but running them together, 1+ it fails to trigger the upload.

Also tried with 2 seperate describes.

Desired behavior:

Each test should upload a file and trigger without problems.

Steps to reproduce: (app code and test code)

  it.only(`upload 1`, () => { // works
    cy.getBySel('file-drop').attachFile('files/text.pdf');
  });

  it.only(`upload 2`, () => { // doesn't trigger
    cy.getBySel('file-drop').attachFile('files/text.pdf');
  });

note: this works when the name of the attached file in each test is unique to other tests.

Interesting thing to note this works in single test:

it(`upload 1`, () => {
    cy.getBySel('file-drop').attachFile('files/text.pdf');
    cy.wait(2000)
    cy.getBySel('upload-close').click()
    cy.wait(2000)
    cy.getBySel('file-drop').attachFile('files/text.pdf');
  });

Versions

cypress-file-upload: 5.0.2 cypress: 6.4.0

teebu commented 3 years ago

After further testing im not sure if it's related to name or not. I added a slight delay, and it seems to be working. Can you verify this is not an issue and close it.

abramenal commented 2 years ago

Don't think this is relevant anymore. Feel free to reopen if you still experience this.