Feature: General requests and answers from superNET API
    Get peers
    Ping/Pong
    SendMessage/ReceiveMessage

  @general @peers @general-001
  Scenario: As a superNET user I want to see peers on my network
    Given superNET is running on the computer
    Then I receive a list of peers with at least two peers

  @general @ping @general-002
  Scenario: As a superNET user I want to make a ping and receive an answer from a random node
    Given superNET is running on the computer with some peers
    When I send a ping request to one random peer
    Then I receive a pong answer

  @general @ping @general-003
  Scenario: As a superNET user I want to make a ping and receive an answer from a known host
    Given superNET is running on the computer with some peers
    When I send a ping request to "209.126.70.170" peer
    Then I receive a pong answer

  @general @send_message @general-004
  Scenario: As a superNET user I want to make a ping and receive an answer
    Given superNET is running on the computer with some peers
    When I send a message to myself with content "Cucumber SuperNET test"
    Then I receive a message to myself with content "Cucumber SuperNET test" in less than 50 seconds

Fix incorrect test scenario description

Feature: General requests and answers from superNET API
    Get peers
    Ping/Pong
    SendMessage/ReceiveMessage

  @general @peers @general-001
  Scenario: As a superNET user I want to see peers on my network
    Given superNET is running on the computer
    Then I receive a list of peers with at least two peers

  @general @ping @general-002
  Scenario: As a superNET user I want to make a ping and receive an answer from a random node
    Given superNET is running on the computer with some peers
    When I send a ping request to one random peer
    Then I receive a pong answer

  @general @ping @general-003
  Scenario: As a superNET user I want to make a ping and receive an answer from a known host
    Given superNET is running on the computer with some peers
    When I send a ping request to "209.126.70.170" peer
    Then I receive a pong answer

  @general @send_message @general-004
  Scenario: As a superNET user I want to send a message to myself and receive it
    Given superNET is running on the computer with some peers
    When I send a message to myself with content "Cucumber SuperNET test"
    Then I receive a message to myself with content "Cucumber SuperNET test" in less than 50 seconds


Feature: Authentication

  Background:
    Given I have the following signals
    """
"signal_1": "1"
"signal_2": "2"
"signal_3": "3"
"signal_4": "4"
    """

  Scenario: Require authorisation to read
    Given I send and accept JSON
    When I send a GET request to "signals.json"
    And I do not authenticate
    Then the response status should be "401"

  Scenario: Require authorisation to read
    Given I send and accept JSON
    And I authenticate as the user "thomas" with the password "tank_engine"
    When I send a GET request to "signals.json"
    Then the response status should be "200"

  Scenario: Require authorisation for crowding data
    Given I send and accept HTML
    When I send a GET request to "stations"
    And I do not authenticate
    Then the response status should be "401"

Adjust cukes for New Openness

Feature: Authentication

  Background:
    Given I have the following signals
    """
"signal_1": "1"
"signal_2": "2"
"signal_3": "3"
"signal_4": "4"
    """

  Scenario: Require authorisation for /signals
    Given I send and accept JSON
    When I send a GET request to "signals.json"
    And I do not authenticate
    Then the response status should be "401"

  Scenario: Require authorisation for /signals
    Given I send and accept JSON
    And I authenticate as the user "thomas" with the password "tank_engine"
    When I send a GET request to "signals.json"
    Then the response status should be "200"

  Scenario: Do not require authorisation for crowding data
    Given I send and accept HTML
    When I send a GET request to "stations"
    And I do not authenticate
    Then the response status should be "200"


Feature: MAIB report viewing
  As a specialist member of the public
  I want to be able to view MAIB reports
  So that I can find out about air accidents

Scenario: Viewing a published update
  Given a published MAIB report exists
  When I visit the document page
  Then I see the content of the MAIB report

Fix typo in MAIB feature

Feature: MAIB report viewing
  As a specialist member of the public
  I want to be able to view MAIB reports
  So that I can find out about marine accidents

Scenario: Viewing a published update
  Given a published MAIB report exists
  When I visit the document page
  Then I see the content of the MAIB report


Feature: Verify PDF content on run
    As a user, I need to check the PDF content on the run
    So that I

    Scenario: Verify textural content
        Given the pdf file "demo_file.pdf" is sent to be analysed
        Then I read "This is a demo PDF file", at [left, top] ["118", "65"] on page "1" in pdf
        And I check font of the text at [left, top] ["118", "65"] on page "1" in pdf, is "LiberationSerif, 15.41"
        And I read "Text at the top of the second page.", at [left, top] ["147", "65"] on page "2" in pdf
        And I see the image "apple.jpeg", at [left, top] ["300", "250"] on page "1" in pdf
        # Metadata
        # signed
        # Author

Add extra to be tested

Feature: Verify PDF content on run
    As a user, I need to check the PDF content on the run
    So that I

    Scenario: Verify textural content
        Given the pdf file "demo_file.pdf" is sent to be analysed
        Then I read "This is a demo PDF file", at [left, top] ["118", "65"] on page "1" in pdf
        And I check font of the text at [left, top] ["118", "65"] on page "1" in pdf, is "LiberationSerif, 15.41"
        And I read "Text at the top of the second page.", at [left, top] ["147", "65"] on page "2" in pdf
        And I see the image "apple.jpeg", at [left, top] ["300", "250"] on page "1" in pdf
        # Metadata
        # signed
        # Author
        #try different font size


@product
Feature: Deleting a product variant
    In order to remove test or incorrect product variants
    As an Administrator
    I want to be able to delete product variant from the registry

    Background:
        Given the store operates on a single channel in "France"
        And the store ships everywhere for free
        And the store allows paying with "Cash on Delivery"
        And the store has a product "PHP Mug"
        And the product "PHP Mug" has "Medium PHP Mug" variant priced at €40.00

    @todo
    Scenario: Deleted variant disappears from the registry
        When I delete the "Medium PHP Mug" variant of product "PHP Mug"
        Then this variant should not exist in the product catalog

Remove redundant steps in product

@product
Feature: Deleting a product variant
    In order to remove test or incorrect product variants
    As an Administrator
    I want to be able to delete product variant from the registry

    Background:
        Given the store operates on a single channel in "France"
        And the store has a product "PHP Mug"
        And the product "PHP Mug" has "Medium PHP Mug" variant priced at €40.00

    @todo
    Scenario: Deleted variant disappears from the registry
        When I delete the "Medium PHP Mug" variant of product "PHP Mug"
        Then this variant should not exist in the product catalog


Feature: Visiting per-licence
  As a user
  I want to see details about specific licences
  So I can find out how a specific licence is performing

  @svg @javascript
  Scenario: visiting per-licence page on an SVG browser
       When I go to /performance/licensing/licences/application-to-licence-a-street-collection
       Then I should get back a status of 200
        And the navigation link for "Licences" should be active
        And the page title should be "Application to licence a street collection (submissions made through GOV.UK only)"
        And the 1st subtitle should be "Forms received"
        And the 1st section description should be "Total forms received per week over the last 9 weeks and top authorities by volume in this time"
        And the 2nd subtitle should be "Submissions per authority"
        And the 2nd section description should be "Authorities offering Application to licence a street collection on GOV.UK"

  @no-svg @javascript
  Scenario: visiting per-licence page on a non-SVG browser
       When I go to /performance/licensing/licences/application-to-licence-a-street-collection
       Then I should get back a status of 200
        And the navigation link for "Licences" should be active
        And the page title should be "Application to licence a street collection (submissions made through GOV.UK only)"
        And the 1st subtitle should be "Submissions per authority"
        And the 1st section description should be "Authorities offering Application to licence a street collection on GOV.UK"

Update tests for authority page

Feature: Visiting per-licence
  As a user
  I want to see details about specific licences
  So I can find out how a specific licence is performing

  @svg @javascript
  Scenario: visiting per-licence page on an SVG browser
       When I go to /performance/licensing/licences/application-to-licence-a-street-collection
       Then I should get back a status of 200
        And the navigation link for "Licences" should be active
        And the page title should be "Application to licence a street collection"
        And the 1st subtitle should be "Forms received"
        And the 1st section description should be "Total forms received per week over the last 9 weeks and top authorities by volume in this time"
        And the 2nd subtitle should be "Submissions per authority"
        And the 2nd section description should be "Authorities offering Application to licence a street collection on GOV.UK"

  @no-svg @javascript
  Scenario: visiting per-licence page on a non-SVG browser
       When I go to /performance/licensing/licences/application-to-licence-a-street-collection
       Then I should get back a status of 200
        And the navigation link for "Licences" should be active
        And the page title should be "Application to licence a street collection"
        And the 1st subtitle should be "Submissions per authority"
        And the 1st section description should be "Authorities offering Application to licence a street collection on GOV.UK"


Feature: Publish scenario results
  In order to allow users to see the history of a particular scenario
  As a developer
  I want the belly gem to publish the results of each scenario to the belly service

  Background:
    Given a standard Cucumber project directory structure
    And a file named "features/foo.feature" with:
      """
      Scenario: Solid
        Given I am a rock

      Scenario: Shaky
        Given I am thin ice

      """
    And a file named ".belly" with:
      """
      hub: localhost:12345

      """
    And there is a belly-hub running on localhost:12345

  Scenario: run a test
    And a file named "features/step_definitions/foo_steps.rb" with:
      """
      Given /^I am a rock$/ do
      end

      Given /^I am thin ice$/ do
        raise("yikes")
      end

      """
    When I run cucumber -f Belly::Formatter features
    Then STDERR should be empty
    And the belly-hub should have received the following requests:
      | type | path       | data                                  |
      | POST | /scenarios | { "name":"Solid", "status":"passed" } |
      | POST | /scenarios | { "name":"Shaky", "status":"failed" } |

