-
Read the requested scenario and existing tests in e2e-test/e2e-playwright-tests.
-
Ensure the Ballerina VSIX exists locally. Check for a file matching ballerina-*.vsix in the workspace root (e.g., ballerina-5.11.0.vsix). If none is found, ask the user to run:
rush build -t ballerina
-
Create scenario.md under the authoring scenario directory before writing any step files:
e2e-test/e2e-authoring/scenarios/<scenario-name>/scenario.md
If the user only described the scenario in the prompt, derive the steps and write scenario.md now. If the user provided a scenario.md path, read it first.
-
Write small step files in steps/*.step.js. Keep each step focused and rerunnable.
For diagram flows, steps must build the flow through the product UI:
click the diagram plus button, open the node palette, search or select the node, fill the form, then save.
-
Run the steps through the named daemon:
bash e2e-test/e2e-authoring/scripts/run-steps.sh <scenario-name> e2e-test/e2e-authoring/scenarios/<scenario-name>/steps
-
If a selector is unstable or an element cannot be found by data-testid, add a stable data-testid attribute to that element in the relevant workspaces/ballerina/*/src UI package. Do not use dynamic/generated class names as selectors, including Emotion class names.
After adding any data-testid — even a single attribute in one file — always rebuild the VSIX and install it before rerunning steps:
rush build -t ballerina
Then install the newly built VSIX into the test VS Code instance (the harness daemon picks up the VSIX from the workspace root). If the VS Code instance is already running the old extension version, stop it, reinstall the VSIX, and restart before retrying.
If the installed version looks unchanged (VS Code loads the cached build because the version string is identical): bump the version in workspaces/ballerina/ballerina-extension/package.json by appending a timestamp suffix, e.g. "5.12.0" → "5.12.0-20260520". Then rebuild and reinstall:
rush build -t ballerina
This forces VS Code to treat it as a genuinely new extension version, bypassing any cached install. Once the selector is confirmed working you can revert the version string.
-
Once the step flow is proven, promote the same UI flow into a new spec file. Place the spec in the subdirectory that best matches the integration category, following the existing layout:
e2e-test/e2e-playwright-tests/<category>/<scenario-name>.spec.ts
Existing categories: api-integration, file-integration, other-artifacts, diagram, configuration, type-editor. Check the subdirectories and pick the closest match.
-
Register the promoted spec in e2e-test/e2e-playwright-tests/test.list.ts.
-
Verify with:
npm run e2e-test -- --grep "<test name>"
A passing run prints each logStep line to the terminal and exits 0. If the extension fails to launch, check the VS Code host stderr for VSIX load errors — this means a stale build; rebuild and rerun.