Playwright Runner by Koushik

A VS Code extension for running Playwright & Cucumber tests effortlessly.


Usage

Installation

Install the extension from the Visual Studio Code Marketplace by searching for "Playwright Runner by Koushik" and clicking "Install".

Setting Up Environments

  • Open your user settings (File > Preferences > Settings).
  • Navigate to the extension settings under "Playwright Runner by Koushik".
  • Define your test environments and configurations (development, staging, production).
  • Define your Cucumber test commands with different environment names.

Running Playwright Tests

  • Navigate to your TypeScript or JavaScript test file.
  • The extension automatically detects test functions and suites.
  • Click on the "Run Playwright Test" code lens next to a test to execute it.

Running Cucumber Scenarios

  • Navigate to your feature file.
  • The extension detects Scenario & Scenario Outline.
  • Click on the code lens next to execute the scenario.
  • The scenario name is added to the existing user-defined command.

Managing Environments

  • Access the environment selector from the "Playwright Runner by Koushik" view in the Activity Bar.
  • View and select different environments from the tree view.
  • Set the default environment for running tests.
  • Add additional command with ${command}:
"ENV_NAME": "TEST_ENV=stagingNational ${--config=play.config.ts --headed}"

Customization

  • Customize environment configurations and default settings as per project requirements.
  • Use provided commands and settings to tailor the extension to your workflow.

Accessing Settings

  • Open the extension settings from the editor sidebar using the "Open Settings" command.
  • Modify environment configurations, default settings, and preferences directly in VS Code.

Get Started

Download the Extension

Install the extension, configure your environments, and start running Playwright tests with ease!


Instructions

Settings.json

Requirements

  • Use GitBash as your default VS Code terminal.
  • A Playwright config file is required to execute tests.
  • Enable testMatch in the config file with the test script path.
  • Cucumber setup is required as it only passes the scenario name to the terminal.

Release Notes

Refer to the change log section for updates.


Enjoy!