본문으로 건너뛰기
Skillpedia
테스트48k · #4303

cucumber-skill

하는 일

이 도구는 소프트웨어가 기대대로 작동하는지 확인하는 자동 테스트를 만듭니다. Gherkin이라는 언어로 테스트 단계를 설명합니다. 예를 들어 ‘Given’(전제) 로그인 페이지에 있다, ‘When’(실행) 버튼을 클릭한다, ‘Then’(결과) 메시지가 보인다처럼 씁니다.

사용하는 경우

  • ✓로그인이 제대로 되는지 테스트하고 싶을 때.
  • ✓사용자가 웹사이트와 상호작용하는 방식을 설명해야 할 때.
  • ✓소프트웨어 기능이 망가지지 않도록 확인하려는 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cucumber-skill/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cucumber-skill/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“사용자 로그인이 성공하는 경우에 대한 Gherkin 테스트를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 Gherkin으로 테스트를 설명하는 파일과, 이 테스트를 실행하는 코드(Java, JavaScript, Ruby)를 생성합니다. 이를 통해 소프트웨어가 예측 가능하게 동작하도록 돕습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Cucumber BDD Skill

When to Use

Use this skill when you need generates Cucumber BDD tests with Gherkin feature files and step definitions in Java, JavaScript, or Ruby. Use when user mentions "Cucumber", "Gherkin", "Feature/Scenario", "Given/When/Then", "BDD". Triggers on: "Cucumber", "Gherkin", "BDD", "Feature file", "Given/When/Then", "step...

Core Patterns

Feature File (Gherkin)

Feature: User Login
  As a registered user
  I want to log into the application
  So that I can access my dashboard

  Background:
    Given I am on the login page

  Scenario: Successful login
    When I enter "user@test.com" in the email field
    And I enter "password123" in the password field
    And I click the login button
    Then I should be redirected to the dashboard
    And I should see "Welcome" on the page

  Scenario: Invalid credentials
    When I enter "wrong@test.com" in the email field
    And I enter "wrongpass" in the password field
    And I click the login button
    Then I should see an error message "Invalid credentials"

  Scenario Outline: Login with various users
    When I enter "<email>" in the email field
    And I enter "<password>" in the password field
    And I click the login button
    Then I should see "<result>"

    Examples:
      | email           | password    | result     |
      | admin@test.com  | admin123    | Dashboard  |
      | user@test.com   | password    | Dashboard  |
      | bad@test.com    | wrong       | Error      |

Step Definitions — Java

import io.cucumber.java.en.*;
import static org.junit.jupiter.api.Assertions.*;

public class LoginSteps {
    private LoginPage loginPage;
    private DashboardPage dashboardPage;

    @Given("I am on the login page")
    public void iAmOnTheLoginPage() {
        loginPage = new LoginPage(driver);
        loginPage.navigate();
    }

    @When("I enter {string} in the email field")
    public void iEnterEmail(String email) {
        loginPage.enterEmail(email);
    }

    @When("I enter {string} in the password field")
    public void iEnterPassword(String password) {
        loginPage.enterPassword(password);
    }

    @When("I click the login button")
    public void iClickLogin() {
        dashboardPage = loginPage.clickLogin();
    }

    @Then("I should be redirected to the dashboard")
    public void iShouldBeOnDashboard() {
        assertTrue(driver.getCurrentUrl().contains("/dashboard"));
    }

    @Then("I should see {string} on the page")
    public void iShouldSeeText(String text) {
        assertTrue(dashboardPage.getPageSource().contains(text));
    }
}

Step Definitions — JavaScript

const { Given, When, Then } = require('@cucumber/cucumber');
const { expect } = require('chai');

Given('I am on the login page', async function() {
  await this.page.goto('/login');
});

When('I enter {string} in the email field', async function(email) {
  await this.page.fill('#email', email);
});

When('I click the login button', async function() {
  await this.page.click('button[type="submit"]');
});

Then('I should see {string} on the page', async function(text) {
  const content = await this.page.textContent('body');
  expect(content).to.include(text);
});

Hooks

import io.cucumber.java.*;

public class Hooks {
    @Before
    public void setUp(Scenario scenario) {
        driver = new ChromeDriver();
    }

    @After
    public void tearDown(Scenario scenario) {
        if (scenario.isFailed()) {
            byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
            scenario.attach(screenshot, "image/png", "failure-screenshot");
        }
        driver.quit();
    }
}

Tags

@smoke
Feature: Login
  @critical @fast
  Scenario: Quick login
    ...

  @slow @regression
  Scenario: Full login flow
    ...
# Run by tag
mvn test -Dcucumber.filter.tags="@smoke"
mvn test -Dcucumber.filter.tags="@smoke and not @slow"

Anti-Patterns

Bad Good Why
UI details in Gherkin Business language Readability
One step per line of code Meaningful business steps Abstraction
No Background for shared steps Use Background DRY
Imperative steps Declarative steps Maintainable

Cloud Execution on TestMu AI

Set environment variables: LT_USERNAME, LT_ACCESS_KEY

Java:

// CucumberHooks.java

…
자주 묻는 질문

Gherkin이란 무엇인가요?

테스트 단계를 작성하는 데 쓰는 간단하고 사람이 읽기 쉬운 언어입니다. ‘Given’, ‘When’, ‘Then’ 같은 키워드로 기대되는 동작을 설명합니다.

‘스텝 정의(Step Definitions)’란 무엇인가요?

Gherkin으로 쓴 각 단계에 대해 컴퓨터가 무엇을 해야 하는지 알려 주는 코드(Java, JavaScript, Ruby 등)입니다. 테스트 설명을 소프트웨어의 실제 동작과 연결합니다.

‘태그’는 무엇에 쓰나요?

테스트에 붙이는 라벨(예: ‘@smoke’ 또는 ‘@regression’)입니다. 실행할 테스트를 고를 수 있게 해 주며, 가장 중요한 테스트만 실행하는 데 도움이 됩니다.

상세 정보

작성자의 원본 설명

Generates Cucumber BDD tests with Gherkin feature files and step definitions in Java, JavaScript, or Ruby. Use when user mentions \"Cucumber\", \"Gherkin\", \"Feature/Scenario\", \"Given/When/Then\", \"BDD\".

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4303
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