Skip to content

Playwright test utilities for Juno's emulator

License

Notifications You must be signed in to change notification settings

junobuild/emulator-playwright

Repository files navigation

@junobuild/emulator-playwright

A Playwright library to simplify the integration of the Juno Console and CLI in E2E tests.

Page Objects

  • ConsolePage — Interact with the Juno Console (sign in, create satellites, copy IDs, etc.)
  • CliPage — Wrap the Juno CLI (login, deploy, snapshots, config management, etc.)
  • SatellitePage — Interact with a deployed satellite project

Test Suite Helpers

initEmulatorSuite

Creates a full emulator test suite: signs in to the Console, creates a satellite, and logs in via the CLI.

const getPages = initEmulatorSuite({satelliteKind: 'website'});

test('...', async () => {
  const {consolePage, cliPage} = getPages();
});

initSatelliteSuite

Lighter suite for tests that target an already-deployed satellite from the local config.

const getPages = initSatelliteSuite();

test('...', async () => {
  const {satelliteId, cliPage} = getPages();
});

Requirements

  • Juno emulator running locally
  • juno.config.ts with a <DEV_SATELLITE_ID> placeholder

About

Playwright test utilities for Juno's emulator

Resources

License

Stars

Watchers

Forks