Templates and Tips
Gherkin
Testing

Testing Gherkin

Following it's a template for the *.feature file that you have to send for ctf-hacking solutions

## Version 1.0
## language: en
 
#Keep comments if they start with double sharp ##
 
#M: Mandatory
#O: Optional
 
#{} are template tags. A final feature should not contain any of these.
#<> are gherkin tags. They allow creating variables and are commonly used in
#tables (e.g: Background and Extraction scenarios.)
 
Feature: Make a bank transaction
  """
  This section is intended for the analyst.
  to provide general information about the test you are taking,
  what is your objective and recommendations on
  how to remedy errors.
  """
 
  Code: #O
    {code} #Code of the challenge if it exists
  Site: #M
    {site} #Site where the challenge can be found
  Category: #O
    {category} #Category of the challenge within the site e.g: White-box, Unit... 
  User: #M
    {user} #Username used in the site when solving the challenge
  Goal: #M
    {goal} #Short description of your goal
 
 
Scenario: Transfer funds between two accounts
    Description: 
      In this test we make the transaction with normal values
 
    Given the user is authenticated in their bank account
    And the user has an origin account with a balance of $1000
    And the user has a destination account
    When the user requests a transfer of $500 from the origin account to the destination account
    Then the transaction should be successful
 
  Scenario: Incident Impact
    Description:
        In this test we make the transaction without funds
 
    Scenario: Attempted transfer with insufficient funds
    Given the user is authenticated in their bank account
    And the user has an origin account with a balance of $100
    And the user has a destination account
    When the user requests a transfer of $200 from the origin account to the destination account
    Then the transaction should fail
 
  """
  Evidences:
  Presenting evidence of some kind of graphical output,
  like websites,
  might be difficult when using plain feature files.
 
  How does this work?
  - Any feature file {name}.feature can have a {name} evidences folder in the
  Google drive directory.
  - Evidence folders only accept PNG images
  - Evidences are referenced in two different ways:
    - Creating an <evidence> tag in a table
      inside a Scenario Outline like shown
      on the Extraction Scenario example
      (useful for referencing multiple evidences).
    - By using the following syntax: [evidence](image.png) like shown on the
      Normal use case Scenario example.
      (useful for referencing one or two evidences at most.)
  """
💡

Folder of evidences should be named as the feature file, for example:

  • testing/automation-exercise/testing-challenge-name/username/evidence.png

Important to keep in mind: The review is done between 8am and 5pm Colombia Time - Monday to Friday. Note that these image evidence are not uploaded to the repository but to a folder in a Google Drive to which we will give you access once you enter the process, remember that the structure of the folder in the Drive is the same as the one you see in the repository. Is necessary to have a Google account to upload the images.