@managing_customers
Feature: Editing a customer
    In order to change information about a customer
    As an Administrator
    I want to be able to edit the customer

    Background:
        Given I am logged in as an administrator

    @ui
    Scenario: Changing first and last name of an existing customer
        Given the store has customer "Frodo Baggins" with email "f.baggins@example.com"
        And I want to edit this customer
        When I specify his first name as "Jon"
        And I specify his last name as "Snow"
        And I save my changes
        Then I should be notified that it has been successfully edited
        And this customer with name "Jon Snow" should appear in the store

    @ui
    Scenario: Removing first and last name from an existing customer
        Given the store has customer "Luke Skywalker" with email "l.skywalker@gmail.com"
        And I want to edit this customer
        When I remove its first name
        And I remove its last name
        And I save my changes
        Then I should be notified that it has been successfully edited
        And this customer should have an empty first name
        And this customer should have an empty last name

Add scenario for making customer subscribed to the newsletter

@managing_customers
Feature: Editing a customer
    In order to change information about a customer
    As an Administrator
    I want to be able to edit the customer

    Background:
        Given I am logged in as an administrator

    @ui
    Scenario: Changing first and last name of an existing customer
        Given the store has customer "Frodo Baggins" with email "f.baggins@example.com"
        And I want to edit this customer
        When I specify his first name as "Jon"
        And I specify his last name as "Snow"
        And I save my changes
        Then I should be notified that it has been successfully edited
        And this customer with name "Jon Snow" should appear in the store

    @ui
    Scenario: Removing first and last name from an existing customer
        Given the store has customer "Luke Skywalker" with email "l.skywalker@gmail.com"
        And I want to edit this customer
        When I remove its first name
        And I remove its last name
        And I save my changes
        Then I should be notified that it has been successfully edited
        And this customer should have an empty first name
        And this customer should have an empty last name

    @todo
    Scenario: Making an existing customer subscribed to the newsletter
        Given the store has customer "Mike Ross" with email "ross@teammike.com"
        When I want to edit this customer
        And I make them subscribed to the newsletter
        And I save my changes
        Then I should be notified that it has been successfully edited
        And this customer should subscribe to the newsletter


Feature: GZIP sitemap build

  Scenario: Sitemap should be gzipped by default
    Given a successfully built app at "gzip-app"
    Then the following files should exist:
      | build/sitemap.xml.gz |
      | build/sitemap.xml |

  Scenario: Sitemap should not be gzipped when option set to false
    Given a fixture app "gzip-app"
    And a file named "config.rb" with:
      """
      activate :sitemap, :gzip => false
      """
    And a successfully built app at "gzip-app"
    When I cd to "build"
    Then the following files should not exist:
      | build/sitemap.xml.gz |

Scenario: Sitemap should not be gzipped when option set to false
  Given a fixture app "gzip-app"
  And a file named "config.rb" with:
    """
    activate :sitemap, :hostname => "http://www.apple.com"
    """
  And a successfully built app at "gzip-app"
  When I cd to "build"
  Then the file "sitemap.xml" should contain "http://www.apple.com"

Add test around GZIP extension

Feature: GZIP sitemap build

  Scenario: Sitemap should be gzipped by default
    Given a successfully built app at "gzip-app"
    Then the following files should exist:
      | build/sitemap.xml.gz |
      | build/sitemap.xml |

  Scenario: Sitemap should not be gzipped when option set to false
    Given a fixture app "gzip-app"
    And a file named "config.rb" with:
      """
      activate :sitemap, :gzip => false
      """
    And a successfully built app at "gzip-app"
    When I cd to "build"
    Then the following files should not exist:
      | build/sitemap.xml.gz |

  Scenario: Sitemap should not be gzipped when option set to false
    Given a fixture app "gzip-app"
    And a file named "config.rb" with:
      """
      activate :sitemap, :hostname => "http://www.apple.com"
      """
    And a successfully built app at "gzip-app"
    When I cd to "build"
    Then the file "sitemap.xml" should contain "http://www.apple.com"

  Scenario: Site that has been gzipped
    Given a fixture app "gzip-app"
    And a file named "config.rb" with:
    """
    activate :gzip
    activate :sitemap, :hostname => "http://www.apple.com"
    """
    And a successfully built app at "gzip-app"
    When I cd to "build"
    Then the file "sitemap.xml" should contain "http://www.apple.com"


@polymer-bond
Feature: Sass mixin files

  In order to make Polymer awesome
  It should generate Sass mixins

  Scenario: Creating a Sass mixin with a sprite
    Given I have a default project
      And I have 1 source in sources/fry
    When I run "polymer bond"
    Then the exit status should be 0
      And a Sass mixin should exist
      And the stdout should contain "written  Sass"

  Scenario: When nothing is generated
    Given I have a default project
      And I have 1 source in sources/fry
      And I run "polymer bond"
    When I run "polymer bond"
    Then the stdout should not contain "written  Sass"

  Scenario: Disabling Sass in the config file
    Given I have a project with config:
    """
    ---
      config.sass false

      sprites 'sources/:name/*' => 'sprites/:name.png'
    """
    Then a Sass mixin should not exist

Clean up Sass mixin feature.

@polymer-bond
Feature: Sass mixin files

  In order to make Polymer awesome
  It should generate Sass mixins

  Scenario: Creating a Sass mixin with a sprite
    Given I have a default project
      And I have 1 source in sources/fry
    When I run "polymer bond"
    Then the exit status should be 0
      And a Sass mixin should exist
      And the stdout should contain "written  Sass"

  Scenario: When nothing is generated
    Given I have a default project
      And I have 1 source in sources/fry
      And I run "polymer bond"
    When I run "polymer bond"
    Then the stdout should not contain "written  Sass"

  Scenario: Disabling Sass in the config file
    Given I have a project with config:
    """
    config.sass false
    sprites 'sources/:name/*' => 'sprites/:name.png'
    """
    Then a Sass mixin should not exist


Feature: Recording a prescription

  Rules:
  - The administration (e.g. injection) of certain drugs requires a trained professional
   (i.e. Nurse) and the HD session provides this opportunity.

  Background:
    Given Clyde is a clinician
    And Patty is a patient

  @web @javascript
  Scenario: A clinician recorded the prescription for a patient
    When Clyde records the prescription for Patty
    Then the prescription is recorded for Patty

  @web @javascript
  Scenario: A clinician recorded the prescription for a patient with a termination date
    When Clyde records the prescription for Patty with a termination date
    Then the prescription is recorded for Patty
    And Clyde is recorded as the user who terminated the prescription

 @web @javascript
  Scenario: A clinician flagged a prescription to be administered during an HD session
    When Clyde flags the prescription for Patty to be administered during an HD session
    Then Clyde is prompted to administer the prescription during Patty's future HD sessions

Reposition rule as a description of the scenario

Feature: Recording a prescription

  Background:
    Given Clyde is a clinician
    And Patty is a patient

  @web @javascript
  Scenario: A clinician recorded the prescription for a patient
    When Clyde records the prescription for Patty
    Then the prescription is recorded for Patty

  @web @javascript
  Scenario: A clinician recorded the prescription for a patient with a termination date

    The administration (e.g. injection) of certain drugs requires a trained professional
    (i.e. Nurse) and the HD session provides this opportunity.

    When Clyde records the prescription for Patty with a termination date
    Then the prescription is recorded for Patty
    And Clyde is recorded as the user who terminated the prescription

 @web @javascript
  Scenario: A clinician flagged a prescription to be administered during an HD session
    When Clyde flags the prescription for Patty to be administered during an HD session
    Then Clyde is prompted to administer the prescription during Patty's future HD sessions


@administrator_login
Feature: Resetting an administrator's password
    In order to login to my administrator account when I forget my password
    As a not logged in Administrator
    I want to be able to reset my password

    Background:
        Given there is an administrator "sylius@example.com" identified by "sylius"

    @todo
    Scenario: Sending an administrator's password reset request
        When I want to reset password
        And I specify email as "sylius@example.com"
        And I reset it
        Then I should be notified that email with reset instruction has been sent
        And an email with instructions on how to reset the password should be sent to "sylius@example.com"

    @todo
    Scenario: Changing my administrator's password
        Given I have already received an administrator's password resetting email
        When I reset my password using the received instructions
        And I specify my new password as "newp@ssw0rd"
        And I confirm my new password as "newp@ssw0rd"
        And I reset it
        Then I should be notified that my password has been successfully changed
        And I should be able to log in as "sylius@example.com" with "newp@ssw0rd" password

    @todo
    Scenario: Trying to change my administrator's password twice without sending a new password reset request
        Given I already reset my administrator's password
        When I try to reset my password again using the same email
        Then I should not be able to change my password again without sending a new password reset request

Improve the wording of the behat scenario

@administrator_login
Feature: Resetting an administrator's password
    In order to login to my administrator account when I forget my password
    As a not logged in Administrator
    I want to be able to reset my password

    Background:
        Given there is an administrator "sylius@example.com" identified by "sylius"

    @todo
    Scenario: Sending an administrator's password reset request
        When I want to reset password
        And I specify email as "sylius@example.com"
        And I reset it
        Then I should be notified that email with reset instruction has been sent
        And an email with instructions on how to reset the password should be sent to "sylius@example.com"

    @todo
    Scenario: Changing my administrator's password
        Given I have already received an administrator's password resetting email
        When I reset my password using the received instructions
        And I specify my new password as "newp@ssw0rd"
        And I confirm my new password as "newp@ssw0rd"
        And I reset it
        Then I should be notified that my password has been successfully changed
        And I should be able to log in as "sylius@example.com" with "newp@ssw0rd" password

    @todo
    Scenario: Trying to change my administrator's password twice without sending a new password reset request
        Given I already reset my administrator's password
        When I try to reset my password again using the same email
        Then I should not be able to change it again without sending a new password reset request


Feature: AmiGO search start pages show counts consistent with data loads

 ## No Background necessary.

 Scenario Outline: the search page shows counts consistent with data loads
   Given I go to search page "<searchpage>"
    then the total should be within 10% of recent count "<count>"
   Examples: search pages
    | searchpage               | count                    |
#   |--------------------------+--------------------------|
    | /amigo/search/annotation | 4722464                  |
    | /amigo/search/ontology   | 1319364                    |
    | /amigo/search/bioentity  | 828474                   |
##

Tag test for labs or production