Fix incompatibility with new cucumber

Feature: Publish scenario results
  In order to allow users to see the history of a particular scenario
  As a developer
  I want the belly gem to publish the results of each scenario to the belly service

  Background:
    Given a standard Cucumber project directory structure
    And a file named "features/foo.feature" with:
      """
      Feature:
        Scenario: Solid
          Given I am a rock

        Scenario: Shaky
          Given I am thin ice

      """
    And a file named ".belly" with:
      """
      hub: localhost:12345

      """
    And there is a belly-hub running on localhost:12345

  Scenario: run a test
    And a file named "features/step_definitions/foo_steps.rb" with:
      """
      Given /^I am a rock$/ do
      end

      Given /^I am thin ice$/ do
        raise("yikes")
      end

      """
    When I run cucumber -f Belly::Formatter features
    Then STDERR should be empty
    And the belly-hub should have received the following requests:
      | type | path       | data                                  |
      | POST | /scenarios | { "name":"Solid", "status":"passed" } |
      | POST | /scenarios | { "name":"Shaky", "status":"failed" } |


Feature: Book new Cargo
    In order to manage a transport of a Cargo
    As a booking clerk
    I need to define an origin and a destination of a Cargo and assign it to a proper itinerary

@javascript
Scenario: Add a Cargo and assign Itinerary
    Given I am on "application/cargo/add"
    When I select "DEHAM" from "origin"
    And I select "USNYC" from "destination"
    And I click the submit button
    And I follow "assign-itinerary-link-1"
    Then the url should match "application/cargo/show/trackingid/[\w-]{36,36}"
    And I should see 1 ".itinerary" elements

Add debug command to feature

Feature: Book new Cargo
    In order to manage a transport of a Cargo
    As a booking clerk
    I need to define an origin and a destination of a Cargo and assign it to a proper itinerary

@javascript
Scenario: Add a Cargo and assign Itinerary
    Given I am on "application/cargo/add"
    When print last response
    And I select "DEHAM" from "origin"
    And I select "USNYC" from "destination"
    And I click the submit button
    And I follow "assign-itinerary-link-1"
    Then the url should match "application/cargo/show/trackingid/[\w-]{36,36}"
    And I should see 1 ".itinerary" elements


Feature: verifying the output of the last console command

  As a documentation writer
  I want to be able to print the expected output of console commands
  So that my readers can verify that they ran a console command correctly.

  - the "verifyStartConsoleCommandOutput" action matches the output of the last console command
  - the expected output is provided as a fenced code block
  - the actual output can contain more lines in between each line of the expected output

  Scenario: verifying the output of a console command
    Given my workspace contains the file "server.js" with content:
      """
      setTimeout(function() {
        console.log('one');
        console.log('two');
        console.log('three');
        setTimeout(function() {}, 1000)
      }, 100)
      """
    And my source code contains the file "verify-output.md" with content:
      """

      ```
      node server.js
      ```

      ```
      one
      three
      ```

      Stop the current process by hitting Ctrl-C

      """
    When running text-run
    Then it signals:
      | FILENAME | verify-output.md                                 |
      | LINE     | 13                                               |
      | MESSAGE  | verifying the output of the long-running process |

Make verifying command output work

Feature: verifying the output of the last console command

  As a documentation writer
  I want to be able to print the expected output of console commands
  So that my readers can verify that they ran a console command correctly.

  - the "verifyStartConsoleCommandOutput" action matches the output of the last console command
  - the expected output is provided as a fenced code block
  - the actual output can contain more lines in between each line of the expected output

  Scenario: verifying the output of a console command
    Given my workspace contains the file "server.js" with content:
      """
      setTimeout(function() {
        console.log('one');
        console.log('two');
        console.log('three');
        setTimeout(function() {}, 1000)
      }, 100)
      """
    And my source code contains the file "verify-output.md" with content:
      """

      ```
      node server.js
      ```

      ```
      one
      three
      ```

      Stop the current process by hitting Ctrl-C

      """
    When running text-run
    Then it signals:
      | FILENAME | verify-output.md                                 |
      | LINE     | 8                                                |
      | MESSAGE  | verifying the output of the long-running process |


Feature: Statement Blocks

  Scenario: Multi-line statement block
    Given the code
    """
    if true {
    print "true".
    }
    """
    Then it should indent like
    """
    if true {
      print "true".
    }
    """

  Scenario: Inline else if.
    Given the code
    """
    if true {
    print "t"
    } else if false {
    print "f"
    }
    """
    Then it should indent like
    """
    if true {
      print "t"
    } else if false {
      print "f"
    }
    """

Test indentation of nested blocks.

Feature: Statement Blocks

  Scenario: Multi-line statement block
    Given the code
    """
    if true {
    print "true".
    }
    """
    Then it should indent like
    """
    if true {
      print "true".
    }
    """

  Scenario: Inline else if.
    Given the code
    """
    if true {
    print "t"
    } else if false {
    print "f"
    }
    """
    Then it should indent like
    """
    if true {
      print "t"
    } else if false {
      print "f"
    }
    """

  Scenario: Nested statement block indent nicely.
    Given the code
    """
    {
    {
    }
    }
    """
    Then it should indent like
    """
    {
      {
      }
    }
    """


# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@ec2
Feature: Amazon Elastic Compute Cloud

  I want to use Amazon Elastic Compute Cloud

  Scenario: DescribeRegions
    Given I describe EC2 regions "us-east-1, us-west-1"
    Then the EC2 endpoint for "us-east-1" should be "ec2.us-east-1.amazonaws.com"
    And the EC2 endpoint for "us-west-1" should be "ec2.us-west-1.amazonaws.com"

  Scenario: Error handling
    Given I describe the EC2 instance "i-12345678"
    Then the error code should be "InvalidInstanceID.NotFound"
    And the error message should be:
    """
    The instance ID 'i-12345678' does not exist
    """
    And the status code should be 400

Fix failing EC2 integration test due to service changes

# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@ec2
Feature: Amazon Elastic Compute Cloud

  I want to use Amazon Elastic Compute Cloud

  Scenario: DescribeRegions
    Given I describe EC2 regions "us-east-1, us-west-1"
    Then the EC2 endpoint for "us-east-1" should be "ec2.us-east-1.amazonaws.com"
    And the EC2 endpoint for "us-west-1" should be "ec2.us-west-1.amazonaws.com"

  Scenario: Error handling
    Given I describe the EC2 instance ""
    Then the error code should be "MissingParameter"
    And the error message should be:
    """
    The request must contain the parameter InstanceId
    """
    And the status code should be 400


Feature: Sign up

  In order to access protected sections of the site
  As a visitor
  I want to sign up

  Background:
    When I go to the sign up page
    Then I should see an email field

  Scenario: Visitor signs up with invalid email
    When I fill in "Email" with "invalidemail"
    And I fill in "Password" with "password"
    And I press "Sign up"
    Then I should see "Must be a valid email address"

  Scenario: Visitor signs up with blank password
    When I fill in "Email" with "email@example.com"
    And I fill in "Password" with ""
    And I press "Sign up"
    Then I should see "Password can't be blank"

  Scenario: Visitor signs up with valid data
    When I fill in "Email" with "email@example.com"
    And I fill in "Password" with "password"
    And I press "Sign up"
    Then I should be on the home page

Kill double coverage scenario since we've already got it in handle/sign_in.


# language: en
@lambda @client
Feature: Amazon Lambda

  Scenario: Making a basic request
    When I call the "ListEventSourceMappings" API
    Then the response should contain a list of "EventSourceMappings"

  Scenario: Error handling
    When I attempt to call the "GetEventSourceMapping" API with:
    | UUID | fake-uuid |
    Then I expect the response error code to be "ResourceNotFoundException"
    And I expect the response error message to include:
    """
    does not exist
    """

Fix lambda test from breaking change

# language: en
@lambda @client
Feature: Amazon Lambda

  Scenario: Making a basic request
    When I call the "ListEventSourceMappings" API
    Then the response should contain a list of "EventSourceMappings"

  Scenario: Error handling
    When I attempt to call the "GetEventSourceMapping" API with:
    | UUID | fake-uuid |
    Then I expect the response error code to be "ValidationException"
    And I expect the response error message to include:
    """
    does not exist
    """


@live-reload @skip-production
Feature: Live reload search

Scenario: Live reload search hitting enter should not cause a full page reload
  Given I am on the homepage
  And I click 'View Digital Outcomes and Specialists opportunities'
  And I am on the 'Digital Outcomes and Specialists opportunities' page
  Then I see the 'Clear filters' link with href 'digital-outcomes-and-specialists/opportunities'
  And I set the page reload flag
  When I enter 'Tea\n' in the 'search' field
  Then I see that the page has not been reloaded
  And I see the 'Clear filters' link with href '/digital-outcomes-and-specialists/opportunities?q=Tea%5Cn&doc_type=briefs'

Scenario: Live reload search button should not cause a full page reload
  Given I am on the homepage
  And I click 'View Digital Outcomes and Specialists opportunities'
  And I am on the 'Digital Outcomes and Specialists opportunities' page
  Then I see the 'Clear filters' link with href 'digital-outcomes-and-specialists/opportunities'
  And I set the page reload flag
  And I enter 'Tea' in the 'search' field
  When I click the 'Search' button
  Then I see that the page has not been reloaded
  And I see the 'Clear filters' link with href '/digital-outcomes-and-specialists/opportunities?q=Tea&doc_type=briefs'

