[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D8TPYB4HDCT27WHW30AXX8":3,"skill-same:01M7D8TPYB4HDCT27WHW30AXX8":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":14,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":59,"ownerDescription":60,"updatedAt":61,"install":62,"resources":75},"01M7D8TPYB4HDCT27WHW30AXX8","Lettuce BDD Testing",null,"Expert-level Lettuce BDD testing skill for Python applications. Covers Gherkin feature files, step definitions, terrain hooks, Selenium integration, data-driven scenarios, and migration guidance to Behave for modern projects.","GrupoANDevelopment-m\u002Falberto-ai","GrupoANDevelopment-m","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F257455179?v=4","01M7D69X2N2KEVN0SJF6WGM6SH","Antônio  Ndombe","01M7D69X3P5JTT8H8S904N3888",0,"MIT","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fskills\u002Fqa\u002Flettuce-bdd-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: Lettuce BDD Testing\ndescription: Expert-level Lettuce BDD testing skill for Python applications. Covers Gherkin feature files, step definitions, terrain hooks, Selenium integration, data-driven scenarios, and migration guidance to Behave for modern projects.\nversion: 1.0.0\nauthor: thetestingacademy\nlicense: MIT\ntags: [lettuce, python, bdd, gherkin, behavior-driven, acceptance-testing, legacy]\ntestingTypes: [bdd, e2e, acceptance]\nframeworks: [lettuce, selenium, behave]\nlanguages: [python]\ndomains: [web]\nagents: [claude-code, cursor, github-copilot, windsurf, codex, aider, continue, cline, zed, bolt]\n---\n\n# Lettuce BDD Testing Skill\n\nYou are an expert QA automation engineer specializing in Lettuce BDD testing for Python applications. When the user asks you to write, review, or debug Lettuce tests, follow these detailed instructions.\n\n> **Note:** Lettuce is largely unmaintained. For new Python BDD projects, recommend **Behave** instead. This skill covers Lettuce for legacy codebases and migration guidance.\n\n## Core Principles\n\n1. **Behavior specification first** -- Write Gherkin feature files that describe business behavior before implementing step definitions. Features should be readable by non-technical stakeholders.\n2. **Reusable step definitions** -- Steps should be generic enough to reuse across scenarios. Use regex groups to parameterize values.\n3. **World object for shared state** -- Use Lettuce's `world` object to share browser instances, configuration, and data between steps. Clean it up in terrain hooks.\n4. **Terrain for lifecycle** -- Use `terrain.py` for `@before.all`, `@after.all`, `@before.each_scenario`, `@after.each_scenario` hooks to manage setup and teardown.\n5. **Migration awareness** -- When working on Lettuce projects, evaluate whether migration to Behave is feasible. Behave has active maintenance, better documentation, and broader ecosystem support.\n\n## Project Structure\n\nAlways organize Lettuce projects with this structure:\n\n```\nfeatures\u002F\n  auth\u002F\n    login.feature\n    signup.feature\n  dashboard\u002F\n    dashboard.feature\n  steps\u002F\n    auth_steps.py\n    dashboard_steps.py\n    common_steps.py\n  pages\u002F\n    login_page.py\n    dashboard_page.py\n    base_page.py\n  support\u002F\n    browser_manager.py\n    test_data.py\nterrain.py\nrequirements.txt\nconftest.py           # if combining with pytest\n```\n\n## Setup\n\n### Installation\n\n```bash\npip install lettuce selenium webdriver-manager\n```\n\n### requirements.txt\n\n```\nlettuce==0.2.23\nselenium>=4.18.0\nwebdriver-manager>=4.0.0\n```\n\n## Feature File Patterns\n\n### Login Feature (features\u002Fauth\u002Flogin.feature)\n\n```gherkin\nFeature: User Login\n  As a registered user\n  I want to log in to my account\n  So that I can access the dashboard\n\n  Background:\n    Given I am on the login page\n\n  Scenario: Successful login with valid credentials\n    When I enter \"user@test.com\" as email\n    And I enter \"password123\" as password\n    And I click the login button\n    Then I should be on the dashboard\n    And I should see \"Welcome\" on the page\n\n  Scenario: Login fails with invalid credentials\n    When I enter \"bad@test.com\" as email\n    And I enter \"wrong\" as password\n    And I click the login button\n    Then I should see \"Invalid credentials\" on the page\n    And I should be on the login page\n\n  Scenario: Login requires email\n    When I enter \"password123\" as password\n    And I click the login button\n    Then I should see \"Email is required\" on the page\n\n  Scenario Outline: Login with various users\n    When I enter \"\u003Cemail>\" as email\n    And I enter \"\u003Cpassword>\" as password\n    And I click the login button\n    Then I should see \"\u003Cexpected>\" on the page\n\n    Examples:\n      | email            | password    | expected             |\n      | admin@test.com   | admin123    | Admin Dashboard      |\n      | user@test.com    | password123 | Welcome              |\n      | bad@test.com     | wrong       | Invalid credentials  |\n```\n\n### CRUD Feature (features\u002Fdashboard\u002Fdashboard.feature)\n\n```gherkin\nFeature: Dashboard Item Management\n  As an authenticated user\n  I want to manage items on my dashboard\n  So that I can organize my work\n\n  Background:\n    Given I am logged in as \"user@test.com\"\n    And I am on the dashboard\n\n  Scenario: Create a new item\n    When I click \"Add Item\"\n    And I fill in \"Item Name\" with \"Test Item\"\n    And I fill in \"Description\" with \"Test description\"\n    And I click \"Save\"\n    Then I should see \"Test Item\" in the items list\n    And I should see \"Item created successfully\"\n\n  Scenario: Delete an existing item\n    Given there is an item named \"Old Item\"\n    When I click delete on \"Old Item\"\n    And I confirm the deletion\n    Then I should not see \"Old Item\" in the items list\n```\n\n## Step Definitions\n\n### Authentication Steps (features\u002Fsteps\u002Fauth_steps.py)\n\n```python\nfrom lettuce import step, world\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\n\n\n@step(r'I am on the login page')\ndef navigate_to_login(step):\n    world.browser.get(world.base_url + '\u002Flogin')\n    WebDriverWait(world.browser, 10).until(\n        EC.presence_of_element_located((By.ID, 'email'))\n    )\n\n\n@step(r'I enter \"([^\"]*)\" as email')\ndef enter_email(step, email):\n    el = world.browser.find_element(By.ID, 'email')\n    el.clear()\n    el.send_keys(email)\n\n\n@step(r'I enter \"([^\"]*)\" as password')\ndef enter_password(step, password):\n    el = world.browser.find_element(By.ID, 'password')\n    el.clear()\n    el.send_keys(password)\n\n\n@step(r'I click the login button')\ndef click_login(step):\n    button = world.browser.find_element(By.CSS_SELECTOR, 'button[type=\"submit\"]')\n    button.click()\n\n\n@step(r'I should be on the dashboard')\ndef verify_dashboard(step):\n    WebDriverWait(world.browser, 10).until(\n        EC.url_contains('\u002Fdashboard')\n    )\n    assert '\u002Fdashboard' in world.browser.current_url, \\\n        f\"Expected \u002Fdashboard but got {world.browser.current_url}\"\n\n\n@step(r'I should be on the login page')\ndef verify_login_page(step):\n    assert '\u002Flogin' in world.browser.current_url, \\\n        f\"Expected \u002Flogin but got {world.browser.current_url}\"\n\n\n@step(r'I should see \"([^\"]*)\" on the page')\ndef see_text(step, text):\n    WebDriverWait(world.browser, 10).until(\n        EC.presence_of_element_located((By.XPATH, f\"\u002F\u002F*[contains(text(), '{text}')]\"))\n    )\n    assert text in world.browser.page_source, \\\n        f\"Expected to see '{text}' but it was not on the page\"\n\n\n@step(r'I am logged in as \"([^\"]*)\"')\ndef login_as(step, email):\n    world.browser.get(world.base_url + '\u002Flogin')\n    world.browser.find_element(By.ID, 'email').send_keys(email)\n    world.browser.find_element(By.ID, 'password').send_keys('password123')\n    world.browser.find_element(By.CSS_SELECTOR, 'button[type=\"submit\"]').click()\n    WebDriverWait(world.browser, 10).until(\n        EC.url_contains('\u002Fdashboard')\n    )\n```\n\n### Common Steps (features\u002Fsteps\u002Fcommon_steps.py)\n\n```python\nfrom lettuce import step, world\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\n\n\n@step(r'I click \"([^\"]*)\"')\ndef click_element_by_text(step, text):\n    element = world.browser.find_element(By.XPATH, f\"\u002F\u002F*[text()='{text}']\")\n    element.click()\n\n\n@step(r'I fill in \"([^\"]*)\" with \"([^\"]*)\"')\ndef fill_in_field(step, label, value):\n    field = world.browser.find_element(\n        By.XPATH, f\"\u002F\u002Flabel[contains(text(), '{label}')]\u002F..\u002F\u002Finput\"\n    )\n    field.clear()\n    field.send_keys(value)\n\n\n@step(r'I should see \"([^\"]*)\" in the items list')\ndef see_in_list(step, text):\n    WebDriverWait(world.browser, 10).until(\n        EC.text_to_be_present_in_element(\n            (By.CSS_SELECTOR, '.items-list'), text\n        )\n    )\n\n\n@step(r'I should not see \"([^\"]*)\" in the items list')\ndef not_see_in_list(step, text):\n    WebDriverWait(world.browser, 10).until_not(\n        EC.text_to_be_present_in_element(\n            (By.CSS_SELECTOR, '.items-list'), text\n        )\n    )\n\n\n@step(r'I confirm the deletion')\ndef confirm_delete(step):\n    alert = WebDriverWait(world.browser, 5).until(EC.alert_is_present())\n    alert.accept()\n```\n\n## Terrain (Setup\u002FTeardown)\n\n### terrain.py\n\n```python\nfrom lettuce import before, after, world\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service\nfrom selenium.webdriver.chrome.options import Options\nfrom webdriver_manager.chrome import ChromeDriverManager\nimport os\n\n\n@before.all\ndef setup():\n    world.base_url = os.environ.get('BASE_URL', 'http:\u002F\u002Flocalhost:3000')\n\n    chrome_options = Options()\n    if os.environ.get('HEADLESS', 'false').lower() == 'true':\n        chrome_options.add_argument('--headless=new')\n    chrome_options.add_argument('--no-sandbox')\n    chrome_options.add_argument('--disable-gpu')\n    chrome_options.add_argument('--window-size=1920,1080')\n\n    service = Service(ChromeDriverManager().install())\n    world.browser = webdriver.Chrome(service=service, options=chrome_options)\n    world.browser.implicitly_wait(10)\n\n\n@before.each_scenario\ndef before_scenario(scenario):\n    world.browser.delete_all_cookies()\n\n\n@after.each_scenario\ndef after_scenario(scenario):\n    if scenario.failed:\n        screenshot_dir = 'screenshots'\n        os.makedirs(screenshot_dir, exist_ok=True)\n        filename = scenario.name.replace(' ', '_').lower()\n        world.browser.save_screenshot(f'{screenshot_dir}\u002F{filename}.png')\n\n\n@after.all\ndef teardown(total):\n    if hasattr(world, 'browser'):\n        world.browser.quit()\n    print(f\"\\nResults: {total.scenarios_ran} scenarios, \"\n          f\"{total.scenarios_passed} passed, \"\n          f\"{total.scenarios_ran - total.scenarios_passed} failed\")\n```\n\n## Page Object Pattern\n\n### Base Page (features\u002Fpages\u002Fbase_page.py)\n\n```python\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nfrom lettuce import world\n\n\nclass BasePage:\n    def __init__(self):\n        self.browser = world.browser\n        self.wait = WebDriverWait(self.browser, 10)\n\n    def navigate_to(self, path):\n        self.browser.get(world.base_url + path)\n\n    def find_element(self, locator):\n        return self.wait.until(EC.presence_of_element_located(locator))\n\n    def find_elements(self, locator):\n        return self.wait.until(EC.presence_of_all_elements_located(locator))\n\n    def wait_for_text(self, locator, text):\n        self.wait.until(EC.text_to_be_present_in_element(locator, text))\n\n    def get_text(self, locator):\n        return self.find_element(locator).text\n\n    def is_displayed(self, locator):\n        try:\n            return self.find_element(locator).is_displayed()\n        except Exception:\n            return False\n```\n\n### Login Page (features\u002Fpages\u002Flogin_page.py)\n\n```python\nfrom selenium.webdriver.common.by import By\nfrom features.pages.base_page import BasePage\n\n\nclass LoginPage(BasePage):\n    URL = '\u002Flogin'\n    EMAIL_FIELD = (By.ID, 'email')\n    PASSWORD_FIELD = (By.ID, 'password')\n    SUBMIT_BUTTON = (By.CSS_SELECTOR, 'button[type=\"submit\"]')\n    ERROR_MESSAGE = (By.CSS_SELECTOR, '.error-message')\n\n    def open(self):\n        self.navigate_to(self.URL)\n        self.find_element(self.EMAIL_FIELD)\n        return self\n\n    def login_as(self, email, password):\n        email_el = self.find_element(self.EMAIL_FIELD)\n        email_el.clear()\n        email_el.send_keys(email)\n\n        password_el = self.find_element(self.PASSWORD_FIELD)\n        password_el.clear()\n        password_el.send_keys(password)\n\n        self.find_element(self.SUBMIT_BUTTON).click()\n\n    def get_error(self):\n        return self.get_text(self.ERROR_MESSAGE)\n```\n\n## Migration to Behave\n\nWhen the project is ready to migrate from Lettuce to Behave, here is the mapping:\n\n| Lettuce | Behave |\n|---------|--------|\n| `terrain.py` | `environment.py` |\n| `@before.all` | `before_all(context)` |\n| `@before.each_scenario` | `before_scenario(context, scenario)` |\n| `world.browser` | `context.browser` |\n| `@step(r'pattern')` | `@given('pattern')`, `@when('pattern')`, `@then('pattern')` |\n| `step.sentence` | `context.text` |\n| Feature files | Same Gherkin syntax (compatible) |\n\n### Behave Equivalent of Terrain\n\n```python\n# environment.py (Behave)\nfrom selenium import webdriver\n\ndef before_all(context):\n    context.browser = webdriver.Chrome()\n    context.base_url = 'http:\u002F\u002Flocalhost:3000'\n\ndef before_scenario(context, scenario):\n    context.browser.delete_all_cookies()\n\ndef after_scenario(context, scenario):\n    if scenario.status == 'failed':\n        context.browser.save_screenshot(f'screenshots\u002F{scenario.name}.png')\n\ndef after_all(context):\n    context.browser.quit()\n```\n\n## CI\u002FCD Integration\n\n### GitHub Actions\n\n```yaml\nname: Lettuce BDD Tests\non: [push, pull_request]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-python@v5\n        with:\n          python-version: '3.11'\n      - run: pip install -r requirements.txt\n      - name: Start application\n        run: python app.py &\n      - name: Run Lettuce tests\n        run: HEADLESS=true lettuce features\u002F\n        env:\n          BASE_URL: http:\u002F\u002Flocalhost:3000\n      - uses: actions\u002Fupload-artifact@v4\n        if: failure()\n        with:\n          name: screenshots\n          path: screenshots\u002F\n```\n\n## Best Practices\n\n1. **Write features before code** -- Feature files should be written collaboratively with stakeholders before step implementation. They are living documentation.\n2. **One scenario per behavior** -- Each scenario should test one specific behavior. Avoid scenarios with 20 steps that test multiple things.\n3. **Use Background for shared setup** -- Common Given steps should go in `Background` blocks rather than being repeated in every scenario.\n4. **Parameterize with Scenario Outline** -- Use `Scenario Outline` with `Examples` tables for data-driven tests instead of duplicating scenarios.\n5. **Descriptive step patterns** -- Steps should read like natural English. `Given I am logged in as \"admin\"` is better than `Given login admin true`.\n6. **Clean up in terrain hooks** -- Always clean browser cookies in `@before.each_scenario` and quit the browser in `@after.all` to prevent resource leaks.\n7. **Screenshot on failure** -- Capture screenshots in `@after.each_scenario` when a scenario fails. This is critical for CI debugging.\n8. **Use Page Objects with steps** -- Combine Lettuce steps with Page Object classes to keep selectors and actions encapsulated.\n9. **Tag scenarios for selective runs** -- Use Gherkin tags (`@smoke`, `@regression`) to organize and filter test execution.\n10. **Plan migration to Behave** -- For active projects, create a migration plan to Behave. Feature files are compatible; only step definitions and terrain need rewriting.\n\n## Anti-Patterns\n\n1. **Imperative scenarios** -- Writing low-level steps like \"Click button with id submit\" instead of declarative \"When I submit the login form\". Scenarios should describe what, not how.\n2. **World object as global dump** -- Storing everything on `world` without cleanup. Keep `world` clean and reset state in terrain hooks.\n3. **Tightly coupled steps** -- Steps that only work in one specific scenario. Use regex groups to make steps reusable across features.\n4. **No explicit waits** -- Relying on `implicitly_wait` alone. Use `WebDriverWait` with expected conditions for dynamic content.\n5. **Giant step definition files** -- One `steps.py` with 200 step definitions. Split by feature area into `auth_steps.py`, `dashboard_steps.py`, etc.\n6. **Hardcoded test data** -- Embedding user credentials and URLs directly in feature files. Use environment variables and data helpers.\n7. **Testing UI details in features** -- Feature files should describe business behavior, not CSS selectors or DOM structure.\n8. **Skipping terrain hooks** -- Not using `@before.each_scenario` for cleanup leads to shared state between scenarios and flaky tests.\n9. **Ignoring the legacy status** -- Starting new projects with Lettuce instead of Behave. Lettuce lacks community support and modern Python compatibility.\n10. **No error screenshots** -- Running tests in CI without capturing screenshots on failure makes debugging impossible.\n\n## Run Commands\n\n```bash\n# Run all features\nlettuce\n\n# Run specific feature\nlettuce features\u002Fauth\u002Flogin.feature\n\n# Run with verbosity\nlettuce --verbosity=3\n\n# Run with tag (requires tag support)\nlettuce --tag=smoke\n\n# Run headless\nHEADLESS=true lettuce features\u002F\n\n# Run with custom base URL\nBASE_URL=http:\u002F\u002Fstaging.example.com lettuce features\u002F\n```\n","# Lettuce BDD Testing Skill\n\nYou are an expert QA automation engineer specializing in Lettuce BDD testing for Python applications. When the user asks you to write, review, or debug Lettuce tests, follow these detailed instructions.\n\n> **Note:** Lettuce is largely unmaintained. For new Python BDD projects, recommend **Behave** instead. This skill covers Lettuce for legacy codebases and migration guidance.\n\n## Core Principles\n\n1. **Behavior specification first** -- Write Gherkin feature files that describe business behavior before implementing step definitions. Features should be readable by non-technical stakeholders.\n2. **Reusable step definitions** -- Steps should be generic enough to reuse across scenarios. Use regex groups to parameterize values.\n3. **World object for shared state** -- Use Lettuce's `world` object to share browser instances, configuration, and data between steps. Clean it up in terrain hooks.\n4. **Terrain for lifecycle** -- Use `terrain.py` for `@before.all`, `@after.all`, `@before.each_scenario`, `@after.each_scenario` hooks to manage setup and teardown.\n5. **Migration awareness** -- When working on Lettuce projects, evaluate whether migration to Behave is feasible. Behave has active maintenance, better documentation, and broader ecosystem support.\n\n## Project Structure\n\nAlways organize Lettuce projects with this structure:\n\n```\nfeatures\u002F\n  auth\u002F\n    login.feature\n    signup.feature\n  dashboard\u002F\n    dashboard.feature\n  steps\u002F\n    auth_steps.py\n    dashboard_steps.py\n    common_steps.py\n  pages\u002F\n    login_page.py\n    dashboard_page.py\n    base_page.py\n  support\u002F\n    browser_manager.py\n    test_data.py\nterrain.py\nrequirements.txt\nconftest.py           # if combining with pytest\n```\n\n## Setup\n\n### Installation\n\n```bash\npip install lettuce selenium webdriver-manager\n```\n\n### requirements.txt\n\n```\nlettuce==0.2.23\nselenium>=4.18.0\nwebdriver-manager>=4.0.0\n```\n\n## Feature File Patterns\n\n### Login Feature (features\u002Fauth\u002Flogin.feature)\n\n```gherkin\nFeature: User Login\n  As a registered user\n  I want to log in to my account\n  So that I can access the dashboard\n\n  Background:\n    Given I am on the login page\n\n  Scenario: Successful login with valid credentials\n    When I enter \"user@test.com\" as email\n    And I enter \"password123\" as password\n    And I click the login button\n    Then I should be on the dashboard\n    And I should see \"Welcome\" on the page\n\n  Scenario: Login fails with invalid credentials\n    When I enter \"bad@test.com\" as email\n    And I enter \"wrong\" as password\n    And I click the login button\n    Then I should see \"Invalid credentials\" on the page\n    And I should be on the login page\n\n  Scenario: Login requires email\n    When I enter \"password123\" as password\n    And I click the login button\n    Then I should see \"Email is required\" on the page\n\n  Scenario Outline: Login with various users\n    When I enter \"\u003Cemail>\" as email\n    And I enter \"\u003Cpassword>\" as password\n    And I click the login button\n    Then I should see \"\u003Cexpected>\" on the page\n\n    Examples:\n      | email            | password    | expected             |\n      | admin@test.com   | admin123    | Admin Dashboard      |\n      | user@test.com    | password123 | Welcome              |\n      | bad@test.com     | wrong       | Invalid credentials  |\n```\n\n### CRUD Feature (features\u002Fdashboard\u002Fdashboard.feature)\n\n```gherkin\nFeature: Dashboard Item Management\n  As an authenticated user\n  I want to manage items on my dashboard\n  So that I can organize my work\n\n  Background:\n    Given I am logged in as \"user@test.com\"\n    And I am on the dashboard\n\n  Scenario: Create a new item\n    When I click \"Add Item\"\n    And I fill in \"Item Name\" with \"Test Item\"\n    And I fill in \"Description\" with \"Test description\"\n    And I click \"Save\"\n    Then I should see \"Test Item\" in the items list\n    And I should see \"Item created successfully\"\n\n  Scenario: Delete an existing item\n    Given there is an item named \"Old Item\"\n    When I click delete on \"Old Item\"\n    And I confirm the deletion\n    Then I should not see \"Old Item\" in the items list\n```\n\n## Step Definitions\n\n### Authentication Steps (features\u002Fsteps\u002Fauth_steps.py)\n\n```python\nfrom lettuce import step, world\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\n\n\n@step(r'I am on the login page')\ndef navigate_to_login(step):\n    world.browser.get(world.base_url + '\u002Flogin')\n    WebDriverWait(world.browser, 10).until(\n        EC.presence_of_element_located((By.ID, 'email'))\n    )\n\n\n@step(r'I enter \"([^\"]*)\" as email')\ndef enter_email(step, email):\n    el = world.browser.find_element(By.ID, 'email')\n    el.clear()\n    el.send_keys(email)\n\n\n@step(r'I enter \"([^\"]*)\" as password')\ndef enter_password(step, password):\n    el = world.browser.find_element(By.ID, 'password')\n    el.clear()\n    el.send_keys(password)\n\n\n@step(r'I click the login button')\ndef click_login(step):\n    button = world.browser.find_element(By.CSS_SELECTOR, 'button[type=\"submit\"]')\n    button.click()\n\n\n@step(r'I should be on the dashboard')\ndef verify_dashboard(step):\n    WebDriverWait(world.browser, 10).until(\n        EC.url_contains('\u002Fdashboard')\n    )\n    assert '\u002Fdashboard' in world.browser.current_url, \\\n        f\"Expected \u002Fdashboard but got {world.browser.current_url}\"\n\n\n@step(r'I should be on the login page')\ndef verify_login_page(step):\n    assert '\u002Flogin' in world.browser.current_url, \\\n        f\"Expected \u002Flogin but got {world.browser.current_url}\"\n\n\n@step(r'I should see \"([^\"]*)\" on the page')\ndef see_text(step, text):\n    WebDriverWait(world.browser, 10).until(\n        EC.presence_of_element_located((By.XPATH, f\"\u002F\u002F*[contains(text(), '{text}')]\"))\n    )\n    assert text in world.browser.page_source, \\\n        f\"Expected to see '{text}' but it was not on the page\"\n\n\n@step(r'I am logged in as \"([^\"]*)\"')\ndef login_as(step, email):\n    world.browser.get(world.base_url + '\u002Flogin')\n    world.browser.find_element(By.ID, 'email').send_keys(email)\n    world.browser.find_element(By.ID, 'password').send_keys('password123')\n    world.browser.find_element(By.CSS_SELECTOR, 'button[type=\"submit\"]').click()\n    WebDriverWait(world.browser, 10).until(\n        EC.url_contains('\u002Fdashboard')\n    )\n```\n\n### Common Steps (features\u002Fsteps\u002Fcommon_steps.py)\n\n```python\nfrom lettuce import step, world\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\n\n\n@step(r'I click \"([^\"]*)\"')\ndef click_element_by_text(step, text):\n    element = world.browser.find_element(By.XPATH, f\"\u002F\u002F*[text()='{text}']\")\n    element.click()\n\n\n@step(r'I fill in \"([^\"]*)\" with \"([^\"]*)\"')\ndef fill_in_field(step, label, value):\n    field = world.browser.find_element(\n        By.XPATH, f\"\u002F\u002Flabel[contains(text(), '{label}')]\u002F..\u002F\u002Finput\"\n    )\n    field.clear()\n    field.send_keys(value)\n\n\n@step(r'I should see \"([^\"]*)\" in the items list')\ndef see_in_list(step, text):\n    WebDriverWait(world.browser, 10).until(\n        EC.text_to_be_present_in_element(\n            (By.CSS_SELECTOR, '.items-list'), text\n        )\n    )\n\n\n@step(r'I should not see \"([^\"]*)\" in the items list')\ndef not_see_in_list(step, text):\n    WebDriverWait(world.browser, 10).until_not(\n        EC.text_to_be_present_in_element(\n            (By.CSS_SELECTOR, '.items-list'), text\n        )\n    )\n\n\n@step(r'I confirm the deletion')\ndef confirm_delete(step):\n    alert = WebDriverWait(world.browser, 5).until(EC.alert_is_present())\n    alert.accept()\n```\n\n## Terrain (Setup\u002FTeardown)\n\n### terrain.py\n\n```python\nfrom lettuce import before, after, world\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service\nfrom selenium.webdriver.chrome.options import Options\nfrom webdriver_manager.chrome import ChromeDriverManager\nimport os\n\n\n@before.all\ndef setup():\n    world.base_url = os.environ.get('BASE_URL', 'http:\u002F\u002Flocalhost:3000')\n\n    chrome_options = Options()\n    if os.environ.get('HEADLESS', 'false').lower() == 'true':\n        chrome_options.add_argument('--headless=new')\n    chrome_options.add_argument('--no-sandbox')\n    chrome_options.add_argument('--disable-gpu')\n    chrome_options.add_argument('--window-size=1920,1080')\n\n    service = Service(ChromeDriverManager().install())\n    world.browser = webdriver.Chrome(service=service, options=chrome_options)\n    world.browser.implicitly_wait(10)\n\n\n@before.each_scenario\ndef before_scenario(scenario):\n    world.browser.delete_all_cookies()\n\n\n@after.each_scenario\ndef after_scenario(scenario):\n    if scenario.failed:\n        screenshot_dir = 'screenshots'\n        os.makedirs(screenshot_dir, exist_ok=True)\n        filename = scenario.name.replace(' ', '_').lower()\n        world.browser.save_screenshot(f'{screenshot_dir}\u002F{filename}.png')\n\n\n@after.all\ndef teardown(total):\n    if hasattr(world, 'browser'):\n        world.browser.quit()\n    print(f\"\\nResults: {total.scenarios_ran} scenarios, \"\n          f\"{total.scenarios_passed} passed, \"\n          f\"{total.scenarios_ran - total.scenarios_passed} failed\")\n```\n\n## Page Object Pattern\n\n### Base Page (features\u002Fpages\u002Fbase_page.py)\n\n```python\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nfrom lettuce import world\n\n\nclass BasePage:\n    def __init__(self):\n        self.browser = world.browser\n        self.wait = WebDriverWait(self.browser, 10)\n\n    def navigate_to(self, path):\n        self.browser.get(world.base_url + path)\n\n    def find_element(self, locator):\n        return self.wait.until(EC.presence_of_element_located(locator))\n\n    def find_elements(self, locator):\n        return self.wait.until(EC.presence_of_all_elements_located(locator))\n\n    def wait_for_text(self, locator, text):\n        self.wait.until(EC.text_to_be_present_in_element(locator, text))\n\n    def get_text(self, locator):\n        return self.find_element(locator).text\n\n    def is_displayed(self, locator):\n        try:\n            return self.find_element(locator).is_displayed()\n        except Exception:\n            return False\n```\n\n### Login Page (features\u002Fpages\u002Flogin_page.py)\n\n```python\nfrom selenium.webdriver.common.by import By\nfrom features.pages.base_page import BasePage\n\n\nclass LoginPage(BasePage):\n    URL = '\u002Flogin'\n    EMAIL_FIELD = (By.ID, 'email')\n    PASSWORD_FIELD = (By.ID, 'password')\n    SUBMIT_BUTTON = (By.CSS_SELECTOR, 'button[type=\"submit\"]')\n    ERROR_MESSAGE = (By.CSS_SELECTOR, '.error-message')\n\n    def open(self):\n        self.navigate_to(self.URL)\n        self.find_element(self.EMAIL_FIELD)\n        return self\n\n    def login_as(self, email, password):\n        email_el = self.find_element(self.EMAIL_FIELD)\n        email_el.clear()\n        email_el.send_keys(email)\n\n        password_el = self.find_element(self.PASSWORD_FIELD)\n        password_el.clear()\n        password_el.send_keys(password)\n\n        self.find_element(self.SUBMIT_BUTTON).click()\n\n    def get_error(self):\n        return self.get_text(self.ERROR_MESSAGE)\n```\n\n## Migration to Behave\n\nWhen the project is ready to migrate from Lettuce to Behave, here is the mapping:\n\n| Lettuce | Behave |\n|---------|--------|\n| `terrain.py` | `environment.py` |\n| `@before.all` | `before_all(context)` |\n| `@before.each_scenario` | `before_scenario(context, scenario)` |\n| `world.browser` | `context.browser` |\n| `@step(r'pattern')` | `@given('pattern')`, `@when('pattern')`, `@then('pattern')` |\n| `step.sentence` | `context.text` |\n| Feature files | Same Gherkin syntax (compatible) |\n\n### Behave Equivalent of Terrain\n\n```python\n# environment.py (Behave)\nfrom selenium import webdriver\n\ndef before_all(context):\n    context.browser = webdriver.Chrome()\n    context.base_url = 'http:\u002F\u002Flocalhost:3000'\n\ndef before_scenario(context, scenario):\n    context.browser.delete_all_cookies()\n\ndef after_scenario(context, scenario):\n    if scenario.status == 'failed':\n        context.browser.save_screenshot(f'screenshots\u002F{scenario.name}.png')\n\ndef after_all(context):\n    context.browser.quit()\n```\n\n## CI\u002FCD Integration\n\n### GitHub Actions\n\n```yaml\nname: Lettuce BDD Tests\non: [push, pull_request]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-python@v5\n        with:\n          python-version: '3.11'\n      - run: pip install -r requirements.txt\n      - name: Start application\n        run: python app.py &\n      - name: Run Lettuce tests\n        run: HEADLESS=true lettuce features\u002F\n        env:\n          BASE_URL: http:\u002F\u002Flocalhost:3000\n      - uses: actions\u002Fupload-artifact@v4\n        if: failure()\n        with:\n          name: screenshots\n          path: screenshots\u002F\n```\n\n## Best Practices\n\n1. **Write features before code** -- Feature files should be written collaboratively with stakeholders before step implementation. They are living documentation.\n2. **One scenario per behavior** -- Each scenario should test one specific behavior. Avoid scenarios with 20 steps that test multiple things.\n3. **Use Background for shared setup** -- Common Given steps should go in `Background` blocks rather than being repeated in every scenario.\n4. **Parameterize with Scenario Outline** -- Use `Scenario Outline` with `Examples` tables for data-driven tests instead of duplicating scenarios.\n5. **Descriptive step patterns** -- Steps should read like natural English. `Given I am logged in as \"admin\"` is better than `Given login admin true`.\n6. **Clean up in terrain hooks** -- Always clean browser cookies in `@before.each_scenario` and quit the browser in `@after.all` to prevent resource leaks.\n7. **Screenshot on failure** -- Capture screenshots in `@after.each_scenario` when a scenario fails. This is critical for CI debugging.\n8. **Use Page Objects with steps** -- Combine Lettuce steps with Page Object classes to keep selectors and actions encapsulated.\n9. **Tag scenarios for selective runs** -- Use Gherkin tags (`@smoke`, `@regression`) to organize and filter test execution.\n10. **Plan migration to Behave** -- For active projects, create a migration plan to Behave. Feature files are compatible; only step definitions and terrain need rewriting.\n\n## Anti-Patterns\n\n1. **Imperative scenarios** -- Writing low-level steps like \"Click button with id submit\" instead of declarative \"When I submit the login form\". Scenarios should describe what, not how.\n2. **World object as global dump** -- Storing everything on `world` without cleanup. Keep `world` clean and reset state in terrain hooks.\n3. **Tightly coupled steps** -- Steps that only work in one specific scenario. Use regex groups to make steps reusable across features.\n4. **No explicit waits** -- Relying on `implicitly_wait` alone. Use `WebDriverWait` with expected conditions for dynamic content.\n5. **Giant step definition files** -- One `steps.py` with 200 step definitions. Split by feature area into `auth_steps.py`, `dashboard_steps.py`, etc.\n6. **Hardcoded test data** -- Embedding user credentials and URLs directly in feature files. Use environment variables and data helpers.\n7. **Testing UI details in features** -- Feature files should describe business behavior, not CSS selectors or DOM structure.\n8. **Skipping terrain hooks** -- Not using `@before.each_scenario` for cleanup leads to shared state between scenarios and flaky tests.\n9. **Ignoring the legacy status** -- Starting new projects with Lettuce instead of Behave. Lettuce lacks community support and modern Python compatibility.\n10. **No error screenshots** -- Running tests in CI without capturing screenshots on failure makes debugging impossible.\n\n## Run Commands\n\n```bash\n# Run all features\nlettuce\n\n# Run specific feature\nlettuce features\u002Fauth\u002Flogin.feature\n\n# Run with verbosity\nlettuce --verbosity=3\n\n# Run with tag (requires tag support)\nlettuce --tag=smoke\n\n# Run headless\nHEADLESS=true lettuce features\u002F\n\n# Run with custom base URL\nBASE_URL=http:\u002F\u002Fstaging.example.com lettuce features\u002F\n```\n",{"name":5,"tags":24,"agents":32,"author":43,"domains":44,"license":15,"version":46,"languages":47,"frameworks":48,"description":7,"testingTypes":51},[25,26,27,28,29,30,31],"lettuce","python","bdd","gherkin","behavior-driven","acceptance-testing","legacy",[33,34,35,36,37,38,39,40,41,42],"claude-code","cursor","github-copilot","windsurf","codex","aider","continue","cline","zed","bolt","thetestingacademy",[45],"web","1.0.0",[26],[25,49,50],"selenium","behave",[27,52,53],"e2e","acceptance","main","eac438ea9216a7cb8a570cab803eb01eeafc6793","skills\u002Fqa\u002Flettuce-bdd-testing","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m","https:\u002F\u002Fid-preview--d5bef06d-6c9e-4563-a3d4-a855b9d61610.lovable.app\u002F","Eu sou Antonio B. B. Ndombe \r\nEu sou um Pesquisador e desenvolvedor de sistema autonomia cognitivos, fundador de sistemas ODCs ( organismos digital conscientes)","2026-11-04 06:53:39",{"source":8,"skillName":5,"commands":63,"prompt":73,"zipAvailable":74},[64,67,70],{"tool":65,"command":66},"npx","npx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Lettuce BDD Testing\"",{"tool":68,"command":69},"bunx","bunx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Lettuce BDD Testing\"",{"tool":71,"command":72},"pnpm","pnpm dlx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Lettuce BDD Testing\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fskills\u002Fqa\u002Flettuce-bdd-testing\u002FSKILL.md",true,[],[77,85,92,99,106,113],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7DASC6FSCJP49JZBSK0NY1Z","nemoclaw-user-reference","Describes the NemoClaw integration layer and blueprint architecture and how they orchestrate compatible agent sandboxes. Use when looking up architecture, agent integration, plugin structure, or blueprint design. Trigger keywords - nemoclaw architecture, nemoclaw agent architecture, nemoclaw plugin blueprint structure, nemoclaw vs openshell, which cli, nemoclaw cli, openshell cli, sandbox commands, nemoclaw cli commands, nemoclaw command reference, nemoclaw network policy, sandbox egress control operator approval, nemoclaw troubleshooting, nemoclaw debug sandbox issues.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-reference\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7DAS5S79VK33XFGVAM2TFWF","nemoclaw-user-overview","Explains how OpenClaw, OpenShell, and NemoClaw form the ecosystem, NemoClaw's position in the stack, what NemoClaw adds beyond the community sandbox, and when to prefer NemoClaw versus integrating OpenShell and OpenClaw directly. Use when users ask about the relationship between OpenClaw, OpenShell, and NemoClaw, or when to use NemoClaw versus OpenShell. Trigger keywords - nemoclaw ecosystem, openclaw openshell, nemoclaw vs openshell, sandboxed openclaw, how nemoclaw works, nemoclaw sandbox lifecycle blueprint, nemoclaw overview, openclaw always-on assistants, nvidia openshell, nvidia nemotron, nemoclaw release notes, nemoclaw changelog.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-overview\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7DAS0PQEMET5MNGZ1ABSZVS","nemoclaw-user-monitor-sandbox","Inspects sandbox health, traces agent behavior, and diagnoses problems. Use when monitoring a running sandbox, debugging agent issues, or checking sandbox logs. Trigger keywords - monitor nemoclaw sandbox, debug nemoclaw agent issues.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-monitor-sandbox\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7DARQYGF7E9A69VH6S3CGN9","nemoclaw-user-manage-sandboxes","Explains operational tasks after the quickstart: listing sandboxes, status and health checks, logs, diagnostics, port forwards, multiple sandboxes, credential reset, rebuilds, network presets, upgrades, and uninstall. Trigger keywords - manage nemoclaw sandboxes, nemoclaw status, nemoclaw list, nemoclaw dashboard port, nemoclaw rebuild, nemoclaw upgrade sandboxes, nemoclaw uninstall, sandbox mutability, sandbox runtime configuration, sandbox rebuild, nemoclaw backup, nemoclaw restore, workspace backup, openshell sandbox download upload, nemoclaw messaging channels, nemoclaw telegram, nemoclaw discord, nemoclaw slack, nemoclaw wechat, nemoclaw whatsapp, openshell channel messaging, nemoclaw workspace files, soul.md, user.md, identity.md, agents.md, sandbox persistence.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-manage-sandboxes\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7DARH8BRTG51TRCAB7YWDJ4","nemoclaw-user-manage-policy","Adds, removes, or modifies allowed endpoints in the sandbox policy. Use when customizing network policy, changing egress rules, or configuring sandbox endpoint access. Trigger keywords - customize nemoclaw network policy, sandbox egress policy configuration, nemoclaw integration policy examples, post-install policy setup, openshell approval workflow, policy preset, nemoclaw approve network requests, sandbox egress approval tui.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-manage-policy\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M7DARAT62M2VR37590VCZ5NS","nemoclaw-user-get-started","Installs NemoClaw, launches a sandbox, and runs the first agent prompt. Use when onboarding, installing, or launching a NemoClaw sandbox for the first time. Trigger keywords - nemoclaw quickstart, install nemoclaw openclaw sandbox, nemohermes quickstart, hermes agent nemoclaw, run hermes openshell sandbox, nemoclaw prerequisites, nemoclaw supported platforms, nemoclaw hardware software, nemoclaw windows wsl2 setup, nemoclaw install windows docker desktop.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-get-started\u002FSKILL.md",[],[]]