Feature: AmiGO search pages show counts consistent with data loads

 ## No Background necessary.

 @production
 Scenario Outline: the search pages on the production server show counts consistent with data loads
   Given I go to search page "<searchpage>"
    then the total should be within 10% of recent count "<count>"
   Examples: search pages
    | searchpage               | count                    |
#   |--------------------------+--------------------------|
    | /amigo/search/annotation | 4715870                  |
    | /amigo/search/ontology   | 74795                    |
    | /amigo/search/bioentity  | 828351                   |
##

 @labs
 Scenario Outline: the search pages on the labs server show counts consistent with data loads
   Given I go to search page "<searchpage>"
    then the total should be within 10% of recent count "<count>"
   Examples: search pages
    | searchpage               | count                    |
#   |--------------------------+--------------------------|
    | /amigo/search/annotation | 4724502                  |
    | /amigo/search/ontology   | 1319608                  |
    | /amigo/search/bioentity  | 828489                   |
##


@targets @usefixtures(workbook)
Feature: Targets

    Scenario: Table
        When I visit "/targets/"
        And I wait for the table to fully load

        When I fill in "q" with "sapiens"
        Then I should see an element with the css selector "tr:not([hidden]) a[href='/targets/ADNP-human/']" within 1 seconds
        And I should see an element with the css selector "tr[hidden] a[href='/targets/H3K4me3-mouse/']"
        And I should see exactly one element with the css selector ".table-count" containing the text "13"

    Scenario: Detail page
        When I visit "/targets/ADNP-human/"
        And I should see an element with the css selector ".view-item.type-target"

        When I click the link to "http://www.uniprot.org/uniprot/Q9H2P0"
        Then the browser's URL should contain "www.uniprot.org"
        Then I should see "Q9H2P0 (ADNP_HUMAN)"

        When I go back
        Then the browser's URL should contain "/targets/"
        And I should see an element with the css selector ".view-item.type-target"

Fix target.features test for Uniprot change

@targets @usefixtures(workbook)
Feature: Targets

    Scenario: Table
        When I visit "/targets/"
        And I wait for the table to fully load

        When I fill in "q" with "sapiens"
        Then I should see an element with the css selector "tr:not([hidden]) a[href='/targets/ADNP-human/']" within 1 seconds
        And I should see an element with the css selector "tr[hidden] a[href='/targets/H3K4me3-mouse/']"
        And I should see exactly one element with the css selector ".table-count" containing the text "13"

    Scenario: Detail page
        When I visit "/targets/ADNP-human/"
        And I should see an element with the css selector ".view-item.type-target"

        When I click the link to "http://www.uniprot.org/uniprot/Q9H2P0"
        Then the browser's URL should contain "www.uniprot.org"
        Then I should see "Q9H2P0 - ADNP_HUMAN"

        When I go back
        Then the browser's URL should contain "/targets/"
        And I should see an element with the css selector ".view-item.type-target"


@completion
Feature: fish tab-completion

  Background:
    Given my shell is fish

  Scenario: "pu" matches multiple commands including "pull-request"
    When I type "git pu" and press <Tab>
    Then the command should not expand
    When I press <Tab> again
    Then the completion menu should offer "pull push pull-request"

  Scenario: "ci-" expands to "ci-status"
    When I type "git ci-" and press <Tab>
    Then the command should expand to "git ci-status"

  Scenario: Offers pull-request flags
    When I type "git pull-request -" and press <Tab>
    When I press <Tab> again
    Then the completion menu should offer "-F -b -f -h -m -a -M -l -o --browse -p --help" unsorted

  Scenario: Browse to issues
    When I type "git browse -- i" and press <Tab>
    Then the command should expand to "git browse -- issues"

Allow the unsorted expansion for the fish shell

@completion
Feature: fish tab-completion

  Background:
    Given my shell is fish

  Scenario: "pu" matches multiple commands including "pull-request"
    When I type "git pu" and press <Tab>
    Then the command should not expand
    When I press <Tab> again
    Then the completion menu should offer "pull push pull-request" unsorted

  Scenario: "ci-" expands to "ci-status"
    When I type "git ci-" and press <Tab>
    Then the command should expand to "git ci-status"

  Scenario: Offers pull-request flags
    When I type "git pull-request -" and press <Tab>
    When I press <Tab> again
    Then the completion menu should offer "-F -b -f -h -m -a -M -l -o --browse -p --help" unsorted

  Scenario: Browse to issues
    When I type "git browse -- i" and press <Tab>
    Then the command should expand to "git browse -- issues"


#Author: dallas.fraser.waterloo@gmail.com
#Keywords Summary : Test the fields and rules

Feature: The fields and rules
    Background:
        Given I navigate to the "fieldsrules" page

    Scenario: Checking the two different pages
        When I click on "Rules" tab
        Then I see a paragraph containing "official MLSB Rules"
        When I click on "Fields" tab
        Then I see a paragraph containing "games take place"

Split out tests into two

#Author: dallas.fraser.waterloo@gmail.com
#Keywords Summary : Test the fields and rules

Feature: The fields and rules
    Background:
        Given I navigate to the "fieldsrules" page

    Scenario: Checking the rules tab
        When I click on "Rules" tab
        Then I see a paragraph containing "official MLSB Rules"

    Scenario: Check the fields tab
        When I click on "Fields" tab
        Then I see a paragraph containing "games take place"


Feature: Getting started

  To get started, just open a command prompt in an empty directory and run
  `cucumber`. You'll be prompted for what to do next.

  @spawn
  Scenario: Run Cucumber in an empty directory
    Given a directory without standard Cucumber project directory structure
    When I run `cucumber`
    Then it should fail with regexp:
      """
      No such file or directory.*Please create a features directory to get started.
      """

  Scenario: Accidentally run Cucumber in a folder with Ruby files in it.
    Given a directory without standard Cucumber project directory structure
    And a file named "should_not_load.rb" with:
      """
      puts 'this will not be shown'
      """
    When I run `cucumber`
    Then the exit status should be 1
    And the output should not contain:
      """
      this will not be shown

      """

Revert "Match less explicitly to avoid Ruby 2.1.0+ bug"

Feature: Getting started

  To get started, just open a command prompt in an empty directory and run
  `cucumber`. You'll be prompted for what to do next.

  @spawn
  Scenario: Run Cucumber in an empty directory
    Given a directory without standard Cucumber project directory structure
    When I run `cucumber`
    Then it should fail with:
      """
      No such file or directory - features. Please create a features directory to get started.
      """

  Scenario: Accidentally run Cucumber in a folder with Ruby files in it.
    Given a directory without standard Cucumber project directory structure
    And a file named "should_not_load.rb" with:
      """
      puts 'this will not be shown'
      """
    When I run `cucumber`
    Then the exit status should be 1
    And the output should not contain:
      """
      this will not be shown

      """


Feature: Upgrade Vim plugins
  As a lazy Vim user
  I want to upgrade Vim plugins
  without pain

  Background:
    Given a temporary directory called 'tmp'
    And a home directory called 'home' in '$tmp/home'
    And a repository 'foo' with versions '1.0.0 1.0.1 1.0.2'

  Scenario: Upgrade with lockfile
    Given flavorfile
      """
      flavor '$foo_uri'
      """
    And lockfile
      """
      $foo_uri (1.0.0)
      """
    When I run vim-flavor with 'upgrade'
    Then I get lockfile
      """
      $foo_uri (1.0.2)
      """
    And I get a bootstrap script in '$home'
    And I get flavor 'foo' with '1.0.2' in '$home'

Fix steps to verify vimfiles content

Feature: Upgrade Vim plugins
  As a lazy Vim user
  I want to upgrade Vim plugins
  without pain

  Background:
    Given a temporary directory called 'tmp'
    And a home directory called 'home' in '$tmp/home'
    And a repository 'foo' with versions '1.0.0 1.0.1 1.0.2'

  Scenario: Upgrade with lockfile
    Given flavorfile
      """
      flavor '$foo_uri'
      """
    And lockfile
      """
      $foo_uri (1.0.0)
      """
    When I run vim-flavor with 'upgrade'
    Then I get lockfile
      """
      $foo_uri (1.0.2)
      """
    And I get a bootstrap script in '$home/.vim'
    And I get flavor 'foo' with '1.0.2' in '$home/.vim'


@api @mailhog
Feature: notifications-content

  Background:
    Given user "Alice" has been created with default attributes and without skeleton files
    And using OCS API version "2"

  Scenario: Create notification
    When user "Alice" sets the email notification option to "always" using the API
    And user "Alice" is sent a notification with
      | app         | notificationsacceptancetesting                                            |
      | timestamp   | 144958517                                                                 |
      | subject     | Acceptance Testing                                                        |
      | link        | https://owncloud.org/blog/about-activities-and-notifications-in-owncloud/ |
      | message     | About Activities and Notifications in ownCloud                            |
      | object_type | blog                                                                      |
      | object_id   | 9483                                                                      |
    Then the email address "alice@example.org" should have received an email with the body containing
      """
      Hello,
      About Activities and Notifications in ownCloud

      See https://owncloud.org/blog/about-activities-and-notifications-in-owncloud/ on ownCloud for more information
      """
    And the email address "alice@example.org" should have received an email with the body containing
      """
      See https://owncloud.org/blog/about-activities-and-notifications-in-owncloud/ on ownCloud for more information
      """

Change mailhog test tag to email

@api @email
Feature: notifications-content

  Background:
    Given user "Alice" has been created with default attributes and without skeleton files
    And using OCS API version "2"

  Scenario: Create notification
    When user "Alice" sets the email notification option to "always" using the API
    And user "Alice" is sent a notification with
      | app         | notificationsacceptancetesting                                            |
      | timestamp   | 144958517                                                                 |
      | subject     | Acceptance Testing                                                        |
      | link        | https://owncloud.org/blog/about-activities-and-notifications-in-owncloud/ |
      | message     | About Activities and Notifications in ownCloud                            |
      | object_type | blog                                                                      |
      | object_id   | 9483                                                                      |
    Then the email address "alice@example.org" should have received an email with the body containing
      """
      Hello,
      About Activities and Notifications in ownCloud

      See https://owncloud.org/blog/about-activities-and-notifications-in-owncloud/ on ownCloud for more information
      """
    And the email address "alice@example.org" should have received an email with the body containing
      """
      See https://owncloud.org/blog/about-activities-and-notifications-in-owncloud/ on ownCloud for more information
      """


