Skip to content
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

readFile command cannot read file with special symbols in name on Linux Debian - it says there is no such file #29589

Open
mmisty opened this issue May 29, 2024 · 1 comment
Labels
pkg/driver This is due to an issue in the packages/driver directory stale no activity on this issue for a long period type: bug

Comments

@mmisty
Copy link

mmisty commented May 29, 2024

Current behavior

using

cy.readFile('cypress/fixtures/ü.pdf');

throws error on Linux Debian (works fine on MacOS):

Timed out retrying after 15000ms: `cy.readFile("cypress/fixtures/ü.pdf")` failed because the file does not exist at the following path:

`/harness/cypress/fixtures/ü.pdf`

https://on.cypress.io/readfile

Desired behavior

Do not throw since file exists.

Test code to reproduce

  1. create file file-ß.pdf on Mac OS, commit
  2. create test file with contents:
describe('page', () => {
  const html = `
    <html>
    <head></head>
    <body>
      <input type="file" name="comment" id="comment_file" accept>
    </body>
    </html>
    `;

  it('should select file with special characters', () => {
    const fileName = 'file-ß.pdf';

    cy.intercept('mytest.com', { body: html });
    cy.visit('https://mytest.com');

    cy.get('input').selectFile(`cypress/fixtures/${fileName}`);
    cy.get('input').should('not.have.value', '');
    cy.get('input').should((t) => {
      expect(t.val()).to.include(fileName);
    });
    cy.screenshot({ capture: 'runner' });
  });
});
  1. commit
  2. run on Linux Debian system

Expected: should pass
Actual: test fails with message:

Timed out retrying after 15000ms: `cy.readFile("cypress/fixtures/ü.pdf")` failed because the file does not exist at the following path:

`/harness/cypress/fixtures/ü.pdf`

https://on.cypress.io/readfile

Cypress Version

13.9.0

Node version

v18.12.0

Operating System

Linux Debian

Debug Logs

No response

Other

No response

@jennifer-shehane jennifer-shehane added type: bug pkg/driver This is due to an issue in the packages/driver directory good first issue Good for newcomers labels Jun 3, 2024
@jennifer-shehane jennifer-shehane removed the good first issue Good for newcomers label Jul 21, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory stale no activity on this issue for a long period type: bug
Projects
None yet
Development

No branches or pull requests

3 participants