Remove skip-production for livesearch tests

@live-reload
Feature: Live reload search

Scenario: Live reload search hitting enter should not cause a full page reload
  Given I am on the homepage
  And I click 'View Digital Outcomes and Specialists opportunities'
  And I am on the 'Digital Outcomes and Specialists opportunities' page
  Then I see the 'Clear filters' link with href 'digital-outcomes-and-specialists/opportunities'
  And I set the page reload flag
  When I enter 'Tea\n' in the 'search' field
  Then I see that the page has not been reloaded
  And I see the 'Clear filters' link with href '/digital-outcomes-and-specialists/opportunities?q=Tea%5Cn&doc_type=briefs'

Scenario: Live reload search button should not cause a full page reload
  Given I am on the homepage
  And I click 'View Digital Outcomes and Specialists opportunities'
  And I am on the 'Digital Outcomes and Specialists opportunities' page
  Then I see the 'Clear filters' link with href 'digital-outcomes-and-specialists/opportunities'
  And I set the page reload flag
  And I enter 'Tea' in the 'search' field
  When I click the 'Search' button
  Then I see that the page has not been reloaded
  And I see the 'Clear filters' link with href '/digital-outcomes-and-specialists/opportunities?q=Tea&doc_type=briefs'


Feature:
  As an iOS developer
  I want to have a sample feature file
  So I can see what my next step is in the wonderful world of Frank/Cucumber testing

@simulator_only
Scenario:
    Rotating the simulator for demonstration purposes
Given I launch the app

Given the device is in landscape orientation
Given the device is in portrait orientation
Given the device is in landscape orientation
Given the device is in portrait orientation

Add pauses now that rotation is so super fast.

Feature:
  As an iOS developer
  I want to have a sample feature file
  So I can see what my next step is in the wonderful world of Frank/Cucumber testing

@simulator_only
Scenario:
    Rotating the simulator for demonstration purposes
Given I launch the app

Given the device is in landscape orientation
And I pause briefly for demonstration purposes
Given the device is in portrait orientation
And I pause briefly for demonstration purposes
Given the device is in landscape orientation
And I pause briefly for demonstration purposes
Given the device is in portrait orientation
And I pause briefly for demonstration purposes


Feature: Update bundle
  As a developer
  In order to avoid tedious work
  I want to automatically update dependencies

  Background: A project with fixed 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: Nothing to do
    When I run `keep_up --test-command true`
    Then the output should not contain:
      """
      Updating foo to 1.0.0
      """
    And the output should contain:
      """
      Bundle up to date!
      All done!
      """

  Scenario: Updating a gem with a fixed version
    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.1'
      """

Update scenarios to include effect on lockfile

Feature: Update bundle
  As a developer
  In order to avoid tedious work
  I want to automatically update dependencies

  Background: A project with fixed 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: Nothing to do
    When I run `keep_up --test-command true`
    Then the output should not contain:
      """
      Updating foo to 1.0.0
      """
    And the output should contain:
      """
      Bundle up to date!
      All done!
      """
    And the file "Gemfile.lock" should contain:
      """
      foo (1.0.0)
      """

  Scenario: Updating a gem with a fixed version
    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.1'
      """
    And the file "Gemfile.lock" should contain:
      """
      foo (1.0.1)
      """


Feature: User sees the number of new comments on a discussion
  As a Loomio group member
  So that I can know if a discussion has had new comments
  I want to know how many new comments a discussion has had since I last viewed it

  Scenario: User visits dashboard and sees new comments on a discussion they've never read before
    Given I am logged in
    And there is a discussion in a group I belong to
    And I have never read the discussion before
    And the discussion has comments
    When I visit the dashboard
    Then I should see the number of comments the discussion has

  Scenario: User visits dashboard and sees new comments on a discussion they've read before
    Given I am logged in
    And there is a discussion in a group I belong to
    And I have read the discussion before
    And the discussion has had new comments since I last read it
    When I visit the dashboard
    Then I should see the number of new comments the discussion has

  Scenario: User visits group page and sees new comments on a discussion they've never read before
    Given I am logged in
    And there is a discussion in a group I belong to
    And I have never read the discussion before
    And the discussion has comments
    When I visit the group page
    Then I should see the number of comments the discussion has

  Scenario: User visits group page and sees new comments on a discussion they've read before
    Given I am logged in
    And there is a discussion in a group I belong to
    And I have read the discussion before
    And the discussion has had new comments since I last read it
    When I visit the group page
    Then I should see the number of new comments the discussion has

Comment out failing spec for now.

Feature: User sees the number of new comments on a discussion
  As a Loomio group member
  So that I can know if a discussion has had new comments
  I want to know how many new comments a discussion has had since I last viewed it

  Scenario: User visits dashboard and sees new comments on a discussion they've never read before
    Given I am logged in
    And there is a discussion in a group I belong to
    And I have never read the discussion before
    And the discussion has comments
    When I visit the dashboard
    Then I should see the number of comments the discussion has

  Scenario: User visits dashboard and sees new comments on a discussion they've read before
    Given I am logged in
    And there is a discussion in a group I belong to
    And I have read the discussion before
    And the discussion has had new comments since I last read it
    When I visit the dashboard
    Then I should see the number of new comments the discussion has

  # Figure out why this is failing...
  # Scenario: User visits group page and sees new comments on a discussion they've never read before
  #   Given I am logged in
  #   And there is a discussion in a group I belong to
  #   And I have never read the discussion before
  #   And the discussion has comments
  #   When I visit the group page
  #   Then I should see the number of comments the discussion has

  Scenario: User visits group page and sees new comments on a discussion they've read before
    Given I am logged in
    And there is a discussion in a group I belong to
    And I have read the discussion before
    And the discussion has had new comments since I last read it
    When I visit the group page
    Then I should see the number of new comments the discussion has


# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@redshift
Feature: Amazon Redshift

  I want to use Amazon Redshift

  Scenario: Feature
    Given I create a Redshift cluster security group with prefix name "aws-js-sdk"
    And I describe Redshift cluster security groups
    Then the Redshift cluster security group should be in the list
    And I delete the Redshift cluster security group

  Scenario: Error handling
    Given I create a Redshift cluster security group with prefix name ""
    Then the error code should be "InvalidParameterValue"
    Then the error message should be:
    """
    ClusterSecurityGroupName is required
    """

Rename Redshift integration test scenario

# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# language: en
@redshift
Feature: Amazon Redshift

  I want to use Amazon Redshift

  Scenario: Creating and deleting cluster security groups
    Given I create a Redshift cluster security group with prefix name "aws-js-sdk"
    And I describe Redshift cluster security groups
    Then the Redshift cluster security group should be in the list
    And I delete the Redshift cluster security group

  Scenario: Error handling
    Given I create a Redshift cluster security group with prefix name ""
    Then the error code should be "InvalidParameterValue"
    Then the error message should be:
    """
    ClusterSecurityGroupName is required
    """


Feature: Object constraints
  Scenario: Object has no specified properties
    Given the following JSON schema:
      """json
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object"
      }
      """
    When I run the JSON data generator
    Then the JSON output should be:
      """json
      {}
      """

  Scenario: Minimum number of properties
    Given the following JSON schema:
      """json
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "minProperties": 3,
        "properties": {
        }
      }
      """
    When I run the JSON data generator
    Then JSON output should have 3 properties

Make all Cukes test for matching schema

Feature: Object constraints
  Scenario: Object has no specified properties
    Given the following JSON schema:
      """json
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object"
      }
      """
    When I run the JSON data generator
    Then the output should match the schema

  Scenario: Minimum number of properties
    Given the following JSON schema:
      """json
      {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "minProperties": 3,
        "properties": {
        }
      }
      """
    When I run the JSON data generator
    Then the output should match the schema


Feature: Class documentation page

  @template
  Scenario: Author tag should be visible
    Given A project named "simple" based on "simple"
    And I ran "phpdoc --template=clean"
    And I open documentation
    And I am on "/build/docs/classes/Simple.Blog.Post.html"
    Then I should see "author" in the ".table-condensed tr th" element
    And I should see "jaapio" in the ".table-condensed tr td" element
    And I should see "jaapio@phpdoc.org" in the ".table-condensed tr td p a" element

Fix build by disabling test

Feature: Class documentation page

  @template
#  Scenario: Author tag should be visible
#    Given A project named "simple" based on "simple"
#    And I ran "phpdoc --template=clean"
#    And I open documentation
#    And I am on "/build/docs/classes/Simple.Blog.Post.html"
#    Then I should see "author" in the ".table-condensed tr th" element
#    And I should see "jaapio" in the ".table-condensed tr td" element
#    And I should see "jaapio@phpdoc.org" in the ".table-condensed tr td p a" element


@service @service_destroy
Feature: Service destroy

  Scenario: Non logged service destroy
    Given I setup ernest with target "https://ernest.local"
    And I logout
    When I run ernest with "service destroy"
    Then The output should contain "You're not allowed to perform this action, please log in"
    When I run ernest with "service destroy destroyable"
    Then The output should contain "You're not allowed to perform this action, please log in"

  Scenario: Logged service destroy unexisting
    Given I setup ernest with target "https://ernest.local"
    And I'm logged in as "usr" / "secret123"
    When I run ernest with "service destroy"
    Then The output should contain "You should specify an existing service name"
    When I run ernest with "service destroy unexisting --yes"
    Then The output should contain "Specified service not found"

  Scenario: Logged service destroy
    Given I setup ernest with target "https://ernest.local"
    And I'm logged in as "usr" / "secret123"
    And The service "destroyable" does not exist
    And I apply the definition "destroyable.yml"
    When I run ernest with "service destroy destroyable --yes"
    Then The output should not contain "Specified service name does not exist"
    When I run ernest with "service destroy destroyable --yes"
    Then The output should contain "Specified service not found"