@javascript
Feature: All the Javascript specs run correctly

  Scenario: Running the datetime specs
    When I run the datetime javascript specs
    Then I should see all specs passing

  Scenario: Running the tasks specs
    When I run the tasks javascript specs
    Then I should see all specs passing

Comment javascript spec feature until we have a better way to test javascript

@javascript
Feature: All the Javascript specs run correctly

  Scenario: Running the datetime specs
    # When I run the datetime javascript specs
    # Then I should see all specs passing

  Scenario: Running the tasks specs
    # When I run the tasks javascript specs
    # Then I should see all specs passing


Feature: Manage comment custom fields

  Scenario: Comment meta CRUD
    Given a WP install

    When I run `wp comment-meta add 1 foo 'bar'`
    Then STDOUT should not be empty

    When I run `wp comment-meta get 1 foo`
    Then STDOUT should be:
      """
      bar
      """

    When I run `wp comment-meta set 1 foo '[ "1", "2" ]' --format=json`
    Then STDOUT should not be empty

    When I run `wp comment-meta get 1 foo --format=json`
    Then STDOUT should be:
      """
      ["1","2"]
      """

    When I run `wp comment-meta delete 1 foo`
    Then STDOUT should not be empty

    When I try `wp comment-meta get 1 foo`
    Then the return code should be 1

Test comment validation for comment meta

Feature: Manage comment custom fields

  Scenario: Comment meta CRUD
    Given a WP install

    When I run `wp comment-meta add 1 foo 'bar'`
    Then STDOUT should not be empty

    When I run `wp comment-meta get 1 foo`
    Then STDOUT should be:
      """
      bar
      """

    When I try `wp comment meta get 999999 foo`
    Then STDERR should be:
      """
      Error: Invalid comment ID.
      """

    When I run `wp comment-meta set 1 foo '[ "1", "2" ]' --format=json`
    Then STDOUT should not be empty

    When I run `wp comment-meta get 1 foo --format=json`
    Then STDOUT should be:
      """
      ["1","2"]
      """

    When I run `wp comment-meta delete 1 foo`
    Then STDOUT should not be empty

    When I try `wp comment-meta get 1 foo`
    Then the return code should be 1


Feature: Generate simple API specs

  Scenario: Single resource route
    Given a file named "foo.raml" with:
      """
      #%RAML 0.8
      ---
      title: e-BookMobile API
      baseUri: http://api.e-bookmobile.com/{version}
      version: v1

      /authors:
        get:
          description: Retrieve a list of authors
          responses:
            200:
              body:
                application/json:
                  example: |
                    {
                      "data": [
                        {
                          "id": 1,
                          "first_name": "Hermann",
                          "last_name": "Hesse"
                        },
                        {
                          "id": 2,
                          "first_name": "Charles",
                          "last_name": "Dickens"
                        }
                      ],
                      "success": true,
                      "status": 200
                    }
      """
    When I run `rambo foo.raml`
    Then the file "spec/contract/foo_spec.rb" should contain:
      """
      require "spec_helper"

      describe "e-BookMobile API" do
        include Rack::Test::Methods

        describe "/authors" do
          let(:route) { "/authors" }

          describe "GET" do
            let(:response_body) do
              {
                "data" => [
                  {
                    "id" => 1,
                    "first_name" => "Hermann",
                    "last_name" => "Hesse"
                  },
                  {
                    "id" => 2,
                    "first_name" => "Charles",
                    "last_name" => "Dickens"
                  }
                ],
                "success" => true,
                "status" => 200
              }.to_json
            end

            it "retrieve a list of authors" do
              get route
              expect(last_response.body).to eql response_body
            end

            it "returns status 200" do
              get route
              expect(last_response.status).to eql 200
            end
          end
        end
      end
      """

Make all the cukes green, bitchez!!!

Feature: Generate simple API specs

  Scenario: Single resource route
    Given a file named "foo.raml" like "basic_raml.raml"
    When I run `rambo foo.raml`
    Then the file "spec/contract/foo_spec.rb" should be like "simple_spec_file.rb.ex"


@mink:selenium2 @reset-schema @alice(Page) @alice(Redirection)
Feature: Create new redirection

  Background:
    Given I maximize the window
    When I am on "/fr"
    And I open the redirection menu
    And I wait 1 second

  Scenario: I can view the new error
    And the list "redirections-list-container" should contain 3 elements
    When I click the ".vic-btn-default" element
    And I wait 1 second
    And I fill in "seo_bundle_redirection[url]" with "http://test"
    And I select "url" from "seo_bundle_redirection[link][linkType]"
    And I wait 1 second
    Then I fill in "seo_bundle_redirection[link][url]" with "http://localhost:8000/app_ci.php/fr/"
    And I click the ".vic-btn-default" element
    # TODO : fix below lines, intercooler does not run correctly for this test
    # And I wait 1 second
    # Then I should see text matching "Redirection successfully created!"
    # And the list "redirections-list-container" should contain 4 elements

Fix “I can view the new error” scenario

@mink:selenium2 @reset-schema @alice(Page) @alice(Redirection)
Feature: Create new redirection

  Background:
    Given I maximize the window
    When I am on "/fr"
    And I open the redirection menu
    And I wait 1 second

  Scenario: I can view the new error
    And the list "redirections-list-container" should contain 3 elements
    Then I should not see "http://localhost:8000/app_ci.php/fr/"
    When I press the "New redirection" button
    And I wait 1 second
    And I fill in "seo_bundle_redirection[url]" with "http://test"
    And I select "url" from "seo_bundle_redirection[link][linkType]"
    And I wait 1 second
    Then I fill in "seo_bundle_redirection[link][url]" with "http://localhost:8000/app_ci.php/fr/"
    And I press the "Create" button
    And I wait 1 second
    Then I should see text matching "Redirection successfully created!"
    # TODO: there is 5 elements instead of 4 due to a bug with Javascript
    And the list "redirections-list-container" should contain 5 elements
    And I should see "http://localhost:8000/app_ci.php/fr/"


@docstrings
Feature: Handling scenarios with Doc Strings

  Similar to Tables, Doc Strings are a type of Multiline argument that can be
  used to show largers pieces of text or code in a scenario step.

  Previously Crudecumber would crash when DocStrings were used, but now they are
  handled well enough to be workable.

Scenario: Display and overwrite Doc Strings
  Given I have scenario that contains a Doc String like:
    """
    What are Doc Strings?
    =====================
    Doc Strings are handy for passing a larger piece of text to a step
    definition. The syntax is inspired from Python's Docstring syntax.

    The text should be offset by delimiters consisting of three double-quote
    marks on lines of their own.
    """
  When I run 'crudecumber'
  Then I should be able to step through this scenario manually

Add failing scenarios for handling Doc Strings

@docstrings
Feature: Handling scenarios with Doc Strings

  Similar to Tables, Doc Strings are a type of Multiline argument that can be
  used to show largers pieces of text or code in a scenario step.

  Previously Crudecumber would crash when DocStrings were used, but now they are
  handled well enough to be workable.

Scenario: Display and overwrite Doc Strings
  Given I have a scenario that contains a Doc String like:
    """
    What are Doc Strings?
    =====================
    Doc Strings are handy for passing a larger piece of text to a step
    definition. The syntax is inspired from Python's Docstring syntax.

    The text should be offset by delimiters consisting of three double-quote
    marks on lines of their own.
    """
  When I run 'crudecumber'
  Then I should be able to step through this scenario manually

Scenario: Skip Doc String step
  Given I have a scenario that contains a Doc String
  When I skip this step and it is marked as Pending by Crudecumber
  Then this should be skipped and the following should appear correctly:
    """ruby
    STDOUT.sync = true
    arguments = ARGV
    cmd = "cucumber #{arguments.join(' ')} -x -e features/step_definitions "\
          "-r #{steps} -r #{support_files} "\
          '-f Crudecumber::Formatter -f Crudecumber::Report '\
          '-o crudecumber_results.html'
    log cmd
    exit_code = system(cmd)
    """

Scenario: Mark Doc String step as Pending
  Given I have a scenario that contains a Doc String
  When I press 'S' to mark this Doc String step as Pending:
    """ruby
    STDOUT.sync = true
    arguments = ARGV
    cmd = "cucumber #{arguments.join(' ')} -x -e features/step_definitions "\
          "-r #{steps} -r #{support_files} "\
          '-f Crudecumber::Formatter -f Crudecumber::Report '\
          '-o crudecumber_results.html'
    log cmd
    exit_code = system(cmd)
    """
  Then this step should be shown as skipped and everything appear correctly

Scenario: Fail Doc String step
  Given I have a scenario that contains a Doc String
  When I fail the step containing this Doc String:
    """
    What are Doc Strings?
    =====================
    Doc Strings are handy for passing a larger piece of text to a step
    definition. The syntax is inspired from Python's Docstring syntax.

    The text should be offset by delimiters consisting of three double-quote
    marks on lines of their own.
    """
  Then this step should be shown as skipped and everything appear correctly


@US5503
Feature: cron job scheduler for bulk-extracts

Scenario: Configure bulk extract scheduler
  Given I configurate the bulk extract scheduler script
  And I clean up the cron extraction zone
  When I run the bulk extract scheduler script
  Then I am willing to wait up to 90 seconds for the bulk extract scheduler cron job to start and complete
  And I clean up the scheduler jobs

Comment out bulk extract scheduler test

@US5503
Feature: cron job scheduler for bulk-extracts

# TODO: Do something with this piece of junk that will not run in CI
#Scenario: Configure bulk extract scheduler
#  Given I configurate the bulk extract scheduler script
#  And I clean up the cron extraction zone
#  When I run the bulk extract scheduler script
#  Then I am willing to wait up to 90 seconds for the bulk extract scheduler cron job to start and complete
#  And I clean up the scheduler jobs


Feature: Detecting compiled files
  When a file is compiled but not git ignored, let the user know.

  Background:
    Given a file named "git_cleanser.yml" with:
      """
      ---
      compiled_files_command: echo "object.o"
      """
    And an empty file named "object.o"

  Scenario:
    Given a file named ".gitignore" with:
      """
      *.o
      """
    When I run `git_cleanser`
    Then its output for "generated_but_not_ignored" should not contain "object.o"

  Scenario:
    Given an empty file named ".gitignore"
    When I run `git_cleanser`
    Then its output for "generated_but_not_ignored" should contain "object.o"

