This guide covers testing and code quality tools in GutenbergKit.
Important, high-level test cases are documented for manual testing on native platforms. These cover scenarios that require the native shell — toolbar state, bridge round-trips, media uploads, WebView lifecycle, and block inserter via native sheet.
Test files follow the *.test.{js,jsx} naming convention.
make test-web-unitmake test-ios-library-simulatormake test-android-library-unitThese tests use Playwright to load the editor in a headless Chromium browser and verify Gutenberg editor logic — block operations, text formatting, split/merge, and data store state. No native layer is involved.
Test files live in e2e/*.spec.js.
Locally, Playwright starts the Vite dev server (npm run dev on :5173) and reuses an existing one if already running. On CI, it uses a production preview build (npm run preview on :4173) with serial workers and retries. This is configured in playwright.config.js.
Run tests:
make test-web-e2eRun in interactive UI mode:
make test-web-e2e-ui- Framework: XCUITest
- Test files:
ios/Demo-iOS/GutenbergUITests/ - Requires: Xcode and an iOS Simulator
These tests launch the Demo iOS app via XCUIApplication and verify native shell behavior — toolbar rendering, menu interactions, WebView lifecycle, and native-to-JS bridge state synchronization.
There are two ways to run the tests, depending on how the editor JS is served.
Uses the Vite dev server for faster iteration — no production build required. Start the dev server in one terminal, then run the tests in another:
# Terminal 1
make serve-dev
# Terminal 2
make test-ios-app-e2e-devThis sets TEST_RUNNER_GUTENBERG_EDITOR_URL, which xcodebuild forwards to the test runner process (with the TEST_RUNNER_ prefix stripped). The test setup then passes GUTENBERG_EDITOR_URL to the app under test via launchEnvironment, so the WebView loads from http://localhost:5173 instead of the bundled assets.
Uses the production JS bundle built by Vite. This is what CI runs and is the default make test-ios-app-e2e target:
make test-ios-app-e2eThe target depends on build and will handle it automatically.
The mode is controlled by the GUTENBERG_EDITOR_URL environment variable. When set, EditorViewController loads from that URL; otherwise it loads from the bundled index.html.
make test-ios-app-e2e-dev— setsTEST_RUNNER_GUTENBERG_EDITOR_URL=http://localhost:5173and checks that the dev server is running before starting.make test-ios-app-e2e— does not set the variable; runs a production build first.
You can also pass the variable directly if you need a custom URL:
TEST_RUNNER_GUTENBERG_EDITOR_URL=http://localhost:5173 xcodebuild test \
-project ./ios/Demo-iOS/Gutenberg.xcodeproj \
-scheme GutenbergUITests \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 17'Note: The
TEST_RUNNER_prefix is anxcodebuildconvention — variables with this prefix are forwarded to test runner processes with the prefix removed.
Before submitting a pull request, ensure your code passes formatting and linting checks.
Format code using Prettier:
make formatLint JavaScript code using ESLint:
# Auto-fix linting errors
make lint-web-fix
# Verify linting passes
make lint-web