Skip to content

Playwright.el: A cli wrapper for the Playwright end-to-end test suite

License

Notifications You must be signed in to change notification settings

mbrignall/playwright-emacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Playwright.el - Emacs Interface for Playwright

https://github.com/minad/corfu/raw/screenshots/emacs.svg?raw=true

./img/pwemacs.png

Introduction

Playwright.el provides an Emacs interface for the Playwright testing framework, allowing users to run and interact with Playwright tests directly from Emacs. It supports various Playwright commands and offers a convenient popup interface using transient for selecting and executing these commands.

Installation

Dependencies

Ensure you have Playwright installed in your project or globally. You can install it using npm:

npm i -D @playwright/test
  • Emacs version 29.1 or later is required as it’s all I’ve tested it on.

Manual Installation

To install Playwright.el manually, clone the repository and add the following to your Emacs configuration:

(add-to-list 'load-path "/path/to/playwright.el")
(require 'playwright)

Replace “/path/to/playwright.el” with the actual path to the downloaded directory.

Using Package Managers

Playwright.el is not yet available on MELPA or other package repositories. Future releases aim to support this.

Usage

The package offers several commands which can be accessed through a popup menu. Use the shortcut C-c t p to open the Playwright command popup. Available commands include:

  • Run All Tests: Executes all Playwright tests.
  • Run Single Test File: Prompts for a test file and runs it.
  • Run Tests in Headed Mode: Executes tests in headed browsers.
  • Run Tests with UI Mode: Runs tests in interactive UI mode.
  • Run Tests with Debug Mode: Executes tests in debug mode with Playwright Inspector.
  • Additional options: Allows running tests with specific flags and arguments such as –project, –workers, and custom flags.

Each command opens the output in a separate Emacs buffer, allowing you to view test results directly within Emacs.

Configuration

Currently, Playwright.el does not require additional configuration. Future versions may include customizable variables to enhance user experience.

To-Dos

  • [ ] Explore integration with project.el for project-specific Playwright configurations.
  • [ ] Enhance error handling to provide more informative feedback within Emacs.
  • [ ] Test and ensure compatibility with older versions of Emacs.
  • [ ] Prepare for distribution on MELPA or other Emacs package repositories.
  • [X] Add support for additional Playwright CLI ‘–’ options as interactive commands in the popup menu.
  • [X] Add support for running tests on specific browsers (Chromium, Firefox, WebKit).
  • [X] Add support for running tests with different reporter options.
  • [X] Include customizable Emacs variables for default settings such as default browser or test directory.

Contributing

Contributions to Playwright.el are welcome. Whether it’s adding new features, fixing bugs, or improving documentation, your help is appreciated.

License

Playwright.el is distributed under the GNU General Public License v3.0. See the LICENSE file for more details.

Contact

For questions or suggestions regarding Playwright.el, feel free to open an issue on the repo.

Acknowledgements

The makers of transient.el for making it easy to create popup menus in Emacs and making Magit! Anyone who loves using Emacs.

About

Playwright.el: A cli wrapper for the Playwright end-to-end test suite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published