Rework detecting compiled files feature to reduce scenario count

Feature: Detecting compiled files
  When a file is compiled but not git ignored, let the user know.

  Scenario:
    Given a file named "git_cleanser.yml" with:
      """
      ---
      compiled_files_command: echo ignored.o committed.o
      """
    And a file named ".gitignore" with:
      """
      ignored.o
      """
    And an empty file named "ignored.o"
    And an empty file named "committed.o"
    When I run `git_cleanser`
    Then its output for "generated_but_not_ignored" should contain "committed.o"
    Then its output for "generated_but_not_ignored" should not contain "ignored.o"


Feature: Attributes management for nodes
    I should be able to see, edit and delete node attributes

    @nodes
    @javascript
    Scenario: Set runlist for node "test-node-1"
      Given I am on homepage
      When I follow "Nodes"
      When I follow "test-node-1"
      When I drag "test-cookbook" into the run_list
      When I press "Save node"
      Then I should be on "/nodes/test-node-1"

    Scenario: Run chef-client to create attributes
      # Given I run chef-client
      When I reload the page
      Then the "#attributes-default span.attribute-name" element should contain "test-cookbook"

    @javascript
    Scenario: Open the attribute tree
      When I open the tree leaf "1" of the "default" panel
      Then the "test-cookbook[attribute1]" field should contain "value-attribute1"

Test for edit of default attribute and fix goutte tests... all attributes are js tests.

Feature: Attributes management for nodes
    I should be able to see, edit and delete node attributes

    @nodes
    @javascript
    Scenario: Set runlist for node "test-node-1"
      Given I am on homepage
      When I follow "Nodes"
      When I follow "test-node-1"
      When I drag "test-cookbook" into the run_list
      When I press "Save node"
      Then I should be on "/nodes/test-node-1"

    @javascript
    Scenario: Run chef-client to create attributes
      Given I run chef-client
      When I reload the page
      Then the "#attributes-default span.attribute-name" element should contain "test-cookbook"

    @javascript
    Scenario: Open the attribute tree
      When I open the tree leaf "1" of the "default" panel
      Then the "test-cookbook[attribute1]" field should contain "value-attribute1"

    @javascript
    Scenario: Edit "attribute1"
      When I fill in "test-cookbook[attribute1]" with "new attribute1 value"
      When I press "Save node"
      When I open the tree leaf "1" of the "normal" panel
      Then the "test-cookbook[attribute1]" field should contain "new attribute1 value"


Feature: Donating

  Scenario: New User
    Given A pitch exists
    And I view the current pitch page
    And I follow "Donate 20"
    And I follow "Make sure you register first!"
    And I fill in "Your First Name" with "My First Name"
    And I fill in "Your Last Name" with "My Last Name"
    And I fill in "Password" with "password"
    And I fill in "Confirm Password" with "password"
    And I fill in "Your E-mail Address" with "me@example.com"
    And I choose "Community Member"
    And I check "user_terms_of_service"
    And I press "Register"
    And I should see "Click the link in the email we just sent to you to finish creating your account!"
    When I activate my account with email "me@example.com"
    Then I should be on the edit myspot::donation_amounts page
    And I should see "20.00" inside a text field

Update cucumber test for David's text changes

Feature: Donating

  Scenario: New User
    Given A pitch exists
    And I view the current pitch page
    And I follow "Donate 20"
    And I follow "REGISTER HERE"
    And I fill in "Your First Name" with "My First Name"
    And I fill in "Your Last Name" with "My Last Name"
    And I fill in "Password" with "password"
    And I fill in "Confirm Password" with "password"
    And I fill in "Your E-mail Address" with "me@example.com"
    And I choose "Community Member"
    And I check "user_terms_of_service"
    And I press "Register"
    And I should see "Click the link in the email we just sent to you to finish creating your account!"
    When I activate my account with email "me@example.com"
    Then I should be on the edit myspot::donation_amounts page
    And I should see "20.00" inside a text field


Feature: Stack Analysis Backbone API

  Scenario: Check the Backbone API /api/v1/stack_aggregator response
    Given backbone service is running
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I post backbone_input.json to Backbone API api/v1/stack_aggregator
    Then I should get 200 status code
     And I should receive a valid stack_aggregator json response
     And I should find a valid stack_aggregator database entry

  Scenario: Check the Backbone API /api/v1/recommender response
    Given backbone service is running
    When I post backbone_input.json to Backbone API api/v1/recommender
    Then I should get 200 status code
     And I should receive a valid recommendation json response
     And I should find a valid recommendation database entry

Fix issue in API backbone test

Feature: Stack Analysis Backbone API

  Scenario: Check the Backbone API /api/v1/stack_aggregator response
    Given backbone service is running
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I post backbone_input.json to Backbone API api/v1/stack_aggregator
    Then I should get 200 status code
     And I should receive a valid stack_aggregator json response
     And I should find a valid stack_aggregator database entry

  Scenario: Check the Backbone API /api/v1/recommender response
    Given backbone service is running
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I post backbone_input.json to Backbone API api/v1/recommender
    Then I should get 200 status code
     And I should receive a valid recommendation json response
     And I should find a valid recommendation database entry


# encoding: UTF-8
# language: no

@wip
Egenskap: Reservering av bok
  Som låner
  For å få tak i en bestemt bok
  Ønsker jeg å reservere boka

Bakgrunn:
  Gitt at det finnes en låner
  Og at det finnes en bok

  @wip
  Scenario:
    Gitt at låner er pålogget som låner
    Og at låneren har funnet en bok
    Og at boka er tilgjengelig
  	Når låneren reserverer boka
    Så viser systemet at boka er reservert av låneren

Add scenario where reserved book is returned

# encoding: UTF-8
# language: no

@wip
Egenskap: Reservering av bok
  Som låner
  For å få tak i en bestemt bok
  Ønsker jeg å reservere boka

Bakgrunn:
  Gitt at det finnes en låner
  Og at det finnes en bok

  @wip
  Scenario:
    Gitt at låner er pålogget som låner
    Og at låneren har funnet en bok
    Og at boka er tilgjengelig
  	Når låneren reserverer boka
    Så viser systemet at boka er reservert av låneren

  @wip
  Scenario:
    Gitt at bok er reservert av låner
    Og at boka er utlånt
    Når boka registreres innlevert
    Så viser systemet at boka holdes av til låneren


# encoding: UTF-8
# language: no

@wip
Egenskap: Se verk
  Som bruker av bibliotekets nettsider
  Siden jeg er interessert et bestemt verk
  Ønsker se opplysninger om verket

  Bakgrunn:
    Gitt at jeg vet at det finnes en side for verket

  @wip
  Scenario: Se på verksopplysninger på verkssiden
    Når jeg er på sida til verket
    Så ser jeg på sida ser jeg informasjon som identifiserer verkets tittel, forfatter, utgivelsesår og en liste over eksemplarer i en menneskelesbar format

Add listing of items scenario and tidy text

# encoding: UTF-8
# language: no

@wip
Egenskap: Se verk
  Som bruker av bibliotekets nettsider
  Siden jeg er interessert et bestemt verk
  Ønsker se opplysninger om verket

  Bakgrunn:
    Gitt at jeg vet at det finnes en side for verket

  @wip
  Scenario: Se på verksopplysninger på verkssiden
    Når jeg er på sida til verket
    Så ser jeg informasjon som identifiserer verkets tittel, forfatter, utgivelsesår og en liste over eksemplarer i en menneskelesbar format

  @wip
  Scenario: Se på eksemplarer knyttet til verk
    Når jeg er på sida til verket
    Så ser jeg en liste over eksemplarer knyttet til verket


Feature: Sign up
  In order to get access to personal part of the site
  A user
  Should be able to sign up

  Background:
    Given we have branch "Sisyphus"

  Scenario: User sign up
    When I go to the sign up page
    And I fill in "Email" with "email@example.com"
    And I fill in "user_password" with "password"
    And I fill in "user_password_confirmation" with "password"
    And I press "Sign up"
    Then I should see "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
    And "email@example.com" should receive an email
    When I open the email
    Then I should see "Confirm my account" in the email body
    When I follow "Confirm my account" in the email
    And I should see "Your account was successfully confirmed. You are now signed in."
    And I should see "Welcome, email@example.com!"

Fix cucumber sign up feature

Feature: Sign up
  In order to get access to personal part of the site
  A user
  Should be able to sign up

  Background:
    Given we have branch "Sisyphus"

  Scenario: User sign up
    When I go to the sign up page
    And I fill in "Email" with "email@example.com"
    And I fill in "user_password" with "password"
    And I fill in "user_password_confirmation" with "password"
    And I press "Sign up"
    Then I should see "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
    And "email@example.com" should receive an email
    When I open the email
    Then I should see "Confirm my account" in the email body
    When I follow "Confirm my account" in the email
    And I should see "Your account was successfully confirmed."


@wip
Feature: Treating a peritonitis episode

  Background:
    Given Clyde is a clinician
    And Patty is a patient

  @web @javascript
  Scenario: A clinician treated a peritonitis episode
    When Clyde records a peritonitis episode for Patty
    And records the organism for the episode
    And records the medication for the episode
    Then a peritonitis episode is recorded for Patty

  @web @javascript
  Scenario: A clinician revised a peritonitis episode
    Given Patty is being treated for a peritonitis episode
    Then Clyde can revise the peritonitis episode

  @web @javascript
  Scenario: A clinician terminated an organism for a peritonitis episode
    Given Clyde recorded a peritonitis episode for Patty
    And recorded the organism for the episode
    Then Clyde can terminate the organism for the episode

Add scenario for terminating a medication associated with an episode

@wip
Feature: Treating a peritonitis episode

  Background:
    Given Clyde is a clinician
    And Patty is a patient

  @web @javascript
  Scenario: A clinician treated a peritonitis episode
    When Clyde records a peritonitis episode for Patty
    And records the organism for the episode
    And records the medication for the episode
    Then a peritonitis episode is recorded for Patty

  @web @javascript
  Scenario: A clinician revised a peritonitis episode
    Given Patty is being treated for a peritonitis episode
    Then Clyde can revise the peritonitis episode

  @web @javascript
  Scenario: A clinician terminated an organism for a peritonitis episode
    Given Clyde recorded a peritonitis episode for Patty
    And recorded the organism for the episode
    Then Clyde can terminate the organism for the episode

  @web @javascript
  Scenario: A clinician terminated a medication for a peritonitis episode
    Given Clyde recorded a peritonitis episode for Patty
    And recorded the medication for the episode
    Then Clyde can terminate the medication for the episode


