electron-automation-template

Project preview

Use Playwright to test the Notion native app

Introduction

Automate tests for your Electron apps using Playwright & TypeScript!

GitHub Repo

https://github.com/steven-the-qa/electron-automation-template

Tech Stack

  • Playwright (ElectronJS app testing support)
  • TypeScript (type safety)
  • NodeJS (writing to the file system)
  • RobotJS (Playwright doesn’t do keyboard navigation well within a select menu)

Getting Started

  1. Clone the repository
  2. IF ON WINDOWS (maybe just Windows 10, idk), install an extra dependency to support RobotJS keyboard commands BEFORE installing all dependencies (otherwise, things get weird):
npm install -g node-gyp
  1. Install the Visual Studio Tools with the “Desktop Development with C++” workload to support node-gyp
  2. To install all dependencies minus unnecessary Playwright browsers (because Electron), run:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm ci
  1. To run tests, run npm test from the root directory