该技能面向 Python BDD 测试,核心是用 Gherkin 编写 feature 文件,并在 steps 目录实现对应步骤定义。示例结构为 features/login.feature 配合 features/steps/login_steps.py,feature 中使用 Feature、Background、Scenario、Scenario Outline 与 Examples 组织场景,步骤通过 @given、@when、@then 装饰器绑定,并可结合 Selenium、WebDriverWait 做页面操作与断言。
环境钩子放在 features/environment.py,before_all 可设置 base_url,before_scenario 创建浏览器实例,after_scenario 在失败时保存截图并退出浏览器。支持使用标签筛选运行,如 behave --tags=@smoke 或 behave --tags="@smoke and not @slow"。
安装:pip install behave selenium;运行:behave 或 behave features/login.feature;可用 behave --format json -o report.json 生成报告。云端执行通过环境变量 LT_USERNAME、LT_ACCESS_KEY 配置,并使用 Remote WebDriver 连接 hub。
资料还提到 reference/playbook.md 包含项目配置、页面对象、测试数据、CI/CD、调试与最佳实践等更深层模式。未提供的收费、价格与平台细节暂未提供。