question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[dev]: switch from jest-playwright to playwright test

See original GitHub issue

The Playwright team has reached out and suggested we use playwright-test instead of jest-playright as our test runner. The APIs look similar but they offered to help/guide the migration.

Hi @jsjoeio! Would you consider trying playwright-test instead of jest-playwright? We at Playwright team believe that with the focused test runner it is possible to deliver better experience for e2e tests. If you are open to this, I can guide/help with the migration, as well as address the feedback on the test runner side 😄 Let me know if you are interested!

Originally posted: https://github.com/cdr/code-server/pull/3016#issuecomment-816329571

Note: I’ll probably start on this sometime this week and post thoughts and ask questions as I go here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dgozmancommented, May 25, 2021

@jsjoeio Thank you for trying the previous experimental version, your feedback helped a lot! We’ve been working on the next version, and a new alpha is ready. If you enjoy @playwright/test so far, you should give this one a try. The new alpha is versioned 0.1112.0-alpha1.

Here is a preview of the upcoming documentation and migration guide. However, since you have tried the experimental version (thank you!), migration will be a bit different for you:

  • Configuration file format has changed, please see an example in the documentation above. Overall, it should be a bit easier now. More details about configuration.
  • Instead of passing options as a second parameter to the test('title', options, func), you should now call test.use(options) to declare options for a file or a describe block.
  • globalSetup / globalTeardown now lives in a separate file. More details about global hooks.
  • If you have started using custom environments, you’ll have to switch to fixtures. That’s somewhat involved, and reading Folio documentation is necessary.

Let me know if you are willing to try this, and send me all the questions.


Answering some of the older questions, based on the new version:

  • 'const' enums are not supported. getting this when importing a variable from an external file that uses an enum.

    I guess this is a babel thing. We have bumped the babel version, let me know if this still happens.

  • wish the docs explained how to resetContext before running a test (ensure cookies are cleared)

    This is done by default. Each test is isolated from others.

  • config option to choose name of video directory - I want them to be stored under /videos

    This is not done yet. You should get videos per test in test-results/test-file-test-name directories.

  • docs only show npm install. show yarn too

    Not done yet.

  • Honestly, I wish folio had --reporter=jest so that I could get a jest-like reporter out of the box. I like the green checkmarks and the PASS.

    No significant progress on reporters, but we’ll focus on them soon.

1reaction
dgozmancommented, Apr 15, 2021

@jsjoeio Great! Thank you for your feedback. We’ll keep addressing it, and I will comment here with an update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running tests using Jest & Playwright - GitHub
Jest Playwright integrates a functionality to start a server when running your test suite, like jest-puppeteer. It automatically closes the server when tests...
Read more >
Using Jest with Playwright
In this blog post, we'll compare two Jest setups for creating and running end-to-end tests with Playwright.
Read more >
Getting started with Playwright with Jest and TypeScript
We'll cover how to get up and running with Playwright using Jest as the test runner and how to set up the project...
Read more >
javascript - How to move from jest with user journey like tests ...
So I used playwright + jest to build-up user journeys and integrated them in a CI/CD process. Since playwright created it's own test...
Read more >
Run Jest Playwright tests on BrowserStack
Running your first Jest Playwright test suite on BrowserStack is super easy. Here's a quick start guide to help you get started with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found