Rayrun
← Back to videos

Playing Your Tests Wright with VS Code

Install Playwright and run and debug your tests right in VS Code with the VS Code extension. Choose which browser you want to run your tests on and visually see your tests run in the browser window. Use the built in test generator to generate your tests by recording your actions from the browser window. The generator creates a test file right in VS Code and records each step of the test for you. With Playwright and VS Code writing and running tests is easy and fun.

In this video, we explore how to use the Playwright extension in Visual Studio Code (VS Code) for end-to-end testing of modern web applications. Playwright is known for its reliability, fast execution, powerful tooling, and multi-language support. This tutorial is focused on using TypeScript and JavaScript for testing.

To get started with Playwright in VS Code:

  1. Install the Playwright Test for VS Code extension from the Extensions tab.
  2. Use the command panel to install Playwright.
  3. Choose which browsers you want to use for testing, such as Chromium, Firefox, or WebKit.
  4. Opt for TypeScript or JavaScript, and decide whether to add a GitHub Actions workflow for continuous integration.

Once everything is installed, you will see a test folder, a test examples folder, and a Playwright configuration file in your project. You can run tests directly from the Testing sidebar in VS Code, without using the terminal. You can also choose to show the browser when running a test to see the test execution visually.

Additionally, you can debug your tests within VS Code, setting breakpoints and stepping through each action. This makes it easier to identify and fix errors in your tests. Playwright extension also allows you to record tests, generate test code, and even pick specific locators on a web page to add to your test code.

You have the option to run tests on multiple browsers simultaneously by setting the default profile in the Testing sidebar. This will enable you to visually confirm that all your tests are running correctly on every browser that you have chosen.

In conclusion, the Playwright extension for VS Code makes testing modern web applications faster and easier, with powerful features such as live debugging, test recording, and multi-browser testing. Happy testing!

Related Videos

#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1
Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1
Getting Started with Playwright and VS Code
Getting Started with Playwright and VS Code
Working with multiple elements in Playwright Test (NodeJS)
Working with multiple elements in Playwright Test (NodeJS)
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].