Revert changes to CLI service destroy test

@service @service_destroy
Feature: Service destroy

  Scenario: Non logged service destroy
    Given I setup ernest with target "https://ernest.local"
    And I logout
    When I run ernest with "service destroy"
    Then The output should contain "You're not allowed to perform this action, please log in"
    When I run ernest with "service destroy destroyable"
    Then The output should contain "You're not allowed to perform this action, please log in"

  Scenario: Logged service destroy unexisting
    Given I setup ernest with target "https://ernest.local"
    And I'm logged in as "usr" / "secret123"
    When I run ernest with "service destroy"
    Then The output should contain "You should specify an existing service name"
    When I run ernest with "service destroy unexisting --yes"
    Then The output should contain "Specified service name does not exist"

  Scenario: Logged service destroy
    Given I setup ernest with target "https://ernest.local"
    And I'm logged in as "usr" / "secret123"
    And The service "destroyable" does not exist
    And I apply the definition "destroyable.yml"
    When I run ernest with "service destroy destroyable --yes"
    Then The output should not contain "Specified service name does not exist"
    When I run ernest with "service destroy destroyable --yes"
    Then The output should contain "Specified service name does not exist"


## Register event

### A user can register event
As a meeting attendee
I wan to register a event so that I can attend the meeting

Given there is a CodeUp event
And  Codeup has contract has the following information
| registered | 0                  |
| balance    | 0                  |
| deposit    | 1                  |
When Chris registered
Then Chris's account balance is -1 ETHER
And  Codeup has contract has the following information
| registered | 1                  |
| balance    | 1                  |
And  Codeup remaining capacity is 19

### A user cannot register the event because the capacity is filled up
### A user cannot register the event because its too late

Add more spec to feature

## Register event

### A user can register event
As a meeting attendee
I wan to register a event so that I can attend the meeting

Given there is a CodeUp event
And  Codeup has contract has the following information
| registered | 0                  |
| balance    | 0                  |
| deposit    | 1                  |
When Chris registered
Then Chris's account balance is -1 ETHER
And  Codeup has contract has the following information
| registered | 1                  |
| balance    | 1                  |
And  Codeup remaining capacity is 19

### A user can unregister until a day before the event starts
### A user cannot register the event because the capacity is filled up
### A user cannot register the same event more than once
### A user cannot register the event because its too late


@javascript
Feature: new user registration

  Background:
    When I go to the new user registration page
    And I fill in "Username" with "ohai"
    And I fill in "Email" with "ohai@example.com"
    And I fill in "user_password" with "secret"
    And I fill in "Password confirmation" with "secret"
    And I press "Create my account"
    Then I should be on the getting started page
    And I should see "Welcome"
    And I should see "Fill out your profile"
    And I should see "Connect to your other social networks"
    And I should see "Connect with cool people"
    And I should see "Follow your interests"
    And I should see "Connect to Cubbi.es"

  Scenario: new user goes through the setup wizard
   When I follow "Edit Profile"
    And I fill in "profile_first_name" with "O"
    And I fill in "profile_last_name" with "Hai"
    And I fill in "tags" with "#tags"
    And I press "Update Profile"
    And I wait for the ajax to finish
    Then I should see "Profile updated"
    And I should see "Welcome"
    And I follow "Finished"

    Then I should be on the aspects page
    And I should not see "Finished"

  Scenario: new user skips the setup wizard
    When I follow "Finished"
    Then I should be on the aspects page

Make the signs up feature more robust

@javascript
Feature: new user registration

  Background:
    When I go to the new user registration page
    And I fill in "Username" with "ohai"
    And I fill in "Email" with "ohai@example.com"
    And I fill in "user_password" with "secret"
    And I fill in "Password confirmation" with "secret"
    And I press "Create my account"
    Then I should be on the getting started page
    And I should see "Welcome"
    And I should see "Fill out your profile"
    And I should see "Connect to your other social networks"
    And I should see "Connect with cool people"
    And I should see "Follow your interests"
    And I should see "Connect to Cubbi.es"

  Scenario: new user goes through the setup wizard
   When I follow "Edit Profile"
    And I fill in "profile_first_name" with "O"
    And I fill in "profile_last_name" with "Hai"
    And I fill in "tags" with "#tags"
    And I press "Update Profile"
    And I wait for the ajax to finish
    Then I should see "O Hai" within "#user_menu"
    And I should see "Welcome"
    And I follow "Finished"

    Then I should be on the aspects page
    And I should not see "Finished"

  Scenario: new user skips the setup wizard
    When I follow "Finished"
    Then I should be on the aspects page


@routing @graph @testbot
Feature: Basic Routing
#Test the input data descibed on https://github.com/DennisOSRM/Project-OSRM/wiki/Graph-representation

    Background:
        Given the profile "testbot"

    Scenario: Graph transformation
        Given the node map
            |   |   | d |
            | a | b | c |
            |   |   | e |

        And the ways
            | nodes |
            | abc   |
            | dce   |

        When I route I should get
            | from | to | route   |
            | a    | e  | abc,dce |

    Scenario: Turn instructions on compressed road network geometry
        Given the node map
            | x | a |   |   |
            |   | b |   |   |
            | f |   |   | e |
            |   |   |   |   |
            |   |   |   |   |
            | y | c |   | d |

        And the ways
            | nodes  | name  |
            | xa     | first |
            | abcdef | compr |
            | fy     | last  |

        When I route I should get
            | from | to | route            | turns                           |
            | x    | y  | first,compr,last | depart,straight,straight,arrive |

Add missing arrival instruction. This test was incorrect.

@routing @graph @testbot
Feature: Basic Routing
#Test the input data descibed on https://github.com/DennisOSRM/Project-OSRM/wiki/Graph-representation

    Background:
        Given the profile "testbot"

    Scenario: Graph transformation
        Given the node map
            |   |   | d |
            | a | b | c |
            |   |   | e |

        And the ways
            | nodes |
            | abc   |
            | dce   |

        When I route I should get
            | from | to | route       |
            | a    | e  | abc,dce,dce |

    Scenario: Turn instructions on compressed road network geometry
        Given the node map
            | x | a |   |   |
            |   | b |   |   |
            | f |   |   | e |
            |   |   |   |   |
            |   |   |   |   |
            | y | c |   | d |

        And the ways
            | nodes  | name  |
            | xa     | first |
            | abcdef | compr |
            | fy     | last  |

        When I route I should get
            | from | to | route                 | turns                    |
            | x    | y  | first,compr,last,last | depart,right,left,arrive |


Feature: Specifications are visible to users
  In order to make specifications more accessible
  As an interested party
  I want specifications to be visible in a nice web UI.

  The general idea is that anyone should be able to see the specifications without having to understand how version control works.

  Scenario: Specifications are visible in a non-repository location.
    Given a set of specifications exists
    When an interested party attempts to view them
    Then the specifications should be visible

Add specifications for displaying lists of feature files and specifications.

Feature: Specifications are visible to users
  In order to make specifications more accessible
  As an interested party
  I want specifications to be visible in a nice web UI.

  The general idea is that anyone should be able to see the specifications stored in a project without having to understand how version control works.

  # For now this is deliberately feature files rather than features.
  Scenario: A list of feature files is available.
    Given a set of specifications containing at least one feature file
    When an interested party attempts to view them
    Then the list of feature files will be visible

  Scenario: It is simple to see the scenarios within with a feature file.
    Given a list of feature files is displayed
    When an interested party wants to view the scenarios within that feature file
    Then the scenarios will be visible.


Feature: connect to sensors

  Scenario: connect to master brick
    Given we connect to the master brick
    Then we are connected

Add feature file for measuring electricity

Feature: connect to sensors

  Scenario: connect to master brick
    Given we connect to the master brick
    Then we are connected

  Scenario: measure electricity with the ambient light sensor
    Given we have an electricity sensor
    Then we can measure electricity

  Scenario: disregard electricity measurements that are not pulses
    Given we have an electricty sensor
    And someone opens the door
    Then we disregard the measurements


@retry
Feature: Lost Password
  As a site owner
  I want to be able to reset my password
  Using my email

  Background:
    Given a "member" "Admin" with "Email"="admin@example.org"

  Scenario: I can request a password reset by email
    Given I go to "Security/login"
    When I follow "I've lost my password"
    And I fill in "admin@example.org" for "Email"
    And I press the "Send me the password reset link" button
    Then I should see "A reset link has been sent to 'admin@example.org'"
    And there should be an email to "admin@example.org" titled "Your password reset link"
    When I click on the "password reset link" link in the email to "admin@example.org"
    Then I should see "Please enter a new password"
    When I fill in "newpassword" for "New Password"
    And I fill in "newpassword" for "Confirm New Password"
    And I press the "Change Password" button
    Then the password for "admin@example.org" should be "newpassword"

Fix test for password recovery

