Norrix
Build a NativeScript app with Norrix and run its e2e suite on a Norrix simulator or emulator.
Norrix builds NativeScript apps in the cloud.
norrix test runs an e2e suite against a simulator or emulator build on a
Norrix machine. Norrix installs the suite’s dependencies, installs the build
on a booted device, and runs e2e run for the targets on the build’s
platform. E2E tests need a Norrix Enterprise organization.
Norrix’s E2E Testing guide
takes a NativeScript app from no tests to a suite that runs locally, on
Norrix, and in CI. The norrix test reference
lists every flag.
Suite
Keep the suite in its own directory, usually e2e/, with its own
package.json and e2e.config.ts. Norrix installs it without your app’s
dependencies:
my-app/
├── app/
├── nativescript.config.ts
└── e2e/
├── package.json # e2e, @e2e-dev/mobile, ai, and your provider package if not the gateway
├── e2e.config.ts
└── tests/import type { E2EConfig } from 'e2e';
import { gateway } from 'ai';
import { mobile } from '@e2e-dev/mobile';
export default {
agents: { default: { model: gateway('openai/gpt-6-luna-fast') } },
targets: [
{ name: 'ios', engine: mobile({ platform: 'ios' }), app: { bundleId: 'org.example.myapp' } },
{ name: 'android', engine: mobile({ platform: 'android' }), app: { bundleId: 'org.example.myapp' } },
],
workers: 1,
} satisfies E2EConfig;- Norrix sets each target’s
app.appPathto its build. Leavedeviceout ofmobile()to use the simulator or emulator Norrix booted. - Give the elements your tests check a
testID, and find them withgetByTestId. See Test ids by framework. - Norrix keeps the replay cache between runs, per organization,
project, and platform, and writes to it although CI defaults to
read-only. A config with
cache: 'off'or a customstorekeeps its own.
Run on Norrix
From the app directory, build for a simulator:
norrix build ios debug --simulatornorrix build returns once the build starts. Wait until
norrix build-status <id> reports success, then run the suite:
norrix test ios --runner e2e --waitFor Android, build with norrix build android debug --emulator and run
norrix test android --runner e2e --wait. --wait exits non-zero when the
run fails, is cancelled, or times out.
The dashboard’s View Report shows the report and a video of each failed attempt. For a GitHub Actions workflow that waits for the build, see Run in CI in Norrix’s guide.
Model key
Store your provider’s key, such as AI_GATEWAY_API_KEY, as a Norrix
environment variable. Tests that never use agent need none:
norrix env set AI_GATEWAY_API_KEY "$AI_GATEWAY_API_KEY" --project my-appEvery suite that runs in a variable’s scope can read it, and without
--project that is every suite the organization runs. Run only code you
trust there. See Model credentials.
Norrix environment variables also fill the config’s
secrets and credentials, through E2E_SECRET_<NAME> and
E2E_USER_<NAME>_PASSWORD.
