All skills
fugazi avatar

/webapp-selenium-testing

@ef704d5

Author and maintain versioned Selenium WebDriver tests with Java and JUnit 5. Use for creating, debugging, or running Selenium specs, implementing Page Objects, handling explicit waits, capturing screenshots, or setting up Maven test projects. Supports Chrome, Firefox, and Edge. Keywords: Selenium WebDriver, Java, JUnit 5, Page Object Model, explicit waits, Maven, screenshots.

Use this Skill: https://skilld.dev/gh/fugazi/test-automation-skills-agents/webapp-selenium-testing

This session only. Nothing lands on disk.

referencespage-object-model-patterns.md

≈855 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Page Object Model Fluent And Test Patterns

Part of the webapp-selenium-testing skill. See SKILL.md for full context.

Related: this file was split from the original page-object-model.md. See the other related files in this folder.

Fluent Interface Pattern

Design methods to return this or the next page object for method chaining:

// [ok] Fluent chaining within same page
loginPage
    .enterUsername("user@test.com")
    .enterPassword("password123")
    .checkRememberMe()
    .clickLogin();

// [ok] Fluent navigation to next page
DashboardPage dashboard = loginPage
    .open()
    .loginAs("user@test.com", "password");

// [ok] Chain with component
dashboard.getHeader()
    .search("product")
    .goToResults();

Implementation Rules

// Actions that stay on same page return 'this'
public LoginPage enterUsername(String username) {
    type(usernameInput, username);
    return this;  // ← Same page
}

// Actions that navigate return next page
public DashboardPage loginAs(String username, String password) {
    // ... login logic ...
    return new DashboardPage(driver);  // ← Next page
}

// Void return for terminal actions
public void clickLogin() {
    click(loginButton);
    // No return - end of chain, outcome determined by test
}

Test Class Example

package com.project.tests;

import com.project.base.BaseTest;
import io.qameta.allure.*;
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.*;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

@Epic("Authentication")
@Feature("Login")
class LoginTest extends BaseTest {

    @Test
    @Tag("smoke")
    @Severity(SeverityLevel.BLOCKER)
    @DisplayName("Should login successfully with valid credentials")
    void shouldLoginSuccessfully() {
        // Act
        var dashboard = loginPage
            .open()
            .loginAs("standard_user", "secret_sauce");

        // Assert
        SoftAssertions.assertSoftly(softly -> {
            softly.assertThat(dashboard.isLoaded())
                .as("Dashboard should be loaded")
                .isTrue();
            softly.assertThat(dashboard.getWelcomeMessage())
                .as("Welcome message")
                .containsIgnoringCase("Welcome");
            softly.assertThat(dashboard.getHeader().isLoggedIn())
                .as("User should be logged in")
                .isTrue();
        });
    }

    @ParameterizedTest(name = "Login fails with {0}")
    @Tag("regression")
    @Severity(SeverityLevel.CRITICAL)
    @CsvSource({
        "locked_user, secret_sauce, locked out",
        "invalid, wrong, do not match"
    })
    @DisplayName("Should show error for invalid credentials")
    void shouldShowErrorForInvalidCredentials(String user, String pass, String expectedError) {
        // Act
        loginPage
            .open()
            .loginExpectingError(user, pass);

        // Assert
        SoftAssertions.assertSoftly(softly -> {
            softly.assertThat(loginPage.isErrorDisplayed())
                .as("Error message visibility")
                .isTrue();
            softly.assertThat(loginPage.getErrorMessage())
                .as("Error message content")
                .containsIgnoringCase(expectedError);
        });

        attachScreenshot("login-error");
    }
}

Source: SKILL.md on GitHub

1 warning13d4 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    The skill provides templates and scripts for Selenium WebDriver testing in Java. It is categorized as low risk due to potential indirect prompt injection vulnerabilities inherent in browser automation and the use of JavaScript execution in the browser context.

  • Socket13d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

  • Runlayer6mo

    1/6 files flagged

Signed by skilld at ef704d5. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 2 months ago

README badge

README badge for fugazi/test-automation-skills-agents/webapp-selenium-testing