人気の面接質問と回答・オンラインテスト
面接対策、オンラインテスト、チュートリアル、ライブ練習のための学習プラットフォーム

集中型学習パス、模擬テスト、面接向けコンテンツでスキルを伸ばしましょう。

WithoutBook は、分野別の面接質問、オンライン練習テスト、チュートリアル、比較ガイドをひとつのレスポンシブな学習空間にまとめています。

Chapter 2

Gherkin Syntax, Features, Scenarios, Given When Then, and Writing Clear Examples

Learn the language of Cucumber so you can write readable, useful, and maintainable behavior specifications.

Inside this chapter

  1. What Gherkin Is
  2. Simple Example
  3. How to Think About Given When Then
  4. Writing Good Scenarios

Series navigation

Study the chapters in order for the clearest path from beginner BDD concepts to advanced automation architecture. Use the navigation at the bottom of each page to move through the full tutorial series.

Tutorial Home

Chapter 2

What Gherkin Is

Gherkin is the domain-specific language used by Cucumber to describe system behavior. It is intentionally simple and human-readable so stakeholders can discuss scenarios even if they do not write application code. The most common keywords are Feature, Scenario, Given, When, Then, And, and But.

Chapter 2

Simple Example

Feature: Login

  Scenario: Valid user signs in successfully
    Given the user is on the login page
    When the user enters valid credentials
    Then the dashboard should be displayed

This format is small, but it already captures business intent in a way that both humans and automation can work with.

Chapter 2

How to Think About Given When Then

  • Given: the starting context or precondition
  • When: the action or event
  • Then: the expected outcome

Strong BDD writing keeps each scenario focused on one behavior. If the scenario becomes too long, it is often describing too much at once.

Chapter 2

Writing Good Scenarios

Good scenarios are concrete, user-focused, and outcome-driven. They avoid implementation noise such as button IDs, CSS selectors, or internal system details unless those details are truly part of the business behavior. The scenario should communicate intent first, not automation mechanics.

著作権 © 2026、WithoutBook。