$npx -y skills add LambdaTest/agent-skills --skill gauge-skillGenerates Gauge test specifications in Markdown with step implementations in Java, Python, JS, or Ruby. ThoughtWorks' test automation framework. Use when user mentions "Gauge", "spec file", "## Scenario", "step implementation". Triggers on: "Gauge", "Gauge spec", "Gauge framework
| 1 | # Gauge Automation Skill |
| 2 | |
| 3 | ## Core Patterns |
| 4 | |
| 5 | ### Specification (specs/login.spec) |
| 6 | |
| 7 | ```markdown |
| 8 | # Login Feature |
| 9 | |
| 10 | ## Successful Login |
| 11 | * Navigate to login page |
| 12 | * Enter email "user@test.com" |
| 13 | * Enter password "password123" |
| 14 | * Click login button |
| 15 | * Verify dashboard is displayed |
| 16 | * Verify welcome message contains "Welcome" |
| 17 | |
| 18 | ## Invalid Credentials |
| 19 | * Navigate to login page |
| 20 | * Enter email "wrong@test.com" |
| 21 | * Enter password "wrong" |
| 22 | * Click login button |
| 23 | * Verify error message "Invalid credentials" is shown |
| 24 | |
| 25 | ## Login with multiple users |
| 26 | |email |password |expected | |
| 27 | |-----------------|---------|----------| |
| 28 | |admin@test.com |admin123 |Dashboard | |
| 29 | |user@test.com |pass123 |Dashboard | |
| 30 | |bad@test.com |wrong |Error | |
| 31 | |
| 32 | * Login as <email> with <password> |
| 33 | * Verify <expected> page is shown |
| 34 | ``` |
| 35 | |
| 36 | ### Step Implementation — Java |
| 37 | |
| 38 | ```java |
| 39 | import com.thoughtworks.gauge.Step; |
| 40 | import com.thoughtworks.gauge.Table; |
| 41 | |
| 42 | public class LoginSteps { |
| 43 | WebDriver driver; |
| 44 | |
| 45 | @Step("Navigate to login page") |
| 46 | public void navigateToLogin() { |
| 47 | driver.get("http://localhost:3000/login"); |
| 48 | } |
| 49 | |
| 50 | @Step("Enter email <email>") |
| 51 | public void enterEmail(String email) { |
| 52 | driver.findElement(By.id("email")).sendKeys(email); |
| 53 | } |
| 54 | |
| 55 | @Step("Enter password <password>") |
| 56 | public void enterPassword(String password) { |
| 57 | driver.findElement(By.id("password")).sendKeys(password); |
| 58 | } |
| 59 | |
| 60 | @Step("Click login button") |
| 61 | public void clickLogin() { |
| 62 | driver.findElement(By.cssSelector("button[type='submit']")).click(); |
| 63 | } |
| 64 | |
| 65 | @Step("Verify dashboard is displayed") |
| 66 | public void verifyDashboard() { |
| 67 | assertTrue(driver.getCurrentUrl().contains("/dashboard")); |
| 68 | } |
| 69 | } |
| 70 | ``` |
| 71 | |
| 72 | ### Step Implementation — Python |
| 73 | |
| 74 | ```python |
| 75 | from getgauge.python import step |
| 76 | from selenium import webdriver |
| 77 | |
| 78 | @step("Navigate to login page") |
| 79 | def navigate_to_login(): |
| 80 | driver.get("http://localhost:3000/login") |
| 81 | |
| 82 | @step("Enter email <email>") |
| 83 | def enter_email(email): |
| 84 | driver.find_element_by_id("email").send_keys(email) |
| 85 | |
| 86 | @step("Click login button") |
| 87 | def click_login(): |
| 88 | driver.find_element_by_css_selector("button[type='submit']").click() |
| 89 | ``` |
| 90 | |
| 91 | ### Concepts (Reusable Step Groups — specs/concepts/login.cpt) |
| 92 | |
| 93 | ```markdown |
| 94 | # Login as <email> with <password> |
| 95 | * Navigate to login page |
| 96 | * Enter email <email> |
| 97 | * Enter password <password> |
| 98 | * Click login button |
| 99 | ``` |
| 100 | |
| 101 | ## Setup: `gauge install java` (or `python`, `js`, `ruby`) |
| 102 | ## Init: `gauge init java` |
| 103 | ## Run: `gauge run specs/` or `gauge run specs/login.spec` |
| 104 | |
| 105 | ### Cloud Execution on TestMu AI |
| 106 | |
| 107 | Set environment variables: `LT_USERNAME`, `LT_ACCESS_KEY` |
| 108 | |
| 109 | ```java |
| 110 | // StepImplementation.java |
| 111 | ChromeOptions browserOptions = new ChromeOptions(); |
| 112 | HashMap<String, Object> ltOptions = new HashMap<>(); |
| 113 | ltOptions.put("user", System.getenv("LT_USERNAME")); |
| 114 | ltOptions.put("accessKey", System.getenv("LT_ACCESS_KEY")); |
| 115 | ltOptions.put("build", "Gauge Build"); |
| 116 | ltOptions.put("platformName", "Windows 11"); |
| 117 | ltOptions.put("video", true); |
| 118 | ltOptions.put("console", true); |
| 119 | browserOptions.setCapability("LT:Options", ltOptions); |
| 120 | Driver.setWebDriver(new RemoteWebDriver( |
| 121 | new URL("https://hub.lambdatest.com/wd/hub"), browserOptions)); |
| 122 | ``` |
| 123 | ## Tags: `gauge run --tags "smoke"` (use `Tags: smoke` in spec) |
| 124 | |
| 125 | ## Deep Patterns |
| 126 | |
| 127 | See `reference/playbook.md` for production-grade patterns: |
| 128 | |
| 129 | | Section | What You Get | |
| 130 | |---------|-------------| |
| 131 | | §1 Project Setup | Installation, project structure, environment properties | |
| 132 | | §2 Spec Files | Markdown scenarios, data tables, concepts (.cpt) | |
| 133 | | §3 Step Implementations | Java steps, table-driven steps, assertions | |
| 134 | | §4 Hooks & Execution | BeforeSuite/Scenario/Step, screenshots, browser logs | |
| 135 | | §5 Page Objects | BasePage, concrete pages, usage in steps | |
| 136 | | §6 Data Management | ScenarioDataStore, SpecDataStore, CSV data | |
| 137 | | §7 LambdaTest Integration | Remote driver factory with LT:Options | |
| 138 | | §8 CI/CD Integration | GitHub Actions with parallel execution, XML reports | |
| 139 | | §9 Debugging Table | 12 common problems with causes and fixes | |
| 140 | | §10 Best Practices | 14-item Gauge testing checklist | |