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

test: fix snapshot replacement #5468

Merged
merged 2 commits into from Apr 2, 2024
Merged

Conversation

AriPerkkio
Copy link
Member

Description

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit 4051610
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/660ae08d30d3ba000888063c

@AriPerkkio
Copy link
Member Author

CI keeps failing on the playwright example no matter what. That one is unrelated to this fix though.

Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

I don't know what to do with playwright example either. DEBUG=pw:api can maybe show something https://playwright.dev/docs/debug#verbose-api-logs

When I run locally I see something like:

DEBUG=pw:api
$ DEBUG=pw:api pnpm -C examples/playwright test

2024-04-02T02:29:44.621Z pw:api => browserType.launch started
 ❯ test/basic.test.ts (1)
   ❯ basic (1)
 ❯ test/basic.test.ts (1)
   ❯ basic (1)
 ❯ test/basic.test.ts (1)
 ❯ test/basic.test.ts (1)
   ❯ basic (1)
     ⠙ should change count when button clicked
2024-04-02T02:29:44.995Z pw:api   "commit" event fired
2024-04-02T02:29:44.995Z pw:api   navigated to "http://localhost:3001/"
2024-04-02T02:29:45.000Z pw:api   "domcontentloaded" event fired
2024-04-02T02:29:45.001Z pw:api   "load" event fired
2024-04-02T02:29:45.001Z pw:api <= page.goto succeeded
 ❯ test/basic.test.ts (1)
   ❯ basic (1)
     ⠸ should change count when button clicked
2024-04-02T02:29:45.027Z pw:api   locator resolved to <button>Clicked 0 time(s)</button>
2024-04-02T02:29:45.027Z pw:api <= locator._expect succeeded
2024-04-02T02:29:45.029Z pw:api => locator._expect started
2024-04-02T02:29:45.029Z pw:api locator._expect with timeout 5000ms
2024-04-02T02:29:45.029Z pw:api waiting for getByRole('button', { name: /Clicked/ })
2024-04-02T02:29:45.032Z pw:api   locator resolved to <button>Clicked 0 time(s)</button>
2024-04-02T02:29:45.033Z pw:api <= locator._expect succeeded
2024-04-02T02:29:45.033Z pw:api => locator.click started
2024-04-02T02:29:45.034Z pw:api waiting for getByRole('button', { name: /Clicked/ })
 ❯ test/basic.test.ts (1)
   ❯ basic (1)
     ⠴ should change count when button clicked
2024-04-02T02:29:45.068Z pw:api   element is visible, enabled and stable
2024-04-02T02:29:45.068Z pw:api   scrolling into view if needed
2024-04-02T02:29:45.068Z pw:api   done scrolling
2024-04-02T02:29:45.070Z pw:api   performing click action
2024-04-02T02:29:45.073Z pw:api   click action done
2024-04-02T02:29:45.073Z pw:api   waiting for scheduled navigations to finish
 ❯ test/basic.test.ts (1)
   ❯ basic (1)
     ⠦ should change count when button clicked
2024-04-02T02:29:45.075Z pw:api locator._expect with timeout 5000ms
2024-04-02T02:29:45.075Z pw:api waiting for getByRole('button', { name: /Clicked/ })

@hi-ogawa hi-ogawa merged commit ffec1dc into vitest-dev:main Apr 2, 2024
18 of 19 checks passed
@AriPerkkio AriPerkkio deleted the test/fix-replace branch April 2, 2024 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants