Skip to content

Gherkin⚓︎

This curated list showcases Gherkin features generated by our GEN-AI pipeline, leveraging advanced LLM to discover scripts based on your code. These features are tailored to optimize test automation, enhancing efficiency and effectiveness in your software testing endeavors. Explore this resource to streamline your testing processes and elevate your development workflow with precision-generated scripts.

OwnerController.feature⚓︎

Feature: Owner Management

  Background: 
    Given the PetClinic application is running at 'https://petclinic.example.com'

  Scenario: Initiate creation of a new owner
    When I send a GET request to '/owners/new'
    Then the response status should be 200
    And the response should contain the owner creation form

  Scenario Outline: Successfully create a new owner
    Given I have the following owner details
      | firstName | lastName | address      | city    | telephone |
      | <firstName> | <lastName> | <address> | <city> | <telephone> |
    When I send a POST request to '/owners/new' with the given details
    Then the response status should be 302
    And the response 'Location' header should be a valid owner URI

  Examples:
    | firstName | lastName | address       | city    | telephone |
    | John      | Doe      | 123 Main St.  | Anytown | 1234567890 |
    | Jane      | Roe      | 456 Elm St.   | Newtown | 9876543210 |

  Scenario: Attempt to create a new owner with missing required fields
    Given I have the following owner details with missing 'lastName'
      | firstName | address      | city    | telephone |
      | John      | 123 Main St. | Anytown | 1234567890 |
    When I send a POST request to '/owners/new' with the given details
    Then the response status should indicate a client error

  # Add cleanup scenarios if needed

PetController.feature⚓︎

Feature: Pet Management

  Background: 
    Given the PetClinic application is running at 'https://petclinic.example.com'

  Scenario Outline: Initiate creation of a new pet
    Given an owner with ID <ownerId> exists
    When I send a GET request to '/owners/{ownerId}/pets/new'
    Then the response status should be 200
    And the response should contain the pet creation form

  Scenario Outline: Successfully create a new pet
    Given an owner with ID <ownerId> exists
    And I have the following pet details
      | name    | birthDate  | type        |
      | <name>  | <birthDate>| <type>      |
    When I send a POST request to '/owners/{ownerId}/pets/new' with the given details
    Then the response status should be 302
    And the response 'Location' header should be '/owners/{ownerId}'

  Examples:
    | ownerId | name      | birthDate  | type      |
    | 1       | Bella     | 2021-08-15 | Dog       |
    | 2       | Whiskers  | 2020-11-01 | Cat       |

  Scenario: Attempt to create a new pet with missing required fields
    Given an owner with ID 1 exists
    When I send a POST request to '/owners/1/pets/new' with missing 'name'
    Then the response status should indicate a client error

  # Add cleanup scenarios if needed

VetController.feature⚓︎

Feature: Vet Management

  Background: 
    Given the PetClinic application is running at 'https://petclinic.example.com'

  Scenario: List all vets
    When I send a GET request to '/vets'
    Then the response status should be 200
    And the response should contain a list of vets

  Scenario Outline: Show vet list page with pagination
    When I send a GET request to '/vets.html' with the query parameter 'page' set to <page>
    Then the response status should be 200
    And the response should contain a vet list page for page number <page>

  Examples:
    | page |
    | 1    |
    | 2    |
    | 3    |

  # Additional scenarios can be added for error cases or specific vet details

VisitController.feature⚓︎

Feature: Visit Management

  Background: 
    Given the PetClinic application is running at 'https://petclinic.example.com'

  Scenario Outline: Initiate creation of a new visit
    Given an owner with ID <ownerId> exists
    And a pet with ID <petId> belonging to the owner exists
    When I send a GET request to '/owners/{ownerId}/pets/{petId}/visits/new'
    Then the response status should be 200
    And the response should contain the visit creation form

  Scenario Outline: Successfully create a new visit
    Given an owner with ID <ownerId> exists
    And a pet with ID <petId> belonging to the owner exists
    And I have the following visit details
      | date       | description       |
      | <date>     | <description>     |
    When I send a POST request to '/owners/{ownerId}/pets/{petId}/visits/new' with the given details
    Then the response status should be 302
    And the response 'Location' header should be '/owners/{ownerId}'

  Examples:
    | ownerId | petId | date       | description         |
    | 1       | 2     | 2023-04-12 | Annual vaccination  |
    | 3       | 4     | 2023-05-19 | General checkup     |

  Scenario: Attempt to create a new visit with missing required fields
    Given an owner with ID 1 exists
    And a pet with ID 2 belonging to the owner exists
    When I send a POST request to '/owners/1/pets/2/visits/new' with missing 'description'
    Then the response status should indicate a client error

  # Add cleanup scenarios if needed