Getting Started
Getting Started with Appetize AppRecorder and Playwright
You can follow along with the installation steps below to start a new project, or you can clone the example project here.
Installation
Get started by installing Playwright with Appetize using npm:
npm init @appetize/playwright@latest
Run the install command and select the following to get started:
Your Appetize App's
The preferred default device
What's Installed
A Playwright project will be created (see Playwright documentation).
The
@appetize/playwright
npm package will be installed.The
playwright.config.ts
file will be configured for Appetize with the specified values for the default device and app.
An example test file,
app.spec.ts
, will be added.
Usage
Update the app.spec.ts
file in your tests folder to include a test relevant to your application
import { test, expect } from '@appetize/playwright'
test('example test', async ({ session }) => {
await expect(session).toHaveElement({
attributes: {
// replace with the text of an element that appears on your app
text: 'Hello world'
}
})
})
Once you've updated the test file for your app, run the test with:
npx playwright test --headed
# or, headlessly
npx playwright test
Next Steps
Writing TestsTest ConfigurationLast updated