$npx -y skills add LambdaTest/agent-skills --skill selenide-skillGenerates Selenide tests in Java. Concise UI testing framework built on Selenium with automatic waits and fluent API. Use when user mentions "Selenide", "$(selector)", "shouldBe(visible)", "Selenide Java". Triggers on: "Selenide", "$() selector", "shouldBe", "shouldHave", "Seleni
| 1 | # Selenide Automation Skill |
| 2 | |
| 3 | ## Core Patterns |
| 4 | |
| 5 | ### Basic Test |
| 6 | |
| 7 | ```java |
| 8 | import com.codeborne.selenide.*; |
| 9 | import static com.codeborne.selenide.Selenide.*; |
| 10 | import static com.codeborne.selenide.Condition.*; |
| 11 | import org.junit.jupiter.api.Test; |
| 12 | |
| 13 | class LoginTest { |
| 14 | @Test |
| 15 | void loginWithValidCredentials() { |
| 16 | open("/login"); |
| 17 | $("#email").setValue("user@test.com"); |
| 18 | $("#password").setValue("password123"); |
| 19 | $("button[type='submit']").click(); |
| 20 | $(".dashboard").shouldBe(visible); |
| 21 | $(".welcome").shouldHave(text("Welcome")); |
| 22 | } |
| 23 | |
| 24 | @Test |
| 25 | void loginShowsError() { |
| 26 | open("/login"); |
| 27 | $("#email").setValue("wrong@test.com"); |
| 28 | $("#password").setValue("wrong"); |
| 29 | $("button[type='submit']").click(); |
| 30 | $(".error").shouldBe(visible).shouldHave(text("Invalid")); |
| 31 | } |
| 32 | } |
| 33 | ``` |
| 34 | |
| 35 | ### Selectors |
| 36 | |
| 37 | ```java |
| 38 | $("css-selector") // CSS |
| 39 | $(byText("Login")) // Exact text |
| 40 | $(withText("Welc")) // Contains text |
| 41 | $(byId("email")) // By ID |
| 42 | $(byName("password")) // By name |
| 43 | $(byXpath("//button")) // XPath (avoid) |
| 44 | $("[data-testid='login-btn']") // data attribute (best) |
| 45 | |
| 46 | // Collections |
| 47 | $$("li").shouldHave(size(5)); |
| 48 | $$("li").first().shouldHave(text("Item 1")); |
| 49 | $$("li").filterBy(text("Active")).shouldHave(size(2)); |
| 50 | ``` |
| 51 | |
| 52 | ### Conditions |
| 53 | |
| 54 | ```java |
| 55 | element.shouldBe(visible); |
| 56 | element.shouldBe(hidden); |
| 57 | element.shouldBe(enabled); |
| 58 | element.shouldBe(disabled); |
| 59 | element.shouldHave(text("expected")); |
| 60 | element.shouldHave(exactText("Exact Match")); |
| 61 | element.shouldHave(value("input value")); |
| 62 | element.shouldHave(attribute("href", "/link")); |
| 63 | element.shouldHave(cssClass("active")); |
| 64 | element.shouldNot(exist); |
| 65 | ``` |
| 66 | |
| 67 | ### TestMu AI Cloud |
| 68 | |
| 69 | ```java |
| 70 | Configuration.remote = "https://" + LT_USERNAME + ":" + LT_ACCESS_KEY |
| 71 | + "@hub.lambdatest.com/wd/hub"; |
| 72 | Configuration.browserCapabilities = new DesiredCapabilities(); |
| 73 | Configuration.browserCapabilities.setCapability("browserName", "chrome"); |
| 74 | Configuration.browserCapabilities.setCapability("LT:Options", Map.of( |
| 75 | "build", "Selenide Build", "name", "Login Test", |
| 76 | "platform", "Windows 11", "video", true |
| 77 | )); |
| 78 | ``` |
| 79 | |
| 80 | ## Setup: Maven `com.codeborne:selenide:7.0.0` |
| 81 | ## Run: `mvn test` (auto-downloads browser driver) |
| 82 | |
| 83 | For TestMu AI cloud execution, see [reference/cloud-integration.md](reference/cloud-integration.md) and [shared/testmu-cloud-reference.md](../shared/testmu-cloud-reference.md). |
| 84 | |
| 85 | ## Deep Patterns |
| 86 | |
| 87 | For advanced patterns, debugging guides, CI/CD integration, and best practices, |
| 88 | see `reference/playbook.md`. |