@retry
Feature: Lost Password
  As a site owner
  I want to be able to reset my password
  Using my email

  Background:
    Given a "member" "Admin" with "Email"="admin@example.org"

  Scenario: I can request a password reset by email
    Given I go to "Security/login"
    When I follow "I've lost my password"
    And I fill in "admin@example.org" for "Email"
    And I press the "Send me the password reset link" button
    Then I should see "A reset link has been sent"
    And there should be an email to "admin@example.org" titled "Your password reset link"
    When I click on the "password reset link" link in the email to "admin@example.org"
    Then I should see "Please enter a new password"
    When I fill in "newpassword" for "New Password"
    And I fill in "newpassword" for "Confirm New Password"
    And I press the "Change Password" button
    Then the password for "admin@example.org" should be "newpassword"


@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


@cli
Feature: Canceling unpaid orders
    In order to have my orders list free from completed but unpaid orders
    As a Developer
    I want to have unpaid orders cancelled

    Scenario: Canceling unpaid orders
        When the unpaid orders has been cancelled
        Then I should see be informed that unpaid orders have been cancelled

Improve cancel unpaid orders feature

@canceling_unpaid_orders @cli
Feature: Canceling unpaid orders
    In order to have my orders list free from completed but unpaid orders
    As a Developer
    I want to have unpaid orders cancelled

    Background:
        Given the store operates on a single channel in "United States"
        And the store has a product "PHP T-Shirt" priced at "$10.00" in "United States" channel
        And the store ships everywhere for free
        And the store allows paying with "Paypal Express Checkout"

    Scenario: Having order cancelled after 6 days of being unpaid
        Given there is a customer "john.doe@gmail.com" that placed an order "#00000022"
        Given there is a customer "john.doe@gmail.com" that has placed 2 orders with numbers "#00000025" and "#00000026"
        And the customer has refunded the order with number "#00000026"
        When the order with number "#00000025" has not been paid for 6 days
        Then only unpaid order with number "#00000025" should be canceled
        And I should be informed that unpaid order have been cancelled


Feature: Review CLI information

  Scenario: Get the path to the packages directory
    Given an empty directory

    When I run `wp cli info --format=json`
    Then STDOUT should be JSON containing:
      """
      {"wp_cli_packages_dir_path":null}
      """

    When I run `wp package install danielbachhuber/wp-cli-reset-post-date-command`
    Then STDERR should be empty

    When I run `wp cli info --format=json`
    Then STDOUT should be JSON containing:
      """
      {"wp_cli_packages_dir_path":"/tmp/wp-cli-home/.wp-cli/packages/"}
      """

Add test for cli info without format parameter

Feature: Review CLI information

  Scenario: Get the path to the packages directory
    Given an empty directory

    When I run `wp cli info --format=json`
    Then STDOUT should be JSON containing:
      """
      {"wp_cli_packages_dir_path":null}
      """

    When I run `wp package install danielbachhuber/wp-cli-reset-post-date-command`
    Then STDERR should be empty

    When I run `wp cli info --format=json`
    Then STDOUT should be JSON containing:
      """
      {"wp_cli_packages_dir_path":"/tmp/wp-cli-home/.wp-cli/packages/"}
      """
    And I run `wp cli info`
    Then STDOUT should contain:
      """
      WP-CLI packages dir:    /tmp/wp-cli-home/.wp-cli/packages/
      """


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

Feature: Test XML-RPC "api" namespace.

  Scenario: Public API test
    Given I am logged in via XML-RPC/api as user "admin" and password "admin"
    When I call getVersion, I should get "17" as result
    And I call systemVersion, I should get "3.0" as result
    And I call getApiNamespaces, I should get 48 namespaces
    And I call getApiNamespaceCallList, I should get 675 available api calls
    And I call getApiCallList, I should get 48 available groups

Update XMLRPC API method count to 676

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

Feature: Test XML-RPC "api" namespace.

  Scenario: Public API test
    Given I am logged in via XML-RPC/api as user "admin" and password "admin"
    When I call getVersion, I should get "17" as result
    And I call systemVersion, I should get "3.0" as result
    And I call getApiNamespaces, I should get 48 namespaces
    And I call getApiNamespaceCallList, I should get 676 available api calls
    And I call getApiCallList, I should get 48 available groups


Feature: Apps are up

  @api
  Scenario: Check the data API is up
    Given I have a URL for "dm_api"
      And I have an auth token for "dm_api"
    When I send a GET request with authorization to "/services"
    Then the response code should be "200"
    And the response should contain a JSON list of "services"

  @search-api
  Scenario: Check the search API is up
    Given I have a URL for "dm_search_api"
      And I have an auth token for "dm_search_api"
    When I send a GET request with authorization to "/"
    Then the response code should be "200"
    And the response should contain a JSON object "links"

  @buyer-frontend
  Scenario: Check the buyer frontend is up
    Given I have a URL for "dm_buyer_frontend"
    When I send a GET request to the home page
    Then the response code should be "200"

  @supplier-frontend
  Scenario: Check the supplier frontend is up
    Given I have a URL for "dm_supplier_frontend"
    When I send a GET request to the home page
    Then the response code should be "200"

  @admin-frontend
  Scenario: Check the admin frontend is up
    Given I have a URL for "dm_admin_frontend"
    When I send a GET request to "/admin/login"
    Then the response code should be "200"

Fix supplier app "is up" URL

Feature: Apps are up

  @api
  Scenario: Check the data API is up
    Given I have a URL for "dm_api"
      And I have an auth token for "dm_api"
    When I send a GET request with authorization to "/services"
    Then the response code should be "200"
    And the response should contain a JSON list of "services"

  @search-api
  Scenario: Check the search API is up
    Given I have a URL for "dm_search_api"
      And I have an auth token for "dm_search_api"
    When I send a GET request with authorization to "/"
    Then the response code should be "200"
    And the response should contain a JSON object "links"

  @buyer-frontend
  Scenario: Check the buyer frontend is up
    Given I have a URL for "dm_buyer_frontend"
    When I send a GET request to the home page
    Then the response code should be "200"

  @supplier-frontend
  Scenario: Check the supplier frontend is up
    Given I have a URL for "dm_supplier_frontend"
    When I send a GET request to "/supplier/"
    Then the response code should be "200"

  @admin-frontend
  Scenario: Check the admin frontend is up
    Given I have a URL for "dm_admin_frontend"
    When I send a GET request to "/admin/login"
    Then the response code should be "200"


@shard_1
Feature: LMS.Navigate Course
    As a student in an edX course
    In order to access courseware
    I want to be able to navigate through the content

    Scenario: I can navigate to a section
        Given I am viewing a course with multiple sections
        When I navigate to a section
        Then I see the content of the section

    Scenario: I can navigate to subsections
        Given I am viewing a section with multiple subsections
        When I navigate to a subsection
        Then I see the content of the subsection

    Scenario: I can navigate to sequences
        Given I am viewing a section with multiple sequences
        When I navigate to an item in a sequence
        Then I see the content of the sequence item
        And a "seq_goto" browser event is emitted

Comment out flaky lettuce test. TNL-5315

@shard_1
Feature: LMS.Navigate Course
    As a student in an edX course
    In order to access courseware
    I want to be able to navigate through the content

# This scenario is flaky: See TNL-5315
#    Scenario: I can navigate to a section
#        Given I am viewing a course with multiple sections
#        When I navigate to a section
#        Then I see the content of the section

    Scenario: I can navigate to subsections
        Given I am viewing a section with multiple subsections
        When I navigate to a subsection
        Then I see the content of the subsection

    Scenario: I can navigate to sequences
        Given I am viewing a section with multiple sequences
        When I navigate to an item in a sequence
        Then I see the content of the sequence item
        And a "seq_goto" browser event is emitted


Feature: Start a VM or cluster of VMs in the cloud

  Scenario: Without a Blimpfile
    Given I have no Blimpfile in my current directory
    When I run `blimpy start`
    Then the output should contain:
      """
      Please create a Blimpfile in your current directory
      """
    And the exit status should be 1

  Scenario: dry-run start with a simple Blimpfile
    Given I have the Blimpfile:
      """
      Blimpy.fleet do |f|
        f.add(:aws) do |host|
          host.group = 'Simple'
          host.name = 'Cucumber Host'
        end
      end
      """
    When I run `blimpy start --dry-run`
    Then the exit status should be 0
    And the output should contain:
      """
      Up, up and away!
      """

  @slow @destroy
  Scenario: start with a functional Blimpfile
    Given I have the Blimpfile:
      """
      Blimpy.fleet do |f|
        f.add(:aws) do |host|
          host.group = 'Simple'
          host.name = 'Cucumber Host'
        end
      end
      """
    When I run `blimpy start`
    Then the exit status should be 0
    And the output should contain:
      """
      Up, up and away!
      """
    And the output should contain:
      """
      online at:
      """

Add a failing scenario for using an :opnstack type

