Viewing and Editing Code
Every recorded or AI-generated step produces real JavaScript code. The View the Code feature lets you inspect that code, edit it inline, and use AI to generate changes from plain English prompts: all without leaving the browser.
View the code for a step
- Navigate to the AI Tests page and open a scenario containing recorded steps.
- Select a specific step within the scenario.
- Click View the Code.
The online editor opens the .mjs file and scrolls directly to the relevant step definition. You can navigate between steps to view their code as well.
INFO
When a scenario has no steps, the View the Code button is disabled. Hover over it to see the tooltip: "No steps available to show code."
Edit code inline
After opening a step in the online editor, you can modify the code directly. Once your changes are ready, choose one of the following actions:
- Test Changes: run the updated step to verify the behavior
- Discard: revert to the original code
- Review Changes: view a side-by-side comparison of your edits
TIP
Click View in VSCode inside the online editor to open the same .mjs file in your local VS Code installation for deeper editing and debugging.
Handle steps without generated code
A step may not have code yet: for example, when you add it manually in Gherkin format without recording or AI generation. In this case the editor offers three options:
- Write Custom Code: the editor scaffolds the step syntax stub so you can add your own JavaScript logic, or use the AI prompt feature to generate it.
- Generate code using AI: describe the expected behavior in plain English and let BlinqIO generate the automation code.
- Record the Step: launch the recorder to capture the action and produce code automatically.
AI step code generation
You can modify any step's code by describing the change in plain English. BlinqIO uses AI to interpret your prompt, identify the relevant section of code, and generate an updated version.
How it works
- Open a step and click View the Code.
- In the right-side panel, enter a plain English description of the change you want.
- Click Apply Change.
- Review the side-by-side comparison of the original and modified code.
- Choose an action:
- Test Changes: run the code before saving
- Save Changes: apply the update
- Discard: keep the original code
Example prompts
- "This step should pass even if commands fail."
- "Reduce the timeout of the command to 10 seconds."
- "Retry this step twice before failing it."
- "Only perform the command if the login button is enabled."
You can also choose from a list of predefined prompts covering common modifications.