Feature: web-system-app
 Scenario: Crosswalk IndexDB restart
  When launch "indexdb"
    And I fill in "txtName" with "123"
    And I fill in "txtEmail" with "Intel"
    And I click view "description=Add"
   Then I should see view "className=android.view.View^^^description=123"
   Then I should see view "className=android.view.View^^^description=Intel"
    And I fill in "txtID" with "123"
    And I click view "description=Delete"
   Then I should see view "className=android.view.View^^^description=No Record"
    And I click view "description=Add"
   Then I should see view "className=android.view.View^^^description=123"
   Then I should see view "className=android.view.View^^^description=Intel"
    And switch to "indexdb"
    And I wait 2 seconds
   Then I should see view "className=android.view.View^^^description=123"
   Then I should see view "className=android.view.View^^^description=Intel"

Improve bdd steps for webmanu-system-android-tests

Feature: web-system-app
 Scenario: Crosswalk IndexDB restart
  When launch "indexdb"
    And I fill in "txtName" with "123"
    And I fill in "txtEmail" with "Intel"
    And I click view "description=Add"
   Then I should see view "className=android.view.View^^^description=123"
   Then I should see view "className=android.view.View^^^description=Intel"
    And I fill in "txtID" with "123"
    And I click view "description=Delete"
   Then I should see view "className=android.view.View^^^description=No Record"
    And I click view "description=Add"
   Then I should see view "className=android.view.View^^^description=123"
   Then I should see view "className=android.view.View^^^description=Intel"
    And I press "home" hardware key
    And I press "recent" hardware key
    And I save relative view "className=android.widget.ImageView" on the "right" side of view "text=IndexDB" to object "indexdb_app"
    And I swipe saved object "indexdb_app" to "left"
    And I click app icon "text=IndexDB" in all apps
    And I wait 2 seconds
   Then I should see view "className=android.view.View^^^description=123"
   Then I should see view "className=android.view.View^^^description=Intel"


Feature: Donating

  Scenario: New User
    Given A pitch exists
    And I view the current pitch page
    And I follow "Donate 20"
    And I follow "REGISTER HERE"
    And I fill in "Your First Name" with "My First Name"
    And I fill in "Your Last Name" with "My Last Name"
    And I fill in "Password" with "password"
    And I fill in "Confirm Password" with "password"
    And I fill in "Your E-mail Address" with "me@example.com"
    And I choose "Community Member"
    And I check "user_terms_of_service"
    And I press "Register"
    And I should see "Click the link in the email we just sent to you to finish creating your account!"
    When I activate my account with email "me@example.com"
    Then I should be on the edit myspot::donation_amounts page
    And I should see "20.00" inside a text field

Remove cucumber test as it requires javascript testing, which isn't setup yet

Feature: Donating

  Scenario: New User Donating 20
    Given A pitch exists
    And I view the current pitch page
    And I follow "Donate 20"
    And I follow "New users: REGISTER HERE"
    And I fill in "Your First Name" with "My First Name"
    And I fill in "Your Last Name" with "My Last Name"
    And I fill in "Password" with "password"
    And I fill in "Confirm Password" with "password"
    And I fill in "Your E-mail Address" with "me@example.com"
    And I choose "Community Member"
    And I check "user_terms_of_service"
    And I press "Register"
    And I should see "Click the link in the email we just sent to you to finish creating your account!"
    When I activate my account with email "me@example.com"
    Then I should be on the edit myspot::donation_amounts page
    And I should see "20.00" inside a text field

# TODO: write this test in culerity if that ever is setup for this project
#  Scenario: New User Donating Variable Amount
#    Given A pitch exists
#    And I view the current pitch page
#    And I follow "Donate another amount"
#    And I follow "REGISTER HERE"
#    And I fill in "Your First Name" with "My First Name"
#    And I fill in "Your Last Name" with "My Last Name"
#    And I fill in "Password" with "password"
#    And I fill in "Confirm Password" with "password"
#    And I fill in "Your E-mail Address" with "me@example.com"
#    And I choose "Community Member"
#    And I check "user_terms_of_service"
#    And I press "Register"
#    And I should see "Click the link in the email we just sent to you to finish creating your account!"
#    When I activate my account with email "me@example.com"
#    Then I should be on the edit myspot::donation_amounts page
#    And I should see "200.00" inside a text field
#


Feature: Checks for the license analysis service

  @smoketest @production
  Scenario: Basic check if the license analysis service is running
    Given System is running
    When I access the license analysis service
    # TODO: this is actually a bug - needs to be resolved later in the service
    Then I should get 200 status code
     And I should receive JSON response with the status key set to ok
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I access the license analysis service with authorization token
    Then I should get 200 status code
     And I should receive JSON response with the status key set to ok

Set of smoketests for the license analysis service

Feature: Checks for the license analysis service

  @smoketest @production
  Scenario: Basic check if the license analysis service is running
    Given System is running
     When I access the license analysis service
     # TODO: this is actually a bug - needs to be resolved later in the service
     Then I should get 200 status code
      And I should receive JSON response with the status key set to ok
     When I acquire the authorization token
     Then I should get the proper authorization token
     When I access the license analysis service with authorization token
     Then I should get 200 status code
      And I should receive JSON response with the status key set to ok

  Scenario Outline: Smoketest if all JSON files with package+license info can be processes by license analysis
    Given System is running
     When I acquire the authorization token
     Then I should get the proper authorization token
     When I send the file <filename> to the license analysis service
     Then I should get 200 status code

     Examples: filenames
     |filename|
     |maven_five_different_packages.json|
     |maven_one_package.json|
     |maven_three_wildfly_packages.json|


Feature: As an bulk extract user, I want to be able to get the state public entities

Scenario: As an bulk extract user, I want to initialize my database with test data.
    Given I am using local data store
    And I am using preconfigured Ingestion Landing Zone for "Midgar-Daybreak"
    And I post "SEAFullDataset.zip" file as the payload of the ingestion job
    And all collections are empty
    When zip file is scp to ingestion landing zone
    And a batch job for file "SEAFullDataset.zip" is completed in database
    And a batch job log has been created
    Then I should see following map of entry counts in the corresponding collections:
      | collectionName                           |              count|
      | calendarDate                             |                821|
      | course                                   |                  6|
      | courseOffering                           |                  6|
      | educationOrganization                    |                  5|
      | gradingPeriod                            |                  6|
      | graduationPlan                           |                  5|
      | session                                  |                  4|

Use correct count for calendarDate

Feature: As an bulk extract user, I want to be able to get the state public entities

Scenario: As an bulk extract user, I want to initialize my database with test data.
    Given I am using local data store
    And I am using preconfigured Ingestion Landing Zone for "Midgar-Daybreak"
    And I post "SEAFullDataset.zip" file as the payload of the ingestion job
    And all collections are empty
    When zip file is scp to ingestion landing zone
    And a batch job for file "SEAFullDataset.zip" is completed in database
    And a batch job log has been created
    Then I should see following map of entry counts in the corresponding collections:
      | collectionName                           |              count|
      | calendarDate                             |                556|
      | course                                   |                  6|
      | courseOffering                           |                  6|
      | educationOrganization                    |                  5|
      | gradingPeriod                            |                  6|
      | graduationPlan                           |                  5|
      | session                                  |                  4|


Feature: Aruba Console

  Background:
    Given a mocked home directory

  Scenario: Start console
    Given I run `aruba console` interactively
    When I close the stdin stream
    Then the output should contain:
    """
    aruba:001:0>
    """

  Scenario: Show help
    Given I run `aruba console` interactively
    And I type "aruba_help"
    When I close the stdin stream
    Then the output should contain:
    """
    Version:
    """
    And the output should contain:
    """
    Issue Tracker:
    """
    And the output should contain:
    """
    Documentation:
    """

  Scenario: Show methods
    Given I run `aruba console` interactively
    And I type "aruba_methods"
    When I close the stdin stream
    Then the output should contain:
    """
    Methods:
    """
    And the output should contain:
    """
    * setup_aruba
    """

  Scenario: Has history
    Given I run `aruba console` interactively
    And I type "aruba_methods"
    And I type "exit"
    When I close the stdin stream
    Then the file "~/.aruba_history" should exist

Update scenario to pass on Ruby 2.7

Feature: Aruba Console

  Background:
    Given a mocked home directory

  Scenario: Start console
    Given I run `aruba console` interactively
    When I close the stdin stream
    Then the output should contain:
    """
    aruba:001:0>
    """

  Scenario: Show help
    Given I run `aruba console` interactively
    And I type "aruba_help"
    When I close the stdin stream
    Then the output should contain:
    """
    Version:
    """
    And the output should contain:
    """
    Issue Tracker:
    """
    And the output should contain:
    """
    Documentation:
    """

  Scenario: Show methods
    Given I run `aruba console` interactively
    And I type "aruba_methods"
    When I close the stdin stream
    Then the output should contain:
    """
    Methods:
    """
    And the output should contain:
    """
    * setup_aruba
    """

  Scenario: Has its own history file
    Given I run `aruba console` interactively
    And I type "IRB.conf[:HISTORY_FILE]"
    And I type "exit"
    When I close the stdin stream
    Then the output should contain:
    """
    ~/.aruba_history
    """


Feature: User can

As a user of the site
So that I provide my event details and start planning for my catering event
I should be able to submit a form with basic information about my event

Scenario:
	Given I am on the Event Inquiry page
	And I fill in "Event Type" with "Wedding"
	And I select "$10pp" from "Budget"
	And I press "Submit"
	Then I should be on the Customize Order page
	And I should see "Mac and Cheese"
	And I should not see "Steak"

Update event planning form cucumber story

Feature: User can

As a user of the site
So that I provide my event details and start planning for my catering event
I should be able to submit a form with basic information about my event

Scenario:
	Given I am on the New Event page
	And I fill in "Name" with "Wedding"
	And I select "10" from "Budget Per Person"
	And I press "Create Event"
	Then I should be on the Customize Order page