Feature: Start a VM or cluster of VMs in the cloud

  Scenario: Without a Blimpfile
    Given I have no Blimpfile in my current directory
    When I run `blimpy start`
    Then the output should contain:
      """
      Please create a Blimpfile in your current directory
      """
    And the exit status should be 1

  Scenario: dry-run start with a simple Blimpfile
    Given I have the Blimpfile:
      """
      Blimpy.fleet do |f|
        f.add(:aws) do |host|
          host.group = 'Simple'
          host.name = 'Cucumber Host'
        end
      end
      """
    When I run `blimpy start --dry-run`
    Then the exit status should be 0
    And the output should contain:
      """
      Up, up and away!
      """

  @slow @destroy
  Scenario: start with a functional Blimpfile
    Given I have the Blimpfile:
      """
      Blimpy.fleet do |f|
        f.add(:aws) do |host|
          host.group = 'Simple'
          host.name = 'Cucumber Host'
        end
      end
      """
    When I run `blimpy start`
    Then the exit status should be 0
    And the output should contain:
      """
      Up, up and away!
      """
    And the output should contain:
      """
      online at:
      """

  @slow @destroy @openstack
  Scenario: start with an OpenStack Blimpfile
    Given I have the Blimpfile:
      """
      Blimpy.fleet do |f|
        f.add(:openstack) do |host|
          host.name = 'Cucumber Host'
        end
      end
      """
    When I run `blimpy start`
    Then the exit status should be 0
    And the output should contain:
      """
      Up, up and away!
      """
    And the output should contain:
      """
      online at:
      """


Feature: Extract booking data
  In order to know how many bookings Pension Wise have made
  The booking manager will need booking data extracted from the booking system

  @wip
  Scenario: Data is extracted from the booking system api
    Given the booking system contains booking data
    When a list of bookings is requested from the booking api
    Then a list of bookings is extracted from the booking api

  @wip
  Scenario: Data is written to disk before any restructuring takes place
    When booking data is extracted from the booking api
    Then the extracted booking data is persisted to disk

  @wip
  Scenario: Isolating the changed data to allow selective processing
    When the booking data is a mix of new and already extracted data
    Then only the changed booking data is extracted

Add scenario for capturing changes to booking data

Feature: Extract booking data
  In order to know how many bookings Pension Wise have made
  The booking manager will need booking data extracted from the booking system

  @wip
  Scenario: Data is extracted from the booking system api
    Given the booking system contains booking data
    When a list of bookings is requested from the booking api
    Then a list of bookings is extracted from the booking api

  @wip
  Scenario: Data is written to disk before any restructuring takes place
    When booking data is extracted from the booking api
    Then the extracted booking data is persisted to disk

  @wip
  Scenario: Isolating the changed data to allow selective processing
    When the booking data is a mix of new and already extracted data
    Then only the changed booking data is extracted

  @wip
  Scenario: Capturing all changes made to booking data
    When booking data has changed since it was previously extracted
    Then the changed booking data is extracted


@RALLY_US3567
Feature: Entity versioning and migration strategies
  As a system that supports versions, I want to start tracking versions of entities.

  Background: None

  @DB_MIGRATION_BEFORE_API_STARTS
  Scenario: Remove all records in the metaData collection
    Given I drop the "metaData" collection

  @DB_MIGRATION_AFTER_API_STARTS
  Scenario: Check that after starting the API, documents exist in the collection
    Then there should be 41 records in the "metaData" collection
    And "SARJE" field is "1" for all records
    And "mongo_sv" field is "0" for all records
    And "dal_sv" field is "1" for all records

  @DB_MIGRATION_AFTER_UPVERSIONING
  Scenario: Check that the updated versions were detected on startup and thus SARJE has been signaled
    Then there should be 41 records in the "metaData" collection
    And "SARJE" field is "1" for all records
    And "mongo_sv" field is "0" for all records
    And "dal_sv" field is "999999" for all records

  @DB_MIGRATION_AFTER_UPVERSIONING
  Scenario: API requests for an student get transformed using the test transformation
    Given I am logged in using "rrogers" "rrogers1234" to realm "IL"
    And format "application/vnd.slc+json"
    When I navigate to GET "/<STAFF URI>/<'Rick Rogers' ID>"
    Then "favoriteSubject" should be "Math"
    And "sex" should not exist
    And "name" should not exist
    And "nameData" should exist

Revert "[US4923] Fixed mongo_sv version in test"

@RALLY_US3567
Feature: Entity versioning and migration strategies
  As a system that supports versions, I want to start tracking versions of entities.

  Background: None

  @DB_MIGRATION_BEFORE_API_STARTS
  Scenario: Remove all records in the metaData collection
    Given I drop the "metaData" collection

  @DB_MIGRATION_AFTER_API_STARTS
  Scenario: Check that after starting the API, documents exist in the collection
    Then there should be 41 records in the "metaData" collection
    And "SARJE" field is "1" for all records
    And "mongo_sv" field is "1" for all records
    And "dal_sv" field is "1" for all records

  @DB_MIGRATION_AFTER_UPVERSIONING
  Scenario: Check that the updated versions were detected on startup and thus SARJE has been signaled
    Then there should be 41 records in the "metaData" collection
    And "SARJE" field is "1" for all records
    And "mongo_sv" field is "1" for all records
    And "dal_sv" field is "999999" for all records

  @DB_MIGRATION_AFTER_UPVERSIONING
  Scenario: API requests for an student get transformed using the test transformation
    Given I am logged in using "rrogers" "rrogers1234" to realm "IL"
    And format "application/vnd.slc+json"
    When I navigate to GET "/<STAFF URI>/<'Rick Rogers' ID>"
    Then "favoriteSubject" should be "Math"
    And "sex" should not exist
    And "name" should not exist
    And "nameData" should exist


Feature: Regional Questions
    Scenario: Regional Admin deleting questions from Question Bank
        Given that I am logged in as a regional admin
        And I have regional questions in the question bank
        When I navigate to the question bank
        Then I should see an option to delete each question
        When I choose to delete a question
        Then I should see a prompt to confirm deleting the question
        When I confirm the regional question deletion
        Then that question should not appear in the Question bank
        And I should see a message that the regional question was deleted

Add FT for Regional Admin creating Questions in Regional Question Bank

Feature: Regional Questions
    Scenario: Regional Admin deleting questions from Question Bank
        Given that I am logged in as a regional admin
        And I have regional questions in the question bank
        When I navigate to the question bank
        Then I should see an option to delete each question
        When I choose to delete a question
        Then I should see a prompt to confirm deleting the question
        When I confirm the regional question deletion
        Then that question should not appear in the Question bank
        And I should see a message that the regional question was deleted

    Scenario: Regional Admin Creating Simple Question
        Given that I am logged in as a regional admin
        And I visit the question listing page
        And I click add new question page
        And I fill in the question details
        And I click save question button
        Then I should see the question created

    Scenario: Regional Admin Creating Simple MultiChoice Question
        Given that I am logged in as a regional admin
        And I visit the question listing page
        And I click add new question page
        And I fill in the multichoice question form data
        And I select Multi-choice answer type
        And I check custom option
        Then I should see the option field
        When Fill in the option
        When I click add more button
        Then I should see another option field
        When I click remove the added option field
        Then I should not see that option field
        And I click save question button
        Then I should see the question created


Feature: Create specs from RAML

  Scenario: Generate specs from a simple RAML file
    Given a file named "foo.raml" like "empty_raml.raml"
    When I run `rambo foo.raml`
    Then the directory "spec/contract" should exist
    And the file "spec/contract/foo_spec.rb" should exist
    And the file "spec/spec_helper.rb" should exist
    And the file "spec/spec_helper.rb" should contain:
      """
      require "rack/test"
      require "json"
      """
    And the file "spec/contract/foo_spec.rb" should be like "empty_spec.rb.ex"
    And the exit status should be 0

Add comment pointing to directory with example files

Feature: Create specs from RAML

  The example files can be found in features/support/examples

  Scenario: Generate specs from a simple RAML file
    Given a file named "foo.raml" like "empty_raml.raml"
    When I run `rambo foo.raml`
    Then the directory "spec/contract" should exist
    And the file "spec/contract/foo_spec.rb" should exist
    And the file "spec/spec_helper.rb" should exist
    And the file "spec/spec_helper.rb" should contain:
      """
      require "rack/test"
      require "json"
      """
    And the file "spec/contract/foo_spec.rb" should be like "empty_spec.rb.ex"
    And the exit status should be 0


@admin @search-for-users
Feature: Search for users

Scenario Outline: Correct users can search for users by email address
  Given I have a buyer user with:
    | email_address | user-one-findme@example.gov.uk   |
    | name          | DM Functional Test Search User 1 |
  And I am logged in as the existing <role> user
  And I click the 'Find a user by email' link
  When I enter 'user-one-findme@example.gov.uk' in the 'Find a user by email' field
  And I click the 'Search' button
  Then I am on the 'Find a user' page
  And I see an entry in the 'Users' table with:
    | Name                             | Role  | Supplier | Last login | Last password change | Locked |
    | DM Functional Test Search User 1 | buyer |          | <ANY>      | <ANY>                | No     |

  Examples:
    | role                      |
    | admin                     |
    | admin-ccs-category        |
    | admin-ccs-data-controller |

Scenario Outline: Correct users cannot search for users by email address
  Given I am logged in as the existing <role> user
  Then I don't see the 'Find a user by email' link
  When I visit the /admin/users page
  Then I am on the 'You don’t have permission to perform this action' page

  Examples:
    | role                      |
    | admin-framework-manager   |
    | admin-ccs-sourcing        |
    | admin-manager             |

Remove admin permissions feature test

@admin @search-for-users
Feature: Search for users

Scenario Outline: Admins can search for users by email address
  Given I have a buyer user with:
    | email_address | user-one-findme@example.gov.uk   |
    | name          | DM Functional Test Search User 1 |
  And I am logged in as the existing admin user
  And I click the 'Find a user by email' link
  When I enter 'user-one-findme@example.gov.uk' in the 'Find a user by email' field
  And I click the 'Search' button
  Then I am on the 'Find a user' page
  And I see an entry in the 'Users' table with:
    | Name                             | Role  | Supplier | Last login | Last password change | Locked |
    | DM Functional Test Search User 1 | buyer |          | <ANY>      | <ANY>                | No     |


