cypress icon indicating copy to clipboard operation
cypress copied to clipboard

feat: support vite v5

Open AtofStryker opened this issue 1 month ago • 2 comments

  • Closes #28347

Additional details

Adds support for vite@5. To add support, the scaffolding config needs to support vite v4 as well as @cypress/vite-dev-server. The current architecture for @cypress/vite-dev-server is to roll forward and add support. Since significant changes aren't required and haven't been in the past, this works.

Note: if users are referencing the absolute public path in their config, they will likely need to set devServerPublicPathRoute to the expected destination of their public path. Since this default is shipped with Cypress, we cannot actively change it. Since we don't have a dedicated section to CT bundlers in our documentation, I have added it in the README of the package.

System tests are also added/updated. Unit/system tests are added for vite 5, and older system tests are updated to be on at least vite 4. This is NOT a breaking change, but gets us more in alignment with our unofficially supported last two versions.

Since I needed to change some of the path resolution behavior within the dev server, I added a new unit test, initCypressTests, since none existed and felt I needed to verify the new behavior. which additionally documents what is expected.

After this PR goes in I will work on getting the other packages updated to latest vite in the monorepo using vite@4 currently.

Steps to test

Run the added unit/system tests as well as test the build binary against a vite 5 project

How has the user experience changed?

PR Tasks

AtofStryker avatar May 14 '24 20:05 AtofStryker

6 flaky tests on run #55508 ↗︎

0 29254 1328 0 Flakiness 6

Details:

refactor resolveConfig test
Project: cypress Commit: 029f5581a0
Status: Passed Duration: 20:57 💡
Started: May 21, 2024 4:04 PM Ended: May 21, 2024 4:25 PM
Flakiness  scaffold-component-testing.cy.ts • 1 flaky test • launchpad-e2e

View Output

Test Artifacts
scaffolding component testing > vuecli4vue3 > scaffolds component testing for Vue CLI 4 w/ Vue 3 project Test Replay Screenshots
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > stops waiting when an fetch request is canceled Test Replay
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
... > stops waiting when an fetch request is canceled Test Replay
Flakiness  commands/net_stubbing.cy.ts • 3 flaky tests • 5x-driver-webkit

View Output

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="https://cloud.cypress.io/projects/ypt4pf/runs/55508/overview/18f11e5e-b7af-49c0-910d-43bcd2722135?reviewViewBy=FLAKY&utm_source=github&utm_medium=flaky&utm_campaign=view%20test">
        ... > with `resourceType` > can match a proxied image request by resourceType
      </a>
    </td>
    <td>
      
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <a href="https://cloud.cypress.io/projects/ypt4pf/runs/55508/overview/d1da490e-1459-45fb-99c6-59ddb8fad557?reviewViewBy=FLAKY&utm_source=github&utm_medium=flaky&utm_campaign=view%20test">
        ... > stops waiting when an xhr request is canceled
      </a>
    </td>
    <td>
      
    </td>
  </tr></table>

Review all test suite changes for PR #29518 ↗︎

cypress[bot] avatar May 14 '24 20:05 cypress[bot]

We've been trying to get a component test running after upgrading Vite to 5.0 (node 20.13). The only test failures we're having are from selectFile, like this: cy.get('[data-cy="prime-drop-target"] > input[type=file]').selectFile('cypress/test-files/test.file', { action: 'drag-drop', force: true, }); We get a system error, "FS" does not exist.

jdenekat avatar May 20 '24 14:05 jdenekat

We've been trying to get a component test running after upgrading Vite to 5.0 (node 20.13). The only test failures we're having are from selectFile, like this: cy.get('[data-cy="prime-drop-target"] > input[type=file]').selectFile('cypress/test-files/test.file', { action: 'drag-drop', force: true, }); We get a system error, "FS" does not exist.

@jdenekat are you able to open an issue with a reproduction?

AtofStryker avatar May 21 '24 15:05 AtofStryker

Released in 13.10.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v13.10.0, please open a new issue.

cypress-bot[bot] avatar May 21 '24 20:05 cypress-bot[bot]