Feature: xhtml5
 Scenario: page switching
  When launch "html5-extra-app"
   And I go to "xhtml5/area_noref-manual.xhtml"
   And I click coords 60 and 60 of "src_img"
  Then The current URL should be "xhtml5/area_noref-manual.xhtml"
   And I click coords 10 and 10 of "src_img"
  Then The current URL should be "xhtml5/test-area.xhtml"

Add more waiting time for bdd steps in HTML5 Extra

Feature: xhtml5
 Scenario: page switching
  When launch "html5-extra-app"
   And I go to "xhtml5/area_noref-manual.xhtml"
   And I click coords 60 and 60 of "src_img"
   And I wait 2 seconds
  Then The current URL should be "xhtml5/area_noref-manual.xhtml"
   And I click coords 10 and 10 of "src_img"
   And I wait 2 seconds
  Then The current URL should be "xhtml5/test-area.xhtml"


@all_adapters
Feature: Publishing A Message
  Background:
    Given the following broker configuration:
    """ruby
    MessageDriver::Broker.define do |b|
      b.destination :my_queue, "my_queue"
    end
    """

  Scenario: Running within a with_message_transaction block
    When I execute the following code:
    """ruby
    publish(:my_queue, "Test Message")
    """

    Then I expect to find 1 message on :my_queue with:
      | body         |
      | Test Message |

Fix a typo in a feature description

@all_adapters
Feature: Publishing A Message
  Background:
    Given the following broker configuration:
    """ruby
    MessageDriver::Broker.define do |b|
      b.destination :my_queue, "my_queue"
    end
    """

  Scenario: Publishing a message
    When I execute the following code:
    """ruby
    publish(:my_queue, "Test Message")
    """

    Then I expect to find 1 message on :my_queue with:
      | body         |
      | Test Message |


Feature: flapjack-worker
  To be alerted to problems
  A user
  Needs checks executed
  On a regular schedule
  And the results of those checks
  Need to be reported

  Scenario: Start a worker
    Given beanstalkd is running
    When I background run "flapjack-worker"
    Then I should see "flapjack-worker" running
    Then I should see "Waiting for check" in the "flapjack-worker" output

  Scenario: Start a worker without beanstalk running
    Given beanstalkd is not running
    When I background run "flapjack-worker"
    Then I should see "flapjack-worker" running
    Then I should not see "Shutting down" in the "flapjack-worker" output

  Scenario: Beanstalk disappears while worker running
    Given beanstalkd is running
    When I background run "flapjack-worker"
    And beanstalkd is killed
    Then I should see "flapjack-worker" running
    Then I should not see "Shutting down" in the "flapjack-worker" output

Test that suitable debug text appears when the beanstalk disappears

Feature: flapjack-worker
  To be alerted to problems
  A user
  Needs checks executed
  On a regular schedule
  And the results of those checks
  Need to be reported

  Scenario: Start a worker
    Given beanstalkd is running
    When I background run "flapjack-worker"
    Then I should see "flapjack-worker" running
    Then I should see "Waiting for check" in the "flapjack-worker" output

  Scenario: Start a worker without beanstalk running
    Given beanstalkd is not running
    When I background run "flapjack-worker"
    Then I should see "flapjack-worker" running
    Then I should not see "Shutting down" in the "flapjack-worker" output

  Scenario: Beanstalk disappears while worker running
    Given beanstalkd is running
    When I background run "flapjack-worker"
    And beanstalkd is killed
    Then I should see "flapjack-worker" running
    Then I should not see "Shutting down" in the "flapjack-worker" output
    Then I should see "went away" in the "flapjack-worker" output