Feature: Bootstrapping a new project
  In order to have the best chances of getting up and running with cucumber
  As a new cucumber user
  I want cucumber to give helpful error messages in basic situations

 Scenario: running cucumber against a non-existing feature file
  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. (Errno::ENOENT)
      """

 Scenario: does not load ruby files in root if features directory is missing
  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 it should fail with exactly:
    """
    No such file or directory - features. Please create a features directory to get started. (Errno::ENOENT)

    """

Add @spawn for Jruby access denied errors

Feature: Bootstrapping a new project
  In order to have the best chances of getting up and running with cucumber
  As a new cucumber user
  I want cucumber to give helpful error messages in basic situations

 @spawn
 Scenario: running cucumber against a non-existing feature file
  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. (Errno::ENOENT)
      """

 @spawn
 Scenario: does not load ruby files in root if features directory is missing
  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 it should fail with exactly:
    """
    No such file or directory - features. Please create a features directory to get started. (Errno::ENOENT)

    """


@interactions-collection
Feature: View collection of contacts
  As an existing user
  I would like to view all the interactions in one place
  And be able to read the interaction details as expected

  @interactions-collection--view-interaction
  Scenario: View interaction in interactions and services collection

    Given a company is created
    When navigating to the company contacts
    And a primary contact is added
    And navigating to the create company interactions and services step 1 page
    And selecting interaction
    And adding an interaction
    Then I see the success message
    When I navigate to the Interactions and services collection page
    Then there are Interactions headings
    And I can view the Interaction in the collection for interactions and services
      | label   | statePath              |
      | Contact | contact.header         |
      | Company | company.name           |
      | Date    |                        |
      | Adviser | interaction.ditAdviser |
    And the Interaction has badges for interactions and services
      | text |
      | Type |
      | text |
      | Type |

Add acceptance test around viewing service deliveries in interactions and services list

@interactions-collection
Feature: View collection of contacts
  As an existing user
  I would like to view all the interactions in one place
  And be able to read the interaction details as expected

  @interactions-collection--view-interaction
  Scenario: View interaction in interactions and services collection

    Given a company is created
    When navigating to the company contacts
    And a primary contact is added
    And navigating to the create company interactions and services step 1 page
    And selecting interaction
    And adding an interaction
    Then I see the success message
    When I navigate to the Interactions and services collection page
    Then there are Interactions headings
    And I can view the Interaction in the collection for interactions and services
      | label   | statePath              |
      | Contact | contact.header         |
      | Company | company.name           |
      | Date    |                        |
      | Adviser | interaction.ditAdviser |
    And the Interaction has badges for interactions and services
      | text |
      | Type |

  @interactions-collection--view-service-delivery
  Scenario: View service delivery in interactions and services collection

    Given a company is created
    When navigating to the company contacts
    And a primary contact is added
    And navigating to the create company interactions and services step 1 page
    And selecting service delivery
    And adding a service delivery
    Then I see the success message
    When I navigate to the Interactions and services collection page
    Then there are Interactions headings
    And I can view the Service delivery in the collection for interactions and services
      | label   | statePath                  |
      | Contact | contact.header             |
      | Company | company.name               |
      | Date    |                            |
      | Adviser | serviceDelivery.ditAdviser |
    And the Service delivery has badges for interactions and services
      | text |
      | Type |


# encoding: UTF-8
# language: no

@rest
Egenskap: Legge til og endre verk
  Som katalogiseringsgrensesnitt
  For å kunne hjelpe katalogisator med å katalogisere
  Ønsker jeg å kunne legge til og endre verk via servicelagets API

  Scenario: Legge til verk
    Gitt at jeg har en ontologi som beskriver verk
    Når jeg legger inn et verk via APIet
    Så viser APIet at verket finnes

  Scenario: Endre verk
    Gitt at det er opprettet et verk
    Når jeg sender inn endringer til APIet
    Så viser APIet at endringene er lagret

Change tag from @rest to @redef.

# encoding: UTF-8
# language: no

@redef
Egenskap: Legge til og endre verk
  Som katalogiseringsgrensesnitt
  For å kunne hjelpe katalogisator med å katalogisere
  Ønsker jeg å kunne legge til og endre verk via servicelagets API

  Scenario: Legge til verk
    Gitt at jeg har en ontologi som beskriver verk
    Når jeg legger inn et verk via APIet
    Så viser APIet at verket finnes

  Scenario: Endre verk
    Gitt at det er opprettet et verk
    Når jeg sender inn endringer til APIet
    Så viser APIet at endringene er lagret


Feature: Reviewer can discuss proposals

  Background: A proposal exists
    Given a regular User exists
    And a proposal titled "The great Ruby talk"
    And a reviewer User exists
    And that user is logged in

  Scenario: Comment on a proposal
    Given I am on the "proposals" page
    When I follow "Discuss" for "The great Ruby talk"
    And I follow "Comment"
    And I fill in the following:
      | Comment | The comment that I just made |
    And I press the "Create Comment" button
    Then I should be on the coments page for the proposal
    And I should see "The comment that I just made"

  @javascript
  Scenario: Rate a proposal
    Given I am on the "proposals" page
    When I follow "Discuss" for "The great Ruby talk"
    And I choose "2" from "Rank"
    And I follow "Back to Proposals"
    Then I should be on the "proposals" page
    And I should see "2"

Add a wait time to check info

Feature: Reviewer can discuss proposals

  Background: A proposal exists
    Given a regular User exists
    And a proposal titled "The great Ruby talk"
    And a reviewer User exists
    And that user is logged in

  Scenario: Comment on a proposal
    Given I am on the "proposals" page
    When I follow "Discuss" for "The great Ruby talk"
    And I follow "Comment"
    And I fill in the following:
      | Comment | The comment that I just made |
    And I press the "Create Comment" button
    Then I should be on the coments page for the proposal
    And I should see "The comment that I just made"

  @javascript
  Scenario: Rate a proposal
    Given I am on the "proposals" page
    When I follow "Discuss" for "The great Ruby talk"
    And I choose "2" from "Rank"
    And I follow "Back to Proposals"
    Then I should be on the "proposals" page
    And I wait for 5 seconds
    And I should see "2"


Feature: Configuration

  Scenario Outline: Configure directly
    Given a file named "configuration.rb" with:
    """
    require 'magus'

    <attribute> = "<value>"
    print <attribute>
    """
    When I run `ruby configuration.rb`
    Then the output should contain exactly "<value>"
    And the exit status should be 0

    Examples:
      | attribute        | value                           |
      | Magento.endpoint | http://www.example.com/api/soap |
      | Magento.username | jdoe                            |
      | Magento.api_key  | password                        |

  Scenario Outline: Configure with block syntax
    Given a file named "configuration.rb" with:
      """
      require 'magus'

      Magento.configure do |c|
        <option> = "<value>"
      end

      print <attribute>
      """
    When I run `ruby configuration.rb`
    Then the output should contain exactly "<value>"
    And the exit status should be 0

    Examples:
      | option     | attribute        | value                           |
      | c.endpoint | Magento.endpoint | http://www.example.com/api/soap |
      | c.username | Magento.username | jdoe                            |
      | c.api_key  | Magento.api_key  | password                        |

Add Description to Configuration Feature

Feature: Configuration

  Configure the Magento gem using the configure block syntax
  or configure each option directly.

  Scenario Outline: Configure directly
    Given a file named "configuration.rb" with:
    """
    require 'magus'

    <attribute> = "<value>"
    print <attribute>
    """
    When I run `ruby configuration.rb`
    Then the output should contain exactly "<value>"
    And the exit status should be 0

    Examples:
      | attribute        | value                           |
      | Magento.endpoint | http://www.example.com/api/soap |
      | Magento.username | jdoe                            |
      | Magento.api_key  | password                        |

  Scenario Outline: Configure with block syntax
    Given a file named "configuration.rb" with:
      """
      require 'magus'

      Magento.configure do |c|
        <option> = "<value>"
      end

      print <attribute>
      """
    When I run `ruby configuration.rb`
    Then the output should contain exactly "<value>"
    And the exit status should be 0

    Examples:
      | option     | attribute        | value                           |
      | c.endpoint | Magento.endpoint | http://www.example.com/api/soap |
      | c.username | Magento.username | jdoe                            |
      | c.api_key  | Magento.api_key  | password                        |


Feature: Project creation
  As someone collecting tasks and notes
  I can create a project
  In order to organize my tasks and notes

  Scenario: New projects appear in the list
    Given I display the available pages
    When I add a project named "Birthday" in the source named "TestData/Calendar1"
    And I list the items
    Then the list is:
       | display                           | icon                |
       | Contexts                          | folder              |
       | Contexts / Chores                 | view-pim-tasks      |
       | Contexts / Internet               | view-pim-tasks      |
       | Contexts / Online                 | view-pim-tasks      |
       | Inbox                             | mail-folder-inbox   |
       | Projects                          | folder              |
       | Projects / Read List              | view-pim-tasks      |
       | Projects / Backlog                | view-pim-tasks      |
       | Projects / Prepare talk about TDD | view-pim-tasks      |
       | Projects / Birthday               | view-pim-tasks      |

Fix feature project add test

