Skip to main content

Add a custom Playwright configuration

Runs execute under a named configuration — Default unless told otherwise. Here's how to add a Mobile one.

  1. Read the default as your reference​

    testvibe files get Configurations/Default.config.js

    Keep the current template’s structure: it is an ESM export default defineConfig({...}) file whose object must be pure JSON. The runtime parses that object; JavaScript expressions and comments inside it are not supported.

  2. Write the new configuration​

    Save the full template response to mobile.config.js, then change Name to Mobile and update these fields inside its JSON object. Keep the remaining template fields, including reporters, test paths, and runtime safeguards:

    {
    "Name": "Mobile",
    "use": {
    "browserName": "chromium",
    "viewport": { "width": 390, "height": 844 }
    }
    }

    This fragment shows the fields to edit; it is not the complete configuration file. It changes the viewport size; the current runner does not map isMobile or hasTouch from these files. Do not set baseURL: TestVibe supplies the target at run time.

    testvibe files put Configurations/Mobile.config.js --file ./mobile.config.js

    The file name is the config name: Configurations/Mobile.config.js → Mobile. (Writes outside Features/ or Configurations/ are rejected — see the allowlist.)

  3. Verify and run​

    testvibe configs
    testvibe run "Login Functionality" --config Mobile --wait

    Over REST that's POST …/features/12/run with {"config": "Mobile"} — see run_feature.

info

Configurations apply per run — the same generated tests execute under any config, so one feature can be green on desktop and red on mobile. That's the point.