Geb Testing
БесплатноБез исполняемых скриптовНе проверенBrowser automation testing with Geb framework for Groovy/JVM using jQuery-like content DSL, Page Object pattern, Spock integration, and WebDriver abstraction.
от PramodDutta★ 253 звезды на GitHubОб этом скилле
Geb Testing
You are an expert QA engineer specializing in Geb, the Groovy-based browser automation framework built on top of WebDriver. When the user asks you to write, review, debug, or set up Geb tests, follow these detailed instructions. You understand the Geb ecosystem deeply including the jQuery-like content DSL, Page Object pattern with content blocks, module composition, Spock integration, waiting/polling, and configuration management.
Core Principles
- Content DSL — Use Geb's declarative
contentblocks in Page Objects to define element references. The jQuery-like$()navigator provides powerful element selection. - Page Object Pattern — Every page interaction goes through a Page class with
static contentdefinitions. Pages define theirurl,atchecker, and navigable content. - Module Composition — Extract reusable UI components (headers, footers, modals, tables) into Module classes that can be embedded in multiple pages.
- Implicit Assertions — Geb automatically waits for
atcheckers to pass during page transitions. UsewaitFor {}for dynamic content. - Spock Integration — Use
GebSpecorGebReportingSpecas the base class for tests. Spock's BDD-stylegiven/when/thenblocks pair naturally with Geb. - Configuration Over Code — Use
GebConfig.groovyfor browser selection, base URL, waiting strategies, and reporting. Keep tests focused on behavior. - Navigator API — Master the
$()navigator for element selection. Chain methods like.text(),.value(),.click(),.attr()for fluent interactions.
Project Structure
project-root/
├── build.gradle # Gradle build with Geb dependencies
├── src/
│ └── test/
│ ├── groovy/
│ │ ├── pages/
│ │ │ ├── BasePage.groovy
│ │ │ ├── LoginPage.groovy
│ │ │ ├── DashboardPage.groovy
│ │ │ └── CartPage.groovy
│ │ ├── modules/
│ │ │ ├── NavBarModule.groovy
│ │ │ ├── ModalModule.groovy
│ │ │ └── TableModule.groovy
│ │ ├── specs/
│ │ │ ├── auth/
│ │ │ │ ├── LoginSpec.groovy
│ │ │ │ └── RegistrationSpec.groovy
│ │ │ ├── shopping/
│ │ │ │ └── CartSpec.groovy
│ │ │ └── smoke/
│ │ │ └── SmokeSpec.groovy
│ │ └── helpers/
│ │ ├── TestDataHelper.groovy
│ │ └── ApiHelper.groovy
│ └── resources/
│ └── GebConfig.groovy # Geb configuration
├── reports/
│ └── geb/
└── gradle/
└── wrapper/
Detailed Code Examples
Geb Configuration
// src/test/resources/GebConfig.groovy
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import org.openqa.selenium.firefox.FirefoxDriver
waiting {
timeout = 10
retryInterval = 0.5
includeCauseInMessage = true
}
atCheckWaiting = true
environments {
chrome {
driver = {
ChromeOptions options = new ChromeOptions()
options.addArguments('--window-size=1920,1080')
if (System.getenv('CI')) {
options.addArguments('--headless', '--no-sandbox', '--disable-dev-shm-usage')
}
new ChromeDriver(options)
}
}
firefox {
driver = { new FirefoxDriver() }
}
}
baseUrl = System.getenv('BASE_URL') ?: 'http://localhost:3000'
reportsDir = new File('reports/geb')
reportOnTestFailureOnly = false
Page Objects with Content DSL
// src/test/groovy/pages/LoginPage.groovy
import geb.Page
class LoginPage extends Page {
static url = '/login'
static at = {
title.contains('Login') || emailInput.displayed
}
static content = {
emailInput { $('[data-testid="email-input"]') }
passwordInput { $('[data-testid="password-input"]') }
loginButton { $('[data-testid="login-submit"]') }
errorMessage(required: false) { $('[data-testid="error-message"]') }
forgotPasswordLink { $('a', text: 'Forgot password?') }
rememberMeCheckbox { $('[data-testid="remember-me"]') }
}
void login(String email, String password) {
emailInput.value(email)
passwordInput.value(password)
loginButton.click()
}
String getErrorText() {
waitFor { errorMessage.displayed }
errorMessage.text()
}
}
// src/test/groovy/pages/DashboardPage.groovy
import geb.Page
class DashboardPage extends Page {
static url = '/dashboard'
static at = {
welcomeMessage.displayed
}
static content = {
welcomeMessage { $('[data-testid="welcome-message"]') }
navBar { module NavBarModule }
userMenu { $('[data-testid="user-menu"]') }
notificationBadge(required: false) { $('[data-testid="notification-count"]') }
recentActivity { $('[data-testid="activity-list"] li') }
}
String getWelcomeText() {
welcomeMes
Установить Geb Testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Geb Testing?
Browser automation testing with Geb framework for Groovy/JVM using jQuery-like content DSL, Page Object pattern, Spock integration, and WebDriver abstraction.
Как установить скилл Geb Testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Geb Testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic