Open
Description
Current behavior
My tests are failing with the following error when executing in github action (these pass on local execution):
CypressError:
cy.selectFile("/home/runner/work/qa-cypress/qa-cypress/cypress/downloads/PersonalTaxReturn.jpg")
failed because the file does not exist at the following path:
/home/runner/work/qa-cypress/qa-cypress/cypress/downloads/PersonalTaxReturn.jpg
I have verified that this file exists in my github runner image:
Run echo "Absolute path to cypress/downloads:"
Absolute path to cypress/downloads:
/home/runner/work/qa-cypress/qa-cypress/cypress/downloads
total [6](**REDACTED ****)80
drwxr-xr-x 2 runner docker 4096 May 15 1[7](https:**REDACTED ****):35 .
drwxr-xr-x 7 runner docker 4096 May 15 17:35 ..
-rw-r--r-- 1 runner docker 614[8](https:**REDACTED ****) May 15 17:35 .DS_Store
-rw-r--r-- 1 runner docker 173527 May 15 17:35 BankStatement3Month.pdf
-rw-r--r-- 1 runner docker 173527 May 15 17:35 BankStatement6Month.pdf
-rw-r--r-- 1 runner docker 14132[9](**REDACTED ****) May 15 17:35 BusinessTaxReturn.jpg
-rw-r--r-- 1 runner docker 38719 May 15 17:35 GovermentID.jpg
-rw-r--r-- 1 runner docker 141329 May 15 17:35 PersonalTaxReturn.jpg
Please correct this issue.
Desired behavior
cy.selectFile() works in github action the same as in local exeuction
Test code to reproduce
it.only("can add note to uploaded file", () => {
const filePath = `${Cypress.config("fileServerFolder")}/cypress/downloads/PersonalTaxReturn.jpg`;
cy.get("input[type=file]").first().selectFile(filePath, {
force: true,
}); // force: true is needed to bypass the hidden input field
cy.wait(1000); // wait for the file to upload
// clean up the uploaded file by removing it
cy.get(removeIcon).contains(localizedString("Remove")).click();
cy.wait(2000);
// Verify that all remove buttons are gone
cy.get(removeIcon).contains(localizedString("Remove")).should("not.exist");
});
Cypress Version
14.3.2
Node version
23.11.1
Operating System
Download action repository 'cypress-io/github-action@v6'
Debug Logs
Other
No response