Feature: Generator spec

    RSpec spec are normally generated alongside other application components.
    For instance, `rails generate model` will also generate an RSpec spec file
    for the model but you can also use your own generator. See
    [customizing your workflow](https://guides.rubyonrails.org/generators.html#customizing-your-workflow)

    Scenario: Use custom generator without '--generator-specs' arg
        When I run `bundle exec rails generate generator my_generator`
        Then the features should pass
        Then the output should contain:
          """
                create  lib/generators/my_generator
                create  lib/generators/my_generator/my_generator_generator.rb
                create  lib/generators/my_generator/USAGE
                create  lib/generators/my_generator/templates
                invoke  rspec
          """

    Scenario: Use custom generator with '--generator-specs' arg
        When I run `bundle exec rails generate generator my_generator --generator-specs`
        Then the features should pass
        Then the output should contain:
          """
                create  lib/generators/my_generator
                create  lib/generators/my_generator/my_generator_generator.rb
                create  lib/generators/my_generator/USAGE
                create  lib/generators/my_generator/templates
                invoke  rspec
                create    spec/generator/my_generators_generator_spec.rb
          """

Rephrase few sentences of feature spec

Feature: Generator spec

    RSpec spec(s) can be generated when generating application components. For instance, `rails generate model` will also generate an RSpec spec file for the model but you can also write your own generator. See [customizing your workflow](https://guides.rubyonrails.org/generators.html#customizing-your-workflow)

    Scenario: Use custom generator without '--generator-specs' arg
        When I run `bundle exec rails generate generator my_generator`
        Then the features should pass
        Then the output should contain:
          """
                create  lib/generators/my_generator
                create  lib/generators/my_generator/my_generator_generator.rb
                create  lib/generators/my_generator/USAGE
                create  lib/generators/my_generator/templates
                invoke  rspec
          """

    Scenario: Use custom generator with '--generator-specs' arg
        When I run `bundle exec rails generate generator my_generator --generator-specs`
        Then the features should pass
        Then the output should contain:
          """
                create  lib/generators/my_generator
                create  lib/generators/my_generator/my_generator_generator.rb
                create  lib/generators/my_generator/USAGE
                create  lib/generators/my_generator/templates
                invoke  rspec
                create    spec/generator/my_generators_generator_spec.rb
          """


Feature: Developer has defined a supporting class and should not see a silent error
  As a Developer
  I want to see if my supporting class is properly defined
  So that I can better trace where my changes caused a fatal error

  @isolated
  Scenario: Spec attempts to run a class with an undeclared interface, outputs to stdout
    Given the spec file "spec/SomethingSpec.php" contains:
      """
      <?php
        namespace spec;

        use PhpSpec\ObjectBehavior;
        use Prophecy\Argument;

        class SomethingSpec extends ObjectBehavior
        {
            function it_is_initializable()
            {
                $this->shouldHaveType('Something');
            }
        }

        class ExampleClass implements NotDefinedInterface
        {
        }

      """
    And the class file "src/Something.php" contains:
      """
      <?php
      namespace spec;

      class Something
      {
          public function __construct($param)
          {
              if ($param == 'throw') {
                  throw new \Exception();
              }
          }
      }

      """
    When I run phpspec
    Then I should see "Fatal error happened while executing the following"

Add linebreak for PSR standards to feature


Feature: Email signup for documents

  Background:
    Given I am a GDS editor
    And email alert api exists
    And a list of publications exists

  Scenario: Signing up to unfiltered publications alerts
    When I visit the list of publications
    And I sign up for emails
    Then I should be signed up for the all publications mailing list

  Scenario: Signing up to filtered publications alerts
    When I filter the publications list by "Correspondence"
    And I sign up for emails
    Then I should be signed up to the correspondence publications mailing list

  Scenario: Signing up to unfiltered announcement alerts
    When I visit the list of announcements
    And I sign up for emails
    Then I should be signed up for the all announcements mailing list

  Scenario: Signing up to filtered announcement alerts
    When I filter the announcements list by "News stories"
    And I sign up for emails
    Then I should be signed up for the news stories mailing list

Update email sign up tests

Feature: Email signup for documents

  Background:
    Given I am a GDS editor
    And email alert api exists
    And a list of publications exists

  @not-quite-as-fake-search
  Scenario: Signing up to unfiltered publications alerts
    When I visit the list of publications
    And I sign up for emails
    Then I should be signed up for the all publications mailing list

  @not-quite-as-fake-search
  Scenario: Signing up to filtered publications alerts
    When I filter the publications list by "Correspondence"
    And I sign up for emails
    Then I should be signed up to the correspondence publications mailing list

  Scenario: Signing up to unfiltered announcement alerts
    When I visit the list of announcements
    And I sign up for emails
    Then I should be signed up for the all announcements mailing list

  Scenario: Signing up to filtered announcement alerts
    When I filter the announcements list by "News stories"
    And I sign up for emails
    Then I should be signed up for the news stories mailing list


@routing @car @names
Feature: Car - Street names in instructions

    Background:
        Given the profile "car"

    Scenario: Car - A named street
        Given the node map
            | a | b |
            |   | c |

        And the ways
            | nodes | name     |
            | ab    | My Way   |
            | bc    | Your Way |

        When I route I should get
            | from | to | route           |
            | a    | c  | My Way,Your Way |

    @todo
    Scenario: Car - Use way type to describe unnamed ways
        Given the node map
            | a | b | c | d |

        And the ways
            | nodes | highway     | name |
            | ab    | tertiary    |      |
            | bcd   | residential |      |

        When I route I should get
            | from | to | route                |
            | a    | c  | tertiary,residential |

Add test to check new way naming convention

@routing @car @names
Feature: Car - Street names in instructions

    Background:
        Given the profile "car"

    Scenario: Car - A named street
        Given the node map
            | a | b |
            |   | c |

        And the ways
            | nodes | name     | ref |
            | ab    | My Way   |     |
            | bc    | Your Way | A1  |

        When I route I should get
            | from | to | route                |
            | a    | c  | My Way,Your Way (A1) |

    @todo
    Scenario: Car - Use way type to describe unnamed ways
        Given the node map
            | a | b | c | d |

        And the ways
            | nodes | highway     | name |
            | ab    | tertiary    |      |
            | bcd   | residential |      |

        When I route I should get
            | from | to | route                |
            | a    | c  | tertiary,residential |


Feature: Stack analysis v2 API

  Scenario: Check that the API entry point
    Given System is running
    When I access /api/stack-analyses-v2
    Then I should get 404 status code

  Scenario: Check that the API entry point accepts manifest
    Given System is running
    When I wait 20 seconds
    When I send Python package manifest requirements.txt to stack analysis version 2
    Then I should get 200 status code

  Scenario: Check that the stack analysis response
    Given System is running
    When I send Python package manifest requirements.txt to stack analysis version 2
    Then I should get 200 status code
    Then I should receive JSON response containing the status key
    Then I should receive JSON response containing the id key
    Then I should receive JSON response containing the submitted_at key
    Then I should receive JSON response with the status key set to success
    Then I should receive JSON response with the correct id
    Then I should receive JSON response with the correct timestamp in attribute submitted_at

Use the new test step

Feature: Stack analysis v2 API

  Scenario: Check that the API entry point
    Given System is running
    When I access /api/stack-analyses-v2
    Then I should get 404 status code

  Scenario: Check that the API entry point accepts manifest
    Given System is running
    When I wait 20 seconds
    When I send Python package manifest requirements.txt to stack analysis version 2
    Then I should get 200 status code

  Scenario: Check that the stack analysis response
    Given System is running
    When I send Python package manifest requirements.txt to stack analysis version 2
    Then I should get 200 status code
    Then I should receive JSON response containing the status key
    Then I should receive JSON response containing the id key
    Then I should receive JSON response containing the submitted_at key
    Then I should receive JSON response with the status key set to success
    Then I should receive JSON response with the correct id
    Then I should receive JSON response with the correct timestamp in attribute submitted_at

  Scenario: Check if the stack analysis is finished
    Given System is running
    When I send Python package manifest requirements.txt to stack analysis version 2
    Then I should get 200 status code
    When I wait for stack analysis version 2 to finish
    Then I should get 200 status code


Feature: NuBit change is not reported as a transaction

  Scenario: Sending NuBits generates a single transaction
    Given a network with nodes "Alice", "Bob" and "Custodian" able to mint
    When node "Custodian" generates a "NuBit" address "cust"
    And node "Alice" votes an amount of "1,000,000" for custodian "cust"
    And node "Alice" finds blocks until custodian "cust" is elected
    And node "Bob" generates a "NuBit" address "bob"
    And all nodes reach the same height
    And some time pass
    And node "Custodian" sends "1000" NuBits to "bob"
    Then node "Custodian" should have 2 NuBit transactions
    And the 2nd transaction sould be a send of "1000" to "bob"
    And node "Bob" should reach an unconfirmed balance of "1000" NuBits
    And node "Bob" should have 1 NuBit transactions
    And the 1st transaction sould be a receive of "1000" to "bob"

Check sending nubits get confirmed

Feature: NuBit change is not reported as a transaction

  Scenario: Sending NuBits generates a single transaction
    Given a network with nodes "Alice", "Bob" and "Custodian" able to mint
    When node "Custodian" generates a "NuBit" address "cust"
    And node "Alice" votes an amount of "1,000,000" for custodian "cust"
    And node "Alice" finds blocks until custodian "cust" is elected
    And node "Bob" generates a "NuBit" address "bob"
    And all nodes reach the same height
    And some time pass
    And node "Custodian" sends "1000" NuBits to "bob"
    Then node "Custodian" should have 2 NuBit transactions
    And the 2nd transaction sould be a send of "1000" to "bob"
    And node "Custodian" should have a balance of "998,999.99" NuBits
    And node "Bob" should reach an unconfirmed balance of "1000" NuBits
    And node "Bob" should have 1 NuBit transactions
    And the 1st transaction sould be a receive of "1000" to "bob"
    And all nodes should have 1 transaction in memory pool

    When node "Alice" finds a block
    And all nodes reach the same height
    Then node "Custodian" should have a balance of "998,999.99" NuBits
    And node "Bob" should have a balance of "1000" NuBits


Feature: Caching of annotation information
  In order to increase the performance of the system and allow opcode caching
  As a systems administrator
  I want to be able cache the resource class metadata on my production server

  Scenario: Load a resource and execute a method via preloaded resource metadata
    Given the request URI of "/cache"
    And I set the request option "resources" to:
      """
      {
        "Cache": {
          "uri": "|^/cache$|",
          "method": {
            "method1": {
              "method": "GET"
            }
          }
        }
      }
      """
    When I create a request object
    And a the class definition:
      """
      class Cache extends Tonic\Resource {
        function method1() {
          return 'cache';
        }
      }
      """
    And load the resource
    And execute the resource
    Then the loaded resource should have a class of "Cache"
    And response should be "cache"

Fix cache test after renaming resource metadata "method" to "methods" to make it clearer that it contains the metadata of the resources methods

Feature: Caching of annotation information
  In order to increase the performance of the system and allow opcode caching
  As a systems administrator
  I want to be able cache the resource class metadata on my production server

  Scenario: Load a resource and execute a method via preloaded resource metadata
    Given the request URI of "/cache"
    And I set the request option "resources" to:
      """
      {
        "Cache": {
          "uri": "|^/cache$|",
          "methods": {
            "method1": {
              "method": "GET"
            }
          }
        }
      }
      """
    When I create a request object
    And a the class definition:
      """
      class Cache extends Tonic\Resource {
        function method1() {
          return 'cache';
        }
      }
      """
    And load the resource
    And execute the resource
    Then the loaded resource should have a class of "Cache"
    And response should be "cache"


Feature: Creating a new genomer project
  In order to build a genome
  A user can create a new genomer project
  So that they can use the genomer commands and organise their data

  Scenario: Creating a new project
    When I run the genomer command with the arguments "init project"
    Then the exit status should be 0
    And a directory named "project" should exist
    And a directory named "project/assembly" should exist

  Scenario: Creating a new project where the directory already exists
    Given a directory named "project"
    When I run the genomer command with the arguments "init project"
    Then the exit status should be 1
    And the stderr should contain:
    """
    Error. Directory 'project' already exists.
    """

Add features for assembly files

Feature: Creating a new genomer project
  In order to build a genome
  A user can create a new genomer project
  So that they can use the genomer commands and organise their data

  Scenario: Creating a new project
    When I run the genomer command with the arguments "init project"
    Then the exit status should be 0
    And a directory named "project" should exist
    And a directory named "project/assembly" should exist
    And a file named "project/assembly/scaffold.yml" should exist
    And a file named "project/assembly/sequence.fna" should exist
    And a file named "project/assembly/annotations.gff" should exist

  Scenario: Creating a new project where the directory already exists
    Given a directory named "project"
    When I run the genomer command with the arguments "init project"
    Then the exit status should be 1
    And the stderr should contain:
    """
    Error. Directory 'project' already exists.
    """


Feature: Teacher can see project specific links

  As a teacher
  I should see project specific links
  In order to access custom information per project

  Background:
  Given The default settings and jnlp resources exist using factories
    And the database has been seeded
    And the default project links exist using factories
    And I am logged in with the username teacher

  @javascript
  Scenario: Teacher not in project visits homepage
    When I am on getting started page
    Then I should not see a project link labeled "Foo Project Link"
      And I should not see a project link labeled "Bar Project Link"

  Scenario: Teacher in project visits homepage
    Given the "teacher" user is added to the default project
    When I am on getting started page
    Then I should see a project link labeled "Foo Project Link" linking to "http://foo.com"
      And I should see a project link labeled "Bar Project Link" linking to "http://bar.com"

Make navigation feature require javascript.

Feature: Teacher can see project specific links

  As a teacher
  I should see project specific links
  In order to access custom information per project

  Background:
  Given The default settings and jnlp resources exist using factories
    And the database has been seeded
    And the default project links exist using factories
    And I am logged in with the username teacher

  @javascript
  Scenario: Teacher not in project visits homepage
    When I am on getting started page
    Then I should not see a project link labeled "Foo Project Link"
      And I should not see a project link labeled "Bar Project Link"

  @javascript
  Scenario: Teacher in project visits homepage
    Given the "teacher" user is added to the default project
    When I am on getting started page
    Then I should see a project link labeled "Foo Project Link" linking to "http://foo.com/"
      And I should see a project link labeled "Bar Project Link" linking to "http://bar.com/"


@companies-omis-collection @collection
Feature: View collection of orders for a company

  @companies-omis-collection--view
  Scenario: View companies OMIS collection
    When I navigate to the `companies.orders` page using `company` `Lambda plc` fixture
    And the results summary for a order collection is present

  @companies-omis-collection--view--da
  Scenario: View companies OMIS collection as DA
    When I navigate to the `companies.orders` page using `company` `Lambda plc` fixture
    And the results summary for a order collection is present

  @companies-omis-collection--filter # TODO

  @companies-omis-collection--sort # TODO

  @companies-omis-collection--lep @lep
  Scenario: Navigate to OMIS as LEP
    When I navigate to the `companies.orders` page using `company` `Lambda plc` fixture
    Then I see the 403 error page

Remove migrated tests from feature file to cypress

@companies-omis-collection @collection
Feature: View collection of orders for a company

  @companies-omis-collection--view--da
  Scenario: View companies OMIS collection as DA
    When I navigate to the `companies.orders` page using `company` `Lambda plc` fixture
    And the results summary for a order collection is present

  @companies-omis-collection--lep @lep
  Scenario: Navigate to OMIS as LEP
    When I navigate to the `companies.orders` page using `company` `Lambda plc` fixture
    Then I see the 403 error page


# Copyright (c) 2016 SUSE LLC
# Licensed under the terms of the MIT license.

Feature: Test the remote commands via salt for redhat minion
  In Order to test the remote commands via salt
  As an authorized user
  I want to verify that the remote commands function works for centos minion

  Scenario: Run a remote command on centos
    Given I am authorized as "testing" with password "testing"
    And I follow "Salt"
    And I follow "Remote Commands"
    And I should see a "Remote Commands" text
    Then I enter command "cat /etc/os-release"
    And I click on preview
    Then I should see "ceos-minion" hostname
    And I click on run
    Then I wait for "3" seconds
    And I expand the results for "ceos-minion"
    And I should see a "rhel fedora" text
    Then I should see a "REDHAT_SUPPORT_PRODUCT" text

Increase timeout for avoiding racing condition

# Copyright (c) 2016 SUSE LLC
# Licensed under the terms of the MIT license.

Feature: Test the remote commands via salt for redhat minion
  In Order to test the remote commands via salt
  As an authorized user
  I want to verify that the remote commands function works for centos minion

  Scenario: Run a remote command on centos
    Given I am authorized as "testing" with password "testing"
    And I follow "Salt"
    And I follow "Remote Commands"
    And I should see a "Remote Commands" text
    Then I enter command "cat /etc/os-release"
    And I click on preview
    Then I wait for "5" seconds
    And I click on run
    Then I should see "ceos-minion" hostname
    Then I wait for "15" seconds
    And I expand the results for "ceos-minion"
    And I should see a "rhel fedora" text
    Then I should see a "REDHAT_SUPPORT_PRODUCT" text


Feature: Update bundle with approximate versions
  As a developer
  In order to avoid updating fixed versions very often
  I want to have approximate versions

  Background: A project with approximate dependency versions
    Given a Gemfile specifying:
      """
      gem 'foo', '~> 1.0.0'
      """
    And a gem named "foo" at version 1.0.0
    When I run `bundle install`
    Then the output should contain:
      """
      Using foo 1.0.0
      """
    When I run `git init`
    And I run `git add .`
    And I run `git ci -am 'Initial'`

  Scenario: Updating to a version that matches the current spec
    Given a gem named "foo" at version 1.0.1
    When I run `keep_up --test-command true`
    Then the output should contain:
      """
      Updating foo to 1.0.1
      """
    And the file "Gemfile" should contain:
      """
      path 'libs'

      gem 'foo', '~> 1.0.0'
      """
    And the file "Gemfile.lock" should contain:
      """
      foo (1.0.1)
      """

  Scenario: Updating to a version that exceeds the current spec
    Given a gem named "foo" at version 1.1.2
    When I run `keep_up --test-command true`
    Then the output should contain:
      """
      Updating foo to 1.1.2
      """
    And the file "Gemfile" should contain:
      """
      path 'libs'

      gem 'foo', '~> 1.1.2'
      """
    And the file "Gemfile.lock" should contain:
      """
      foo (1.1.2)
      """

Simplify scenario setup using custom step, again

Feature: Update bundle with approximate versions
  As a developer
  In order to avoid updating fixed versions very often
  I want to have approximate versions

  Background: A project with approximate dependency versions
    Given a Gemfile specifying:
      """
      gem 'foo', '~> 1.0.0'
      """
    And a gem named "foo" at version 1.0.0
    And the initial bundle install committed

  Scenario: Updating to a version that matches the current spec
    Given a gem named "foo" at version 1.0.1
    When I run `keep_up --test-command true`
    Then the output should contain:
      """
      Updating foo to 1.0.1
      """
    And the file "Gemfile" should contain:
      """
      path 'libs'

      gem 'foo', '~> 1.0.0'
      """
    And the file "Gemfile.lock" should contain:
      """
      foo (1.0.1)
      """

  Scenario: Updating to a version that exceeds the current spec
    Given a gem named "foo" at version 1.1.2
    When I run `keep_up --test-command true`
    Then the output should contain:
      """
      Updating foo to 1.1.2
      """
    And the file "Gemfile" should contain:
      """
      path 'libs'

      gem 'foo', '~> 1.1.2'
      """
    And the file "Gemfile.lock" should contain:
      """
      foo (1.1.2)
      """


Feature: SMPTE-related attribute constraints
  Scenario: Valid SMPTE head attributes
    Given an xml file <xml_file>
    And it has frameRate <frame_rate>
    And it has timeBase <time_base>
    Then document is valid

    Examples:
    | xml_file   | frame_rate | time_base |
    | smpte.xml  | 25         | smpte     |
    | smpte.xml  | 20         | smpte     |

  # These tests are not all passing because the missing semantic validation piece
  @skip
  Scenario: Invalid SMPTE head attributes
    Given an xml file <xml_file>
    And it has frameRate <frame_rate>
    And it has timeBase <time_base>
    Then document is invalid

    Examples:
    | xml_file   | frame_rate | time_base |
    | smpte.xml  |            | smpte     |
    | smpte.xml  | 25         | clock     |

Fix small typo in comment

Feature: SMPTE-related attribute constraints
  Scenario: Valid SMPTE head attributes
    Given an xml file <xml_file>
    And it has frameRate <frame_rate>
    And it has timeBase <time_base>
    Then document is valid

    Examples:
    | xml_file   | frame_rate | time_base |
    | smpte.xml  | 25         | smpte     |
    | smpte.xml  | 20         | smpte     |

  # These tests are not all passing because of the missing semantic validation piece
  @skip
  Scenario: Invalid SMPTE head attributes
    Given an xml file <xml_file>
    And it has frameRate <frame_rate>
    And it has timeBase <time_base>
    Then document is invalid

    Examples:
    | xml_file   | frame_rate | time_base |
    | smpte.xml  |            | smpte     |
    | smpte.xml  | 25         | clock     |


@javascript
Feature: Manage Posts
  As a User
  I want to be able to manage Posts (CRUD)

  Background:
    Given the Test User exists
      And I have a Test Post
      And I am signed in as Test User
#      And I am on the posts page

  Scenario: New Post
    Given I am on the New Post page
    When I write a Post
    Then I should see my New Post

  Scenario: Edit Post
    Given I am on the Edit Post page
    When I edit the Test Post
    Then I should see the Test Post changed

  Scenario: Delete Posts
    When I delete the Test Post
    Then I should not see the Test Post

  Scenario: Navigate to New Post
    When I navigate to New Post
    Then I should see the New Post page

  Scenario: Navigate to Edit Post
    When I navigate to Edit Post
    Then I should see the Edit Post page

Remove commented step in Manage Posts cucumber

@javascript
Feature: Manage Posts
  As a User
  I want to be able to manage Posts (CRUD)

  Background:
    Given the Test User exists
      And I have a Test Post
      And I am signed in as Test User

  Scenario: New Post
    Given I am on the New Post page
    When I write a Post
    Then I should see my New Post

  Scenario: Edit Post
    Given I am on the Edit Post page
    When I edit the Test Post
    Then I should see the Test Post changed

  Scenario: Delete Posts
    When I delete the Test Post
    Then I should not see the Test Post

  Scenario: Navigate to New Post
    When I navigate to New Post
    Then I should see the New Post page

  Scenario: Navigate to Edit Post
    When I navigate to Edit Post
    Then I should see the Edit Post page


Feature: Landing on squares
  As a user
  I should see outcomes when landing on squares

  Background:
    Given I have a user
    And there is another user
    And I am in a game

  Scenario: Landing on Income Tax
    Given It is my turn
    When I land on Income Tax
    # This only tests the -$200, not the -15%
    And I should lose $200

  Scenario: Landing on Super Tax
    Given It is my turn
    When I land on Super Tax
    Then I should lose $100

  Scenario: Passing Go
    Given It is my turn
    When I pass Go
    Then I should gain go money

  Scenario: Landing on Go
    Given It is my turn
    When I land on Go
    Then I should gain go money

Fix language in a cuke feature

Feature: Landing on squares
  As a user
  I should see outcomes when landing on squares

  Background:
    Given I have a user
    And there is another user
    And I am in a game

  Scenario: Landing on Income Tax
    Given It is my turn
    When I land on Income Tax
    # This only tests the -$200, not the -15%
    Then I should lose $200

  Scenario: Landing on Super Tax
    Given It is my turn
    When I land on Super Tax
    Then I should lose $100

  Scenario: Passing Go
    Given It is my turn
    When I pass Go
    Then I should gain go money

  Scenario: Landing on Go
    Given It is my turn
    When I land on Go
    Then I should gain go money


Feature: Test Case Starting Event

  This event is fired just before each scenario or scenario outline example row
  (generally named a Test Case) starts to be executed. This event is read-only.

  See [the API documentation](http://www.rubydoc.info/github/cucumber/cucumber-ruby/Cucumber/Events/TestCaseStarting) for more information about the data available on this event and the result object.

  Background:
    Given the standard step definitions
    And a file named "features/test.feature" with:
      """
      Feature: A feature

        Scenario: A passing scenario
          Given this is a step
      """
    And a file named "features/support/events.rb" with:
      """
      stdout = nil
      AfterConfiguration do |config|
        stdout = config.out_stream # make sure all the `puts` calls can write to the same output
        config.on_event :test_case_starting do |event|
          stdout.puts "before"
        end
        config.on_event :test_case_finished do |event|
          stdout.puts "after"
        end
      end

      Given(/this is a step/) do
      end

      """

  Scenario: Run the test case
    When I run `cucumber -q`
    Then it should pass with:
      """
      before
      Feature: A feature

        Scenario: A passing scenario
          Given this is a step
      after
      """

Test that tags are available in the before_test_case event

@wip
Feature: Test Case Starting Event

  This event is fired just before each scenario or scenario outline example row
  (generally named a Test Case) starts to be executed. This event is read-only.

  See [the API documentation](http://www.rubydoc.info/github/cucumber/cucumber-ruby/Cucumber/Events/TestCaseStarting) for more information about the data available on this event and the result object.

  Background:
    Given the standard step definitions
    And a file named "features/test.feature" with:
      """
      @feature
      Feature: A feature

        @scenario
        Scenario: A passing scenario
          Given this is a step
      """
    And a file named "features/support/events.rb" with:
      """
      stdout = nil
      AfterConfiguration do |config|
        stdout = config.out_stream # make sure all the `puts` calls can write to the same output
        config.on_event :test_case_starting do |event|
          stdout.puts "before"
          stdout.puts event.test_case.tags.map(&:name)
        end
        config.on_event :test_case_finished do |event|
          stdout.puts "after"
        end
      end

      Given(/this is a step/) do
      end

      """

  Scenario: Run the test case
    When I run `cucumber -q`
    Then it should pass with:
      """
      before
      @feature
      @scenario
      @feature
      Feature: A feature

        @scenario
        Scenario: A passing scenario
          Given this is a step
      after
      """


Feature: Modify spec helper
  Background:
    Given a file named "foo.raml" like "basic_raml.raml"

  Scenario: JSON and rack/test are required
    Given a spec_helper.rb file that requires both JSON and rack/test
    When I run `rambo foo.raml`
    Then the file "spec/spec_helper.rb" should be like "good_spec_helper.rb.ex"

  Scenario: Only JSON is required
    Given a spec_helper.rb file that requires JSON but not rack/test
    When I run `rambo foo.raml`
    Then the file "spec/spec_helper.rb" should be like "spec_helper_rack_test_added.rb.ex"

  Scenario: Only rack/test is required
    Given a spec_helper.rb file that requires rack/test but not JSON
    When I run `rambo foo.raml`
    Then the file "spec/spec_helper.rb" should be like "spec_helper_json_added.rb.ex"

Add whitespace to make consistent w/other feature files