Feature: Project creation
  As someone collecting tasks and notes
  I can create a project
  In order to organize my tasks and notes

  Scenario: New projects appear in the list
    Given I display the available pages
    When I add a project named "Birthday" in the source named "TestData/Calendar1"
    And I list the items
    Then the list is:
       | display                           | icon                |
       | Contexts                          | folder              |
       | Contexts / Chores                 | view-pim-tasks      |
       | Contexts / Internet               | view-pim-tasks      |
       | Contexts / Online                 | view-pim-tasks      |
       | Inbox                             | mail-folder-inbox   |
       | Projects                          | folder              |
       | Projects / Read List              | view-pim-tasks      |
       | Projects / Backlog                | view-pim-tasks      |
       | Projects / Prepare talk about TDD | view-pim-tasks      |
       | Projects / Birthday               | view-pim-tasks      |
       | Tags                              | folder              |
       | Tags / Philosophy                 | view-pim-tasks      |
       | Tags / Physics                    | view-pim-tasks      |


Feature: Using plugins as part of a genomer project
  In order to use third-party genomer plugins
  A user can specify genomer plugins in a Gemfile
  So that these plugins are available on the command line

  Background:
    Given I have installed the gem "genomer-plugin-fake"

  Scenario: Genomer plugins described in the gem file
    Given I run the genomer command with the arguments "init project"
      And I cd to "project"
      And I append to "Gemfile" with "gem 'genomer-plugin-fake'"
     When I run the genomer command with the arguments "help"
     Then the output should contain:
     """
     genomer COMMAND [options]

     Available commands:
       fake       Fake genomer plugin for testing purposes
     """

  Scenario: Genomer plugins described in the gem file
    Given I run the genomer command with the arguments "init project"
      And I cd to "project"
      And I append to "Gemfile" with ""
     When I run the genomer command with the arguments "help"
     Then the output should contain:
     """
     genomer COMMAND [options]

     Available commands:
     """

Correct indentation on plugin feature


@test
Feature: Go to AngularJs Home Page

  Scenario Outline: Successfully
    Given I was on <url>
    When I enter type <text> in to do list
    Then I should see <expected text> in to do list
    Examples:
      | url                   | text   | expected text |
      | https://angularjs.org | Hello  | Hello         |
      | https://angularjs.org | Hello2 | Hello 2       |

Make Test Protractor Test Pass

@test
Feature: Go to AngularJs Home Page

  Scenario Outline: Successfully
    Given I was on <url>
    When I enter type <text> in to do list
    Then I should see <expected text> in to do list
    Examples:
      | url                   | text   | expected text |
      | https://angularjs.org | Hello  | Hello         |
      | https://angularjs.org | Hello2 | Hello2       |


Feature: Fail fast

  The --fail-fast flag causes Cucumber to exit immediately after the first
  scenario fails.

  Scenario: When a scenario fails
    Given a file named "features/bad.feature" with:
      """
      Feature: Bad
        Scenario: Failing
          Given this step fails
      """
    And a file named "features/good.feature" with:
    """
    Feature: Good
      Scenario: Passing
        Given this step passes
    """
    And the standard step definitions
    When I run `cucumber --fail-fast`
    Then it should fail
    And the output should contain:
    """
    1 scenario (1 failed)
    """

  Scenario: When all the scenarios pass
    Given a file named "features/first.feature" with:
      """
      Feature: first feature
        Scenario: foo first
          Given this step passes
        Scenario: bar first
          Given this step passes
      """
    And a file named "features/second.feature" with:
      """
      Feature: second
        Scenario: foo second
          Given this step passes
        Scenario: bar second
          Given this step passes
      """
    When I run `cucumber --fail-fast`
    Then it should pass

Add @spawn tag to fail-fast feature

@spawn
Feature: Fail fast

  The --fail-fast flag causes Cucumber to exit immediately after the first
  scenario fails.

  Scenario: When a scenario fails
    Given a file named "features/bad.feature" with:
      """
      Feature: Bad
        Scenario: Failing
          Given this step fails
      """
    And a file named "features/good.feature" with:
    """
    Feature: Good
      Scenario: Passing
        Given this step passes
    """
    And the standard step definitions
    When I run `cucumber --fail-fast`
    Then it should fail
    And the output should contain:
    """
    1 scenario (1 failed)
    """

  Scenario: When all the scenarios pass
    Given a file named "features/first.feature" with:
      """
      Feature: first feature
        Scenario: foo first
          Given this step passes
        Scenario: bar first
          Given this step passes
      """
    And a file named "features/second.feature" with:
      """
      Feature: second
        Scenario: foo second
          Given this step passes
        Scenario: bar second
          Given this step passes
      """
    When I run `cucumber --fail-fast`
    Then it should pass


Feature: exit statuses

  In order to specify expected exit statuses
  As a developer using Cucumber
  I want to use the "the exit status should be" step

  Scenario: exit status of 0
    When I run "ruby -h"
    Then the exit status should be 0

  Scenario: non-zero exit status
    When I run "ruby -e 'exit 56'"
    Then the exit status should be 56
    And the exit status should not be 0

  Scenario: Successfully run something
    When I successfully run "ruby -e 'exit 0'"

  Scenario: Unsuccessfully run something
    When I do aruba I successfully run "ruby -e 'exit 10'"
    Then aruba should fail with "Exit status was 10"

Add a scenario for non existant command

Feature: exit statuses

  In order to specify expected exit statuses
  As a developer using Cucumber
  I want to use the "the exit status should be" step

  Scenario: exit status of 0
    When I run "ruby -h"
    Then the exit status should be 0

  Scenario: non-zero exit status
    When I run "ruby -e 'exit 56'"
    Then the exit status should be 56
    And the exit status should not be 0

  Scenario: Successfully run something
    When I successfully run "ruby -e 'exit 0'"

  Scenario: Unsuccessfully run something
    When I do aruba I successfully run "ruby -e 'exit 10'"
    Then aruba should fail with "Exit status was 10"

  Scenario: Try to run something that doesn't exist
    When I run "does_not_exist"
    Then the exit status should be 1


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: Show a map
  As a user
  To see whats in my area
  I would like to see a map of my area

  @javascript
  Scenario: User can see a map, js: true
    Given I navigate to the index page
    And the map has been loaded

Remove js: true to make semaphore build on repository

Feature: Show a map
  As a user
  To see whats in my area
  I would like to see a map of my area

  @javascript
  Scenario: User can see a map
    Given I navigate to the index page
    And the map has been loaded


Feature: Impersonation

Scenario: Enable Impersonation
Given impersonation is disabled
	And I am logged as "Administrator" with password "Control*123"
When I enable Impersonation
Then the Impersonation Option is enabled

Scenario: Disable Impersonation
Given impersonation is enabled
	And I am logged as "Administrator" with password "Control*123"
When I disable Impersonation
Then the Impersonation Option is disabled

Scenario: Change Authentication Type to Credentials
Given authentication type configured as "rfid"
	And I am logged as "Administrator" with password "Control*123"
When I change Authentication to User and Password
Then the Authentication Type is changed to "credentials"

Scenario: Change Authentication Type to RFID
Given authentication type configured as "credentials"
	And I am logged as "Administrator" with password "Control*123"
When I change Authentication to RFID
Then the Authentication Type is changed to "rfid"

Scenario: Impersonation Options are displayed in the Credentials Page
Given impersonation is disabled
	And I am logged as "Administrator" with password "Control*123"
	And I enable Impersonation
When I create a new meeting with subject "My Subject"
Then the Impersonation Options displayed in the Credentials Page

Scenario: Impersonation Option is disabled when there is no Email Server Added
Given a user has logged into Room Manager with an email server added
When there is no Email Server Added to do impersonation
Then Impersonation Option is disabled

Fix Scenarios: Impersonation Scenario Feature Fixed

Feature: Impersonation

Scenario: Enable Impersonation
Given impersonation is disabled
	And I am logged as "Administrator" with password "Control*123"
When I enable Impersonation
Then the Impersonation Option is enabled

Scenario: Disable Impersonation
Given impersonation is enabled
	And I am logged as "Administrator" with password "Control*123"
When I disable Impersonation
Then the Impersonation Option is disabled

Scenario: Change Authentication Type to Credentials
Given authentication type configured as "rfid"
	And I am logged as "Administrator" with password "Control*123"
When I change Authentication to User and Password
Then the Authentication Type is changed to "credentials"

Scenario: Change Authentication Type to RFID
Given authentication type configured as "credentials"
	And I am logged as "Administrator" with password "Control*123"
When I change Authentication to RFID
Then the Authentication Type is changed to "rfid"

Scenario: Impersonation Options are displayed in the Credentials Page
Given impersonation is disabled
	And I am logged as "Administrator" with password "Control*123"
	And I enable Impersonation
When I create a new meeting with subject "My Subject"
Then the Impersonation Options displayed in the Credentials Page

Scenario: Impersonation Option is disabled when there is no Email Server Added
Given a user has logged into Room Manager with no email server added
When there is no Email Server Added to do impersonation
Then Impersonation Option is disabled


Feature: Static Pages
  In order to get more information about Funnies
  As an unregistered user
  I want to view pages giving information about Funnies

  Scenario: Landing Page
    When I go to the homepage
    Then I should see "This is the landing page"

  Scenario: About Page
    When I go to the about page
    Then I should see "This is the about page"

Change expectation for landing page feature

Feature: Static Pages
  In order to get more information about Funnies
  As an unregistered user
  I want to view pages giving information about Funnies

  Scenario: Landing Page
    When I go to the homepage
    Then I should see "Sign up"

  Scenario: About Page
    When I go to the about page
    Then I should see "This is the about page"