{"id":12819,"library":"appwright","title":"Appwright: Mobile E2E Testing Framework","description":"Appwright (current version 0.1.45) is an open-source end-to-end testing framework designed for native mobile applications on both iOS and Android platforms. It differentiates itself by providing a Playwright-like API for mobile automation, building upon the industry-standard Appium for device interaction and leveraging Playwright's robust test runner and reporting capabilities. This integrated approach combines the automation driver, test runner, and test reporter into a single package, aiming to simplify mobile E2E testing which often involves complex setups. Appwright exposes an ergonomic API that includes auto-waiting and auto-retrying mechanisms for UI elements, making tests more readable and resilient to timing issues. As a relatively new project, it is currently in pre-1.0.0 development, indicated by its frequent patch releases, and is actively seeking community feedback and contributions to mature towards a stable major release. It supports testing on local devices, emulators, and remote device farms like BrowserStack and LambdaTest.","status":"active","version":"0.1.45","language":"javascript","source_language":"en","source_url":"https://github.com/empirical-run/appwright","tags":["javascript","e2e","automation","ios","android","testing","typescript"],"install":[{"cmd":"npm install appwright","lang":"bash","label":"npm"},{"cmd":"yarn add appwright","lang":"bash","label":"yarn"},{"cmd":"pnpm add appwright","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Appwright is primarily designed for ESM and TypeScript environments. CommonJS require() is not officially supported and may lead to issues.","wrong":"const { test, expect } = require('appwright');","symbol":"test, expect","correct":"import { test, expect } from 'appwright';"},{"note":"These symbols are used for configuring Appwright, typically in `appwright.config.ts`.","wrong":"const { defineConfig, Platform } = require('appwright');","symbol":"defineConfig, Platform","correct":"import { defineConfig, Platform } from 'appwright';"},{"note":"The `device` fixture is automatically provided to your test functions and represents the mobile device under test. It is the primary API for interacting with the application.","symbol":"device","correct":"test('My test', async ({ device }) => { /* ... */ });"}],"quickstart":{"code":"import { defineConfig, Platform, test, expect } from \"appwright\";\n\n// appwright.config.ts\nexport default defineConfig({\n  projects: [\n    {\n      name: \"android\",\n      use: {\n        platform: Platform.ANDROID,\n        device: {\n          provider: \"emulator\"\n        },\n        buildPath: \"app-release.apk\" // Replace with your actual APK path\n      }\n    },\n    {\n      name: \"ios\",\n      use: {\n        platform: Platform.IOS,\n        device: {\n          provider: \"emulator\"\n        },\n        buildPath: \"app-release.app\" // Replace with your actual .app/.ipa path\n      }\n    }\n  ]\n});\n\n// tests/login.spec.ts\ntest(\"User can login successfully\", async ({ device }) => {\n  await device.getByText(\"Username\").fill(\"admin\");\n  await device.getByText(\"Password\").fill(\"password\");\n  await device.getByText(\"Login\").tap();\n  await expect(device.getByText(\"Welcome, admin!\")).toBeVisible();\n});\n\n// To run:\n// npm install --save-dev appwright\n// touch appwright.config.ts (copy config above)\n// npx appwright test --project android","lang":"typescript","description":"Demonstrates how to install Appwright, set up a basic configuration for Android and iOS projects, and write a simple E2E test to simulate user login."},"warnings":[{"fix":"Ensure your Node.js environment meets the minimum requirement. Use nvm or your package manager to update Node.js to a supported version (e.g., `nvm install 18.20.4` or `nvm use 18.20.4`).","message":"Appwright requires Node.js version 18.20.4 or higher. Running with older Node.js versions may lead to installation failures or runtime errors.","severity":"gotcha","affected_versions":"<=0.1.45"},{"fix":"Refer to the documentation of your chosen cloud provider (BrowserStack, LambdaTest, etc.) for how to obtain and securely configure your API keys or access credentials, typically via environment variables or direct config properties.","message":"When using remote device providers like BrowserStack or LambdaTest, you must configure authentication credentials (e.g., API keys, usernames) in your environment or Appwright configuration. Failure to do so will result in authentication errors when attempting to connect to the device farm.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Verify the `buildPath` points to the correct, existing application file. Ensure the file type (`.apk`, `.app`, `.ipa`) matches the `platform` (Android/iOS) and `device.provider` (emulator/local-device/cloud-provider) requirements.","message":"The `buildPath` in `appwright.config.ts` must point to the correct application binary for the specified platform and provider. For Android, this is an `.apk` file. For iOS, it's typically a `.app` file for emulators or an `.ipa` file for real devices. Incorrect paths or file types will prevent tests from running.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Regularly review release notes for new versions. Consider pinning to specific patch versions (e.g., `~0.1.45`) in your `package.json` and testing updates in a controlled environment before deploying to critical CI/CD pipelines.","message":"Appwright is in active pre-1.0.0 development. While patch releases primarily focus on bug fixes, minor versions may introduce API changes or new features that could require adjustments to existing test code or configuration. Early adoption means a higher likelihood of needing to adapt to updates.","severity":"gotcha","affected_versions":"<1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Create `appwright.config.ts` in your project's root directory and populate it with a valid Appwright configuration, as shown in the quickstart example.","cause":"The Appwright configuration file `appwright.config.ts` (or `.js`) is missing or incorrectly named in the project root.","error":"Error: Cannot find module 'appwright/appwright.config.ts'"},{"fix":"Ensure the project name passed via the `--project` flag exactly matches one of the `name` fields in your `appwright.config.ts`. Double-check for typos and casing.","cause":"The project name specified with `npx appwright test --project <name>` does not match any `name` property defined in the `projects` array within your `appwright.config.ts`.","error":"Error: Project 'android' not found in appwright.config.ts. Available projects: [...]"},{"fix":"Verify that the `buildPath` is correct and that the application binary file (e.g., `.apk`, `.app`, `.ipa`) actually exists at that location and is readable by the test runner.","cause":"The `buildPath` specified in your `appwright.config.ts` points to a non-existent or inaccessible application binary file.","error":"Error: Build file not found at path: /path/to/your/app-release.apk"},{"fix":"Ensure your test function properly destructures the `device` object from the fixture, e.g., `test('My test', async ({ device }) => { ... })`. Also, confirm that `appwright.config.ts` is correctly set up and Appwright is installed.","cause":"This typically occurs if the `device` fixture is not correctly destructured in the test function signature or if the Appwright setup is incomplete, preventing the device context from being correctly initialized.","error":"TypeError: device.getByText is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null}