
An AI-assisted VS Code workspace for Appium and BDD test automation. Prepare an
MCP environment, send Gherkin scenarios to GitHub Copilot, and replay generated
Behave tests. Review generated code and assertions before relying on test results.
This is an independently maintained fork of
BDD AI Toolkit / AutoGenesis,
not an official Microsoft extension. Its extension ID is
bingbingniu.bdd-appium-toolkit.
The setup panel uses a purple mobile-automation identity, theme-aware surfaces,
and separate environment-check and MCP-preparation cards. The sidebar icon is a
phone with a play symbol and AI sparkle. Existing setup actions are retained.
Find existing Gherkin steps
Open a saved English .feature file inside its project's features directory.
Run BDD Appium Toolkit: Find Existing Gherkin Steps from the Command Palette
or the Feature editor's context menu. Enter space-separated keywords; every
keyword must appear in the sentence, ignoring case.
Results show original saved Gherkin sentences with their Feature, Case and source
location. Select a result to view its original Case or copy the sentence.
Duplicate occurrences remain visible. Review the context and any Scenario
Outline placeholders before using a copied sentence.
This is a source-reference search, not a synonym search or Python implementation
check. It does not import project Python, edit a Case, start a device, or change
recording and replay behavior. Unsaved edits are not indexed.
Reuse existing Steps during recording
Send to Copilot now checks the selected Scenario (including its Background)
or Background with the test project's actual Behave registry before recording.
Review the plan and implementation locations before choosing Start recording:
REUSE: a Python implementation already matches; operate the Step without
generating another definition.
GENERATE: the Step has no matching implementation; generate its definition.
CONFLICT or UNSUPPORTED: resolve the reported problem before recording.
- If all Steps exist, choose Replay instead of recording again.
The check requires a trusted workspace and the project's .venv Python with
Behave and the project's dependencies installed. Save related source and
configuration files first. The confirmation warns before importing the project's
Step modules and environment.py: hooks and scenarios are not run, but
module-level initialization can still access devices or the network.
The confirmed plan is attached to standard prompts, custom prompts and skill
requests. AI still operates every Step in order, including existing Steps;
existing Python is not executed inside the recording session. This is serial
recording, not parallel generation.
Update the paired Appium MCP
Install the matching extension, stop the existing Appium MCP, run Appium
Setup to update its separately stored files, and restart the MCP. Installing
the extension alone does not replace an already deployed MCP.
Plan-based recording requires before_gen_code(plan_file=...) and recording
identity parameters on operation tools. Older MCP schemas must be updated, not
bypassed. The MCP independently verifies the plan, source snapshot, fixed Step
IDs and operation order. Only successful operations for GENERATE Steps enter
the generation cache. Unplanned recording remains supported when no plan is
active; an active or failed plan cannot silently downgrade to that mode.
Preview and save
Preview builds a complete candidate from the unchanged target and authorized
new definitions. The project's Python and the paired Behave checker validate
syntax, imports, registration and unique Step matching in an isolated candidate
copy. Review the proposed code before confirming.
Confirm saves only that validated candidate after rechecking the plan, source
and target. It uses a target lock and same-directory atomic replacement,
preserving existing bytes and permissions. Further recording operations
invalidate the previous Preview; repeated confirmation does not append twice.
Do not manually edit project Python, the selected Feature or checked
configuration during recording, Preview or confirmation; changes require a new
plan. Other editors do not honor the target lock.
Source snapshots preserve confirmed path spelling, including Windows drive
letter spelling, while resolved paths continue to enforce project ownership.
Expired device sessions are reported as failures rather than cached as
successful generated operations.
Replay a specific Case
Run launches a new terminal for every invocation using
uv run python -m behave <feature>:<line> from the test project root.
Duplicate Scenario names cannot select another Case. An Outline selects every
Examples data row belonging to that Outline, not other Outlines with the same
name. Trust, a saved Feature and a current Scenario header are required.
Each terminal gets a separate SCREENSHOT_DIR under the OS temporary directory.
Retain or remove these result directories as needed; the extension does not
delete replay screenshots automatically.
Replay still executes the test project's Behave hooks. Separate terminals do
not make a shared SSE service device-isolated: the project's hook/MCP setup must
create an independent device session for each run. This change does not replace
project hooks or add a device allocator.
Parallel Case generation
Open BDD Appium Toolkit: Parallel Case Generation from the Command Palette,
or use Add to Parallel Generation above a saved Scenario. The task panel
uses isolated Copilot SDK sessions and stdio Appium MCP processes; it does not
reuse VS Code Chat's shared MCP connection.
Prepare once
- Install the matching extension, stop the old Appium MCP, run Appium Setup
and restart MCP. The panel refuses outdated installed recording/guard files.
- Install an external Node.js runtime compatible with
^20.19.0 || >=22.12.0.
Configure bddAppiumToolkit.parallel.nodeExecutable if node is not on PATH.
- Prepare the test project's
.venv and dependencies, as required by the
serial Behave plan checker. Save related source/configuration before starting.
- Prepare an approved Android or iOS Appium JSON configuration and sufficient
BrowserStack concurrency. Model requests and cloud devices may incur costs.
New defaults use HTTPS for BrowserStack. Existing project configurations are
preserved: change any BrowserStack
server_url starting with http:// to
https:// before parallel recording. Local Appium HTTP endpoints are unchanged.
- Select GitHub CLI authentication (authenticate
gh in the extension host
environment) or credentials already available in that environment. VS Code
Chat login does not guarantee SDK authentication.
Generate and save
- Click + Add Cases, select saved Features/Cases and review their actual
Behave plans. A Case header action supplies its selected Case directly.
- The checked plan's Start recording authorizes real model/device execution.
For Cases from one project, the panel reads
--config and --platform from
that project's .vscode/mcp.json entry named
bdd-appium-toolkit-<project-folder-name>-appium. When both are specified,
the configuration and platform pickers are skipped. Missing settings still
use the corresponding picker; a single available platform is automatic.
Explicit invalid settings fail rather than silently selecting something else.
Relative configuration paths resolve against the entry's cwd, or the project
root when omitted; ${workspaceFolder} is supported. Old/other-project and
SSE/HTTP entries are not used. Multi-project additions keep manual selection.
Only settings are reused, never the existing MCP connection or process.
Never enter credentials in AI answers. Optionally click Load models and
select a model for new Cases; changing it does not switch existing tasks.
- Switch between tasks to inspect the execution timeline and answer the selected
task's pending question. Open the full redacted log or task screenshots when
needed. You can append more Cases without restarting running tasks.
- Cancel a task independently if needed. Other tasks keep their own sessions.
- After generation and cleanup have ended for the relevant target file, select
a Case. View Case draft optionally opens the complete read-only native Diff.
Save all Steps revalidates current source and saves every newly generated
Step in that Case with one explicit confirmation; opening the Diff first is
not required. Discard Case draft leaves existing source and other Cases
unchanged. Recording does not save automatically, and a successful save does
not replace Replay validation.
Generation exports a complete validated draft outside the test project.
It does not directly write source; only the host's confirmed save can do so.
An all-existing Case is not re-recorded. Existing Python Steps are not executed
inside recording sessions.
Current boundaries
- Duplicate Cases and overlapping missing Steps are rejected before starting
the conflicting task; no automatic queue or retry. Distinct missing Steps can
generate concurrently for the same output file; confirmed saves merge serially.
- Save/review waits for generation and cleanup of the same target to finish;
other targets do not have to finish. Only confirmed writes from this round
participate in merging; external source edits still invalidate the draft.
- Local Appium configurations do not allocate multiple local devices. Do not
interpret independent processes as an automatic device pool.
- Device capacity checks are observations, not organization-wide reservations.
- Do not manually edit checked project Python, the selected Feature or checked
configuration while recording or reviewing drafts.
- Closing the panel stops its tasks and discards unsaved drafts. Confirmed
source writes are retained. Cleanup and already-confirmed writes are awaited,
not declared successful after a fixed timeout.
- Reopening starts an empty round without loading or cleaning historical batches.
After a crash/reload, inspect and release leftover cloud sessions manually;
this version does not promise abnormal-exit recovery.
- Hiding ended records changes display only, not task/resource ownership.
Cleanup failure warnings remain visible, and cleanup retry addresses only the
selected task's verified resources.
- Replay uses independent terminals and project hooks, not recording sessions
owned by this panel.
Build and validate
Parallel generation bundles native SDK dependencies. Build a VSIX on the target
OS/architecture; a Linux build is not a Windows package:
cd bdd_ai_toolkit
npm ci --include=dev --include=optional
npm test
npm run package-vsix -- --out ../bdd-appium-toolkit-trial.vsix
Use the corresponding npm.cmd commands in Windows PowerShell when required.
See the runtime and offline validation guide
for SDK/MCP tests. Local simulated-device results do not replace real cloud
business Case generation and Replay acceptance.
Appium dependency downloads
Appium Setup uses https://packagefeedproxy.microsoft.io/pypi/simple/ by default.
The same index is included in the generated MCP startup environment so that
uv run does not return to PyPI for dependency synchronization. Windows browser
MCP does not receive this default.
This feed resolved dependency downloads and allowed an MCP initialization
handshake with 35 tools on one Windows machine. This is not a service availability
guarantee or confirmation of service-owner/IT approval. Validate another tester
environment and the organization's usage requirements before broad distribution.
This is an online solution, not an offline dependency bundle.
The configured feed is not guaranteed to be accessible or approved for every
organization. Confirm that the feed is permitted for your environment, or select
an approved HTTPS package index before running Appium Setup.
- Set
bddAppiumToolkit.appium.indexUrl in VS Code User Settings to change the
default. An empty value leaves index selection to uv (including uv.toml).
- Existing nonempty
UV_DEFAULT_INDEX, UV_INDEX_URL, UV_INDEX, or
UV_EXTRA_INDEX_URL environment variables take precedence over the extension
setting. They are inherited, not copied into the workspace MCP file. Restart
VS Code after changing its inherited environment.
- A nonempty extension setting overrides uv configuration-file defaults. The
setting accepts an HTTPS URL without embedded credentials or query parameters;
use uv authentication for authenticated feeds.
- After changing the setting, stop the server and run Appium Setup again to
update its startup configuration. Review any configuration-reset prompt first.
- Failed dependency installation, process errors, and the 10-minute timeout stop
setup rather than producing a new success marker. Error output is bounded and
URL paths, credentials, and query parameters are redacted.
Python (the server declares >=3.10), uv, and the required device/Appium
environment remain prerequisites. This change does not require Python 3.12 or
install Android SDK/Appium drivers for you.
Updating from 0.1.0
Version 0.1.1 replaces the deprecated tool.uv.dev-dependencies field in bundled
MCP projects with dependency-groups.dev, without changing runtime dependencies.
It also introduces the purple phone/play/sparkle icon and theme-aware setup
workspace. See release notes.
Install the updated VSIX, stop the MCP server, and run Setup again for each
configured platform to refresh the separately stored server files. Review any
configuration-reset prompt before continuing, then start the server again.
Installing the VSIX alone does not replace an existing MCP environment.
Moving from the original extension
Disable the original extension and stop its MCP servers before using this fork.
The new extension has separate storage, commands, settings, and MCP names
(bdd-appium-toolkit-<project>-appium). It does not delete old MCP entries or
overwrite old extension storage. Review prompts/skills that refer to an old MCP
name and copy any customized Copilot prompt to
bddAppiumToolkit.cucumber.copilotPrompt if needed. Existing test files and
bdd_ai_conf.json are retained.
For a supplied VSIX, use Extensions > ... > Install from VSIX.
Marketplace publication is not required for internal testing. On a later
extension update, the setup panel prompts for MCP environment updates; these
are not silently applied to custom workspace configurations. Setup prepares the
environment; start the actual MCP server from the generated configuration and
verify the connection separately.
✨ Features
- 🎥 AI-Powered Recording - Write Gherkin scenarios, let AI generate automation code
- ▶️ One-Click Replay - Execute recorded scenarios directly from feature files
- 🔧 Multi-Platform Support - Windows (browser), Appium (macOS & Mobile)
- 🤖 MCP Integration - Seamless GitHub Copilot connection via Model Context Protocol
- 🎯 Interactive CodeLens - Record and replay buttons above each scenario
- 📝 Natural Language Tasks - Execute automation from plain English descriptions
👨💻 For Developers: See CONTRIBUTING.md for development setup and contribution guidelines.
🚀 Setup Guide
Step 1: Install Extension
Install BDD Appium Toolkit from its Marketplace listing when available, or use
Extensions > ... > Install from VSIX with the supplied package.
Step 2: Setup Environment
Open Setup Panel
Click the BDD Appium Toolkit icon in the Activity Bar (left sidebar)
Auto-Resolve Environment
The setup panel checks Python (>=3.10), Node.js/npm, uv, and VS Code CLI.
Use the resolve button for supported installation actions. On Windows,
Python and Node.js/npm require manual installation if missing; automatic
resolution handles uv and VS Code CLI. Device connectivity, Appium and its
platform drivers must be prepared separately.
Choose Platform & Click Setup
Select your target platform:
- Windows - Browser automation
- Appium - For macOS and mobile testing (iOS/Android)
Click "Windows Browser" or "Appium / Mobile" to prepare the selected
MCP environment. Review installation prompts and wait for completion.
macOS users: Before using Appium, you need to manually start the Appium server first. Run the provided script:
cd appium-mcp-server/docs
./start_appium_on_mac.sh
For detailed setup instructions, see macOS Appium Setup Guide.
Configure Automation Platform
Open bdd_ai_conf.json in the project root and update the configuration for your target platform, such as:
- Account credentials (e.g. BrowserStack
userName, accessKey)
- App
bundleId or appPackage/appActivity
- Device name, platform version, etc.
Open MCP Configuration File
Click "Open connection settings" to view/edit the MCP configuration file
The config file will be opened in the editor
Start MCP Server
In the opened configuration file, click the "Start" button (CodeLens action)
This launches the MCP server
Verify Connection in GitHub Copilot
- Open GitHub Copilot Chat
- Check MCP connections panel
- Confirm the new
bdd-appium-toolkit-<project>-appium MCP is connected
Step 3: Record & Replay
Now you're ready to use AI-powered test automation!
Recording (AI generates code):
- Create/open a
.feature file
- Write your scenario in Gherkin
- Click "Send to Copilot" above the scenario
- AI generates automation code automatically
If .github/skills/autoGenesis-run/SKILL.md exists in the workspace, the extension sends /autoGenesis-run <Scenario Name> to Copilot instead of the default prompt.
Replaying (Execute tests):
- Prepare the test project's Python environment using its dependency manifest.
Appium Setup prepares the MCP server's separate environment, not the project's
replay environment.
- Open a
.feature file with generated step implementations.
- Click "Run" above a scenario. The extension runs
uv run python -m behave --name ... in the test project context.
- Review terminal output and assertions to determine the test result.
The Appium download-source setting applies to MCP setup and generated startup
configuration. It does not configure ordinary terminals, pip, or the replay
project. If your approved index is the same as the extension default, a
PowerShell session can explicitly select it before installing project dependencies:
$env:UV_INDEX_URL = "https://packagefeedproxy.microsoft.io/pypi/simple/"
uv pip install --python .\.venv\Scripts\python.exe -r .\requirements.txt
uv run python -m behave --version
This example assumes the project already has a .venv and requirements.txt.
Use the project's own setup instructions if it uses a different dependency
manifest. Do not disable TLS verification to work around connection failures.
🎯 Advanced Features
Natural Language Tasks
Execute ad-hoc automation without writing scenarios:
Command: BDD Appium Toolkit: Execute Natural Language Task
Example:
"Open Chrome, go to google.com, search for 'AI testing', click first result"
AI converts your description to automation and executes immediately.
Custom Copilot Prompt
Customize how AI generates code:
{
"bddAppiumToolkit.cucumber.copilotPrompt": "Generate step definitions for:\n\n${scenario_text}\n\nFile: ${feature_file_path}\n\nUse Behave framework and follow PEP 8 style."
}
Available placeholders:
${scenario_text} - Full scenario content
${feature_file_path} - Path to feature file
Note: This prompt is used as fallback when the autoGenesis-run skill is not present in the workspace.
📚 Resources
📄 License
MIT License - See LICENSE
Happy Testing! 🎉