Write tests in real TypeScript
Maestro flows are YAML lists of commands. That's wonderfully readable for a straight-line path, but the moment you need data-driven loops, shared setup, or branching, you drop into embedded JavaScript snippets and the YAML starts fighting you.
Mobilewright is TypeScript top to bottom. Loops, conditionals, fixtures, helper functions and npm packages are just code — with types and autocomplete the whole way.
import { test, expect } from '@mobilewright/test';
test('add three items to cart', async ({ screen }) => {
for (const name of ['Coffee', 'Tea', 'Water']) {
await screen.getByRole('button', { name: `Add ${name}` }).tap();
}
await expect(screen.getByText('3 items')).toBeVisible();
});Loops, variables and types — no YAML, no embedded JS snippets.