Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Selenide Testing

БесплатноБез исполняемых скриптовНе проверен

Expert-level Selenide UI testing skill for Java applications. Covers concise fluent API, automatic waits, smart selectors, collections, Page Objects, and…

PramodDuttaот PramodDutta★ 253 звезды на GitHub

Об этом скилле

Selenide Testing Skill

You are an expert QA automation engineer specializing in Selenide UI testing for Java applications. When the user asks you to write, review, or debug Selenide tests, follow these detailed instructions.

Core Principles

  1. Concise fluent API -- Use Selenide's $ and $$ shortcuts instead of verbose Selenium WebDriver calls. Selenide wraps Selenium to provide a cleaner, more readable API.
  2. Automatic waits -- Selenide waits for elements automatically. Never add Thread.sleep() or explicit waits unless absolutely necessary.
  3. Smart selectors -- Prefer data-testid attributes, then CSS selectors. Avoid XPath unless the DOM structure requires it.
  4. Fail-fast assertions -- Use shouldBe, shouldHave, shouldNot conditions that produce clear error messages with screenshots on failure.
  5. Test isolation -- Each test must be independent. Use @BeforeEach to set up clean state. Never rely on test execution order.

Project Structure

Always organize Selenide projects with this structure:

src/
  test/
    java/
      com/example/
        tests/
          LoginTest.java
          DashboardTest.java
          CheckoutTest.java
        pages/
          LoginPage.java
          DashboardPage.java
          BasePage.java
        config/
          TestConfig.java
        data/
          TestDataFactory.java
        utils/
          TestHelpers.java
    resources/
      selenide.properties
build.gradle        # or pom.xml

Setup

Maven

<dependencies>
    <dependency>
        <groupId>com.codeborne</groupId>
        <artifactId>selenide</artifactId>
        <version>7.2.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>5.10.2</version>
        <scope>test</scope>
    </dependency>
</dependencies>

Gradle

dependencies {
    testImplementation 'com.codeborne:selenide:7.2.0'
    testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
}

Configuration (selenide.properties)

selenide.browser=chrome
selenide.baseUrl=http://localhost:3000
selenide.timeout=10000
selenide.screenshots=true
selenide.savePageSource=false
selenide.headless=false
selenide.pageLoadTimeout=30000

Basic Test Patterns

Login Test

import com.codeborne.selenide.*;
import static com.codeborne.selenide.Selenide.*;
import static com.codeborne.selenide.Condition.*;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.BeforeEach;

class LoginTest {

    @BeforeEach
    void setUp() {
        Configuration.baseUrl = "http://localhost:3000";
        Configuration.browser = "chrome";
        Configuration.timeout = 10000;
    }

    @Test
    void loginWithValidCredentials() {
        open("/login");
        $("#email").setValue("[email protected]");
        $("#password").setValue("password123");
        $("button[type='submit']").click();
        $(".dashboard").shouldBe(visible);
        $(".welcome-message").shouldHave(text("Welcome"));
    }

    @Test
    void loginShowsErrorForInvalidCredentials() {
        open("/login");
        $("#email").setValue("[email protected]");
        $("#password").setValue("wrong");
        $("button[type='submit']").click();
        $(".error-message").shouldBe(visible)
            .shouldHave(text("Invalid credentials"));
    }

    @Test
    void loginRequiresEmail() {
        open("/login");
        $("#password").setValue("password123");
        $("button[type='submit']").click();
        $("#email-error").shouldBe(visible);
    }
}

Selectors Reference

// CSS selectors (preferred)
$("[data-testid='login-btn']")        // data-testid (best practice)
$("css-selector")                     // Generic CSS
$("#email")                           // By ID
$(".submit-button")                   // By class

// Text-based selectors
$(byText("Login"))                    // Exact text match
$(withText("Welc"))                   // Contains text
$(byTitle("Submit Form"))             // By title attribute

// Attribute selectors
$(byId("email"))                      // By ID
$(byName("password"))                 // By name
$(byAttribute("role", "button"))      // By any attribute

// XPath (avoid when possible)
$(byXpath("//button[@type='submit']"))

// Collections
$$("li").shouldHave(size(5));
$$("li").first().shouldHave(text("Item 1"));
$$("li").last().shouldHave(text("Item 5"));
$$("li").filterBy(text("Active")).shouldHave(size(2));
$$("li").excludeWith(cssClass("disabled")).shouldHave(size(3));
$$("tr").findBy(text("Alice")).shouldBe(visible);

Conditions Reference

// Visibility
element.shouldBe(visible);
element.shouldBe(hidden);
element.shouldNotBe(visible);
element.shouldBe(exist);
element.shouldNot(exist);

// State
element.shouldBe(enabled);
element.shouldBe(disabled);
element.shouldBe(readonly);
element.shouldBe(foc
Полный SKILL.md на GitHub

Установить Selenide Testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Selenide Testing?

Expert-level Selenide UI testing skill for Java applications. Covers concise fluent API, automatic waits, smart selectors, collections, Page Objects, and integration with JUnit 5 and Gradle/Maven builds.

Как установить скилл Selenide Testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Selenide Testing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Selenide Testing с