@companies-local-nav  @details
Feature: Companies local nav

  @companies-local-nav--staff
  Scenario: Companies local nav as DIT staff

    When I navigate to the `companies.fixture` page using `company` `Venus Ltd` fixture
    Then there should be a local nav
      | text                      |
      | Details                   |
      | Contacts                  |
      | Interactions              |
      | Investment                |
      | Export                    |
      | Orders (OMIS)             |
      | Documents                 |
      | Audit history             |

  @companies-local-nav--lep @lep
  Scenario: Companies local nav as LEP

    When I navigate to the `companies.fixture` page using `company` `Venus Ltd` fixture
    Then there should be a local nav
      | text                      |
      | Details                   |
      | Contacts                  |
      | Investment                |
      | Export                    |
      | Audit history             |

  @companies-local-nav--da @da
  Scenario: Companies local nav as DA

    When I navigate to the `companies.fixture` page using `company` `Venus Ltd` fixture
    Then there should be a local nav
      | text                      |
      | Details                   |
      | Contacts                  |
      | Investment                |
      | Export                    |
      | Orders (OMIS)             |
      | Audit history             |

@companies-local-nav  @details
Feature: Companies local nav

  @companies-local-nav--staff
  Scenario: Companies local nav as DIT staff

    When I navigate to the `companies.fixture` page using `company` `Venus Ltd` fixture
    Then there should be a local nav
      | text                      |
      | Details                   |
      | Contacts                  |
      | Advisers                  |
      | Interactions              |
      | Investment                |
      | Export                    |
      | Orders (OMIS)             |
      | Documents                 |
      | Audit history             |

  @companies-local-nav--lep @lep
  Scenario: Companies local nav as LEP

    When I navigate to the `companies.fixture` page using `company` `Venus Ltd` fixture
    Then there should be a local nav
      | text                      |
      | Details                   |
      | Contacts                  |
      | Advisers                  |
      | Investment                |
      | Export                    |
      | Audit history             |

  @companies-local-nav--da @da
  Scenario: Companies local nav as DA

    When I navigate to the `companies.fixture` page using `company` `Venus Ltd` fixture
    Then there should be a local nav
      | text                      |
      | Details                   |
      | Contacts                  |
      | Advisers                  |
      | Investment                |
      | Export                    |
      | Orders (OMIS)             |
      | Audit history             |

Add Advisers to local nav test

Add Advisers to local nav test

This is now added as a test fixture so it will be
present in the local nav


Feature: Setting request headers

  We recommend you to switch to request specs instead of controller specs if you want to set
  headers in your call.  If you still want to set headers in controller specs, you can use
  `request.headers` as mentioned bellow.

  Scenario: Setting a header value in a controller spec
    Given a file named "spec/controllers/application_controller_spec.rb" with:
      """ruby
      require "rails_helper"

      RSpec.describe ApplicationController, type" :controller do
        controller do
          def show
            if request.headers["Authorization"] == "foo"
              head :ok
            else
              head :forbidden
            end
          end
        end

        before do
          routes.draw { get "show" => "anonymous#show" }
        end

        context "valid Authorization header" do
          it "returns a 200" do
            request.headers["Authorization"] = "foo"

            get :show

            expect(response).to have_http_status(:ok)
          end
        end

        context "invalid Authorization header" do
          it "returns a 403" do
            request.headers["Authorization"] = "bar"

            get :show

            expect(response).to have_http_status(:forbidden)
          end
        end
      end
      """
    When I run `rspec spec`
    Then the example should pass

Feature: Setting request headers

  We recommend you to switch to request specs instead of controller specs if you want to set
  headers in your call.  If you still want to set headers in controller specs, you can use
  `request.headers` as mentioned bellow.

  Scenario: Setting a header value in a controller spec
    Given a file named "spec/controllers/application_controller_spec.rb" with:
      """ruby
      require "rails_helper"

      RSpec.describe ApplicationController, type: :controller do
        controller do
          def show
            if request.headers["Authorization"] == "foo"
              head :ok
            else
              head :forbidden
            end
          end
        end

        before do
          routes.draw { get "show" => "anonymous#show" }
        end

        context "valid Authorization header" do
          it "returns a 200" do
            request.headers["Authorization"] = "foo"

            get :show

            expect(response).to have_http_status(:ok)
          end
        end

        context "invalid Authorization header" do
          it "returns a 403" do
            request.headers["Authorization"] = "bar"

            get :show

            expect(response).to have_http_status(:forbidden)
          end
        end
      end
      """
    When I run `rspec spec`
    Then the example should pass

Fix typo in "type: :controller"

Fix typo in "type: :controller"


Feature: List Active Computers
    As an authorized tenant
    I want to be able to see a list of my active_computers

    Background: Test GET /active/computers
        Given the account is an authorized tenant
        And the active_computers client URL is /active/computers

    # /active/computers
    @positive @p0 @smoke
    Scenario: Get list of active_computers
        When I get the list of active_computers
        Then the active_computers response status is 200 OK
        And the response contains a list of active_computers

    # /active/computers - params
    @positive @p0 @smoke @not-tested
    Scenario: Get list of active_computers with parameters
        When I get with parameters the list of active_computers
        # TODO anything else?
        Then the active_computers response status is 200 OK
        And the response contains a list of active_computers

    # /active/computers - bad method
    @negative @p1
    Scenario: Post instead of getting list of active_computers
        When I use post on active_computers
        Then the active_computers response status is 405 METHOD NOT ALLOWED

Feature: List Active Computers
    As an authorized tenant
    I want to be able to see a list of my active_computers

    Background: Test GET /active/computers
        Given the account is an authorized tenant
        And the active_computers client URL is /active/computers

    # /active/computers
    @positive @p0 @smoke
    Scenario: Get list of active_computers
        When I get the list of active_computers
        Then the active_computers response status is 200 OK
        And the response contains a list of active_computers

    # /active/computers - bad method
    @negative @p1
    Scenario: Post instead of getting list of active_computers
        When I use post on active_computers
        Then the active_computers response status is 405 METHOD NOT ALLOWED

Remove test in progress from pr

Remove test in progress from pr


Feature: Change working directory

  You might want to change the current working directory.

  Background:
    Given I use a fixture named "cli-app"

  Scenario: Change to an existing sub directory
    Given a file named "features/non-existence.feature" with:
    """
    Feature: Working Directory
      Scenario: Working Directory
        Given a file named "foo/bar/example.txt" with:
        \"\"\"
        hello world
        \"\"\"
        When I cd to "foo/bar"
        And I run `cat example.txt`
        Then the output should contain "hello world"
        And the file "example.txt" should exist
    """
    When I run `cucumber`
    Then the features should all pass

  Scenario: Change to an non-existing sub directory
    Given a file named "features/non-existence.feature" with:
    """
    Feature: Working Directory
      Scenario: Working Directory
        When I cd to "foo/bar/non-existing"
    """
    When I run `cucumber`
    Then the features should not pass

Feature: Change working directory

  You might want to change the current working directory.

  Background:
    Given I use a fixture named "cli-app"

  Scenario: Change to an existing sub directory
    Given a file named "features/existence.feature" with:
    """
    Feature: Working Directory
      Scenario: Working Directory
        Given a file named "foo/bar/example.txt" with:
        \"\"\"
        hello world
        \"\"\"
        When I cd to "foo/bar"
        And I run `cat example.txt`
        Then the output should contain "hello world"
        And the file "example.txt" should exist
    """
    When I run `cucumber`
    Then the features should all pass

  Scenario: Change to an non-existing sub directory
    Given a file named "features/non-existence.feature" with:
    """
    Feature: Working Directory
      Scenario: Working Directory
        When I cd to "foo/bar/non-existing"
    """
    When I run `cucumber`
    Then the features should not pass

  Scenario: Change to home directory
    Given a file named "features/home.feature" with:
    """
    Feature: Working Directory
      Scenario: Working Directory
        Given a file named "example.txt" with:
        \"\"\"
        hello world
        \"\"\"
        When I cd to "~"
        And I run `cat example.txt`
        Then the output should contain "hello world"
        And the file "example.txt" should exist
    """
    When I run `cucumber`
    Then the features should all pass

Add scenario for cd-ing to '~'

Add scenario for cd-ing to '~'


Feature: I want to display features on a web page for other people to view

  Background: I've navigated to a page which displays features
    Given this file as a feature
    And I am on "/"

  Scenario: I want to see a scenario with some text
    Then I should see the contents of this feature
    And I should see
    """
    This text rendered beautifully.
    As well as this text.
    """

  Scenario: I want to see a scenario with a table
    Then I should see a table which looks like
    | word             | colour | thing |
    | Background       | blue   | red   |
    | Background       | blue   | red   |

  Scenario Outline: I want to see a scenario outline with a table
    Then I should see a table which contains "<word>" "<colour>"
  Examples:
    | word             | colour |
    | Background       | blue   |
    | Feature          | red    |
    | Scenario         | green  |
    | Scenario Outline | orange |
    | Given            | yellow |
    | And              | white  |
    | Then             | black  |
    | Examples         | brown  |

Feature: I want to display features on a web page for other people to view

  Background: I've navigated to a page which displays features
    Given this file as a feature
    And I am on "/feature/I want to display features on a web page for other people to view"

  Scenario: I want to see a scenario with some text
    Then I should see the contents of this feature
    And I should see
    """
    This text rendered beautifully.
    As well as this text.
    """

  Scenario: I want to see a scenario with a table
    Then I should see a table which looks like
    | word             | colour | thing |
    | Background       | blue   | red   |
    | Background       | blue   | red   |

  Scenario Outline: I want to see a scenario outline with a table
    Then I should see a table which contains "<word>" "<colour>"
  Examples:
    | word             | colour |
    | Background       | blue   |
    | Feature          | red    |
    | Scenario         | green  |
    | Scenario Outline | orange |
    | Given            | yellow |
    | And              | white  |
    | Then             | black  |
    | Examples         | brown  |

Stop displaying features from / display

Stop displaying features from / display


@viewing_products
Feature: Viewing different price for different product variants selected with options
    In order to see product variant price
    As a Visitor
    I want to be able to see a proper price for each product variant

    Background:
        Given the store operates on a single channel in "United States"
        And the store has a "Wyborowa Vodka" configurable product
        And this product has option "Volume" with values "0,5L", "0,7L" and "1L"
        And this product is available in "0,5L" volume priced at "$20.00"
        And this product is available in "0,7L" volume priced at "$25.00"

    @ui
    Scenario: Viewing a detailed page with product's price
        When I view product "Wyborowa Vodka"
        Then I should see the product price "$20.00"

    @ui
    Scenario: Viewing a detailed page with product's price when first variant is disabled
        Given this product "0,5L" volume variant is disabled
        When I view product "Wyborowa Vodka"
        Then I should see the product price "$25.00"

    @ui @javascript
    Scenario: Viewing a detailed page with product's price for different option
        When I view product "Wyborowa Vodka"
        And I set its volume to "0,7L"
        Then I should see the product price "$25.00"

    @ui @javascript
    Scenario: Viewing an unavailable message if selected option combination is unavailable
        When I view product "Wyborowa Vodka"
        And I set its volume to "1L"
        Then the product price should be "Unavailable"
        Then I should be unable to add it to the cart

    @ui @javascript
    Scenario: Viewing an unavailable message if selected option combination is disabled
        Given this product "0,5L" volume variant is disabled
        When I view product "Wyborowa Vodka"
        And I set its volume to "0,5L"
        Then the product price should be "Unavailable"
        Then I should be unable to add it to the cart

@viewing_products
Feature: Viewing different price for different product variants selected with options
    In order to see product variant price
    As a Visitor
    I want to be able to see a proper price for each product variant

    Background:
        Given the store operates on a single channel in "United States"
        And the store has a "Wyborowa Vodka" configurable product
        And this product has option "Volume" with values "0,5L", "0,7L" and "1L"
        And this product is available in "0,5L" volume priced at "$20.00"
        And this product is available in "0,7L" volume priced at "$25.00"

    @ui
    Scenario: Viewing a detailed page with product's price
        When I view product "Wyborowa Vodka"
        Then I should see the product price "$20.00"

    @ui @javascript
    Scenario: Viewing a detailed page with product's price for different option
        When I view product "Wyborowa Vodka"
        And I set its volume to "0,7L"
        Then I should see the product price "$25.00"

Remove viewing prices of not available variants behat scenarios


Feature: Highways Controller

  Scenario: request index
    When I request "highways"
    Then the response status code should be 200
    And the response is JSON
    And the type is "array"

  Scenario: request valid highwayid
    When I request "highways/1"
    Then the response status code should be 200
    And the response is JSON
    And the type is "object"

  Scenario: request invalid highwayid
    When I request "highways/666"
    Then the response status code should be 404
    And the response is JSON
    And the type is "object"
    # And the response object's properties should be...

  Scenario: request stations for valid highwayid
    When I request "highways/1/stations"
    Then the response status code should be 200
    And the response is JSON
    And the type is "array"

  Scenario: request stations for invalid highwayid
    When I request "highways/666/stations"
    Then the response status code should be 404
    And the response is JSON
    And the type is "object"
    # And the response object's properties should be...

Feature: Highways Controller

  Scenario: request index
    When I request "highways"
    Then the response status code should be 200
    And the response is JSON
    And the type is "array"

  Scenario: request valid highwayid
    When I request "highways/1"
    Then the response status code should be 200
    And the response is JSON
    And the type is "object"

  Scenario: request invalid highwayid
    When I request "highways/666"
    Then the response status code should be 404
    And the response is JSON
    And the type is "object"
    # And the response object's properties should be...

  Scenario Outline: I get the proper HTTP status code
    When I request "highways/<id>"
    Then the response status code should be <res_code>
    And the response is JSON

    Examples:
    | id | res_code |
    | 8  | 404      |
    | 9  | 200      |
    | 10 | 200      |
    | 11 | 404      |

  Scenario: request stations for valid highwayid
    When I request "highways/1/stations"
    Then the response status code should be 200
    And the response is JSON
    And the type is "array"

  Scenario: request stations for invalid highwayid
    When I request "highways/666/stations"
    Then the response status code should be 404
    And the response is JSON
    And the type is "object"
    # And the response object's properties should be...

Add example test for checking status codes of multiple requests


Feature: API accessible
  In order to provice the user with interesting information over the wire
  As a user of the applications statistics
  I want to be able to make API requests

  @wip
  Scenario: I should be able to add a plugin and can access to its own method
    Given I have a application I want to track
    When I created the following plugin
    """
    Nark::Plugin.define :status_codes do |plugin|
      plugin.variables :status_codes => []

      plugin.add_hook :after_response do |status_code, header, body, env|
        plugin.status_codes << {:status => status_code, :path => env['PATH_INFO']}
      end
    end
    """
    When the API is started
    Then I should be able to access "/status_codes"

  @wip
  Scenario: The API service does not affect the main application
    Given I have a application I want to track
    When I created the following plugin
    """
    Nark::Plugin.define :status_codes do |plugin|
      plugin.variables :status_codes => []

      plugin.add_hook :after_response do |status_code, header, body, env|
        plugin.status_codes << {:status => status_code, :path => env['PATH_INFO']}
      end
    end
    """
    When the API is started
    And I visit "http://example.com:2309/status_codes"
    Then the "status_codes" should be []

Feature: API accessible
  In order to provice the user with interesting information over the wire
  As a user of the applications statistics
  I want to be able to make API requests

  @wip
  Scenario: I should be able to add a plugin and can access to its own method
    Given I have a application I want to track
    When I created the following plugin
    """
    Nark::Plugin.define :status_codes do |plugin|
      plugin.variables :status_codes => []

      plugin.add_hook :after_call do |status_code, header, body, env|
        plugin.status_codes << {:status => status_code, :path => env['PATH_INFO']}
      end
    end
    """
    When the API is started
    Then I should be able to access "/nark/status_codes"

  @wip
  Scenario: The API service does not affect the main application
    Given I have a application I want to track
    When I created the following plugin
    """
    Nark::Plugin.define :status_codes do |plugin|
      plugin.variables :status_codes => []

      plugin.add_hook :after_call do |status_code, header, body, env|
        plugin.status_codes << {:status => status_code, :path => env['PATH_INFO']}
      end
    end
    """
    When the API is started
    And I visit "http://example.com:2309/status_codes"
    Then the "status_codes" should be []

Tweak scenario so that it no longer uses after_response


Feature: autofill breeder name into breeder forms

  So that I can add a pup to or search by a breeder
  I want to be able to see the breeder name autofill into the form
  I should also have the option to add a new breeder if it isn't shown

  Background: breeders have been added to the database

    Given the following breeders exist:
      | name            |
      | Carl            |
      | Chris           |
      | Alex            |
      | Alexander       |
      | Michael Jackson |

    And I am on the RateMyPup home page

  Scenario: fill all breeders that start with C
    When I enter "C" into "breeders_select"
    Then I should see "Chris"
    And I should see "Carl"
    And I should not see "Alex"
    And I should see "Add breeder"

  Scenario: fill all breeders that start with a substring
    When I enter "Alex" into "breeders_select"
    Then I should see "Alex"
    And I should see "Alexander"
    And I should not see "Carl"
    And I should not see "Michael Jackson"
    And I should see "Add breeder"

  Scenario: redirect to create new breeder
    When I enter "JMac" into "breeders_select"
    And I should not see "Carl"
    And I should not see "Michael Jackson"
    And I should see "Add breeder"
    When I press "Add breeder"
    Then I should be on the "Add breeder" page

Feature: autofill breeder name into breeder forms
  As a potential dog owner
  So that I can add a pup to or search by a breeder
  I want to be able to see the breeder name autofill into the form or add a new breeder if it isn't shown

  Background: breeders have been added to the database

    Given the following breeders exist:
      | name            |
      | Carl            |
      | Chris           |
      | Alex            |
      | Alexander       |
      | Michael Jackson |

    And I am on the RateMyPup home page

  Scenario: fill all breeders that start with C
    When I enter "C" into "breeders_select"
    Then I should see "Chris"
    And I should see "Carl"
    And I should not see "Alex"
    And I should see "Add breeder"

  Scenario: fill all breeders that start with a substring
    When I enter "Alex" into "breeders_select"
    Then I should see "Alex"
    And I should see "Alexander"
    And I should not see "Carl"
    And I should not see "Michael Jackson"
    And I should see "Add breeder"

  Scenario: redirect to create new breeder
    When I enter "JMac" into "breeders_select"
    And I should not see "Carl"
    And I should not see "Michael Jackson"
    And I should see "Add breeder"
    When I press "Add breeder"
    Then I should be on the "Add breeder" page

Fix the language on auto_fill_breeder

Fix the language on auto_fill_breeder


@vcr
Feature: Breadcrumbs
  As a user reading an article
  I want to understand where the article belongs
  And be able to quickly navigate to parents so that I can orientate myself

  Scenario Outline: Breadcrumb on an article page
    Given I am on an <language> Article that lives in a single Category
    Then I should see the <language> article's category hierarchy

    Examples:
    | language |
    | English  |
    | Welsh    |

  Scenario Outline: Related categories breadcrumb on an article page
    Given I am on an <language> Article that lives in multiple Categories
    Then I should see the related categories in <language>

    Examples:
    | language |
    | English  |
    | Welsh    |

  Scenario: Remove breadcrumb for articles without categories
    Given I am on an Article that does not belong to any category
    Then I should not see the breadcrumbs area

@vcr
Feature: Breadcrumbs
  As a user reading an article
  I want to understand where the article belongs
  And be able to quickly navigate to parents so that I can orientate myself

  Scenario Outline: Breadcrumb on an article page
    Given I am on an <language> Article that lives in a single Category
    Then I should see the <language> article's category hierarchy

    Examples:
    | language |
    | English  |
    | Welsh    |

  Scenario Outline: Related categories breadcrumb on an article page
    Given I am on an <language> Article that lives in multiple Categories
    Then I should see the related categories in <language>

    Examples:
    | language |
    | English  |
    | Welsh    |

  @fake-articles
  Scenario: Remove breadcrumb for articles without categories
    Given I am on an Article that does not belong to any category
    Then I should not see the breadcrumbs area

Annotate scenario to avoid conflicts with other features


Feature: Dashboard
    As an authenticated user
    I want to select some zones and specify a time
    So that I can schedule portions of my yard to be watered

    Scenario: Attempting to reach the Dashboard unauthenticated
        Given I navigate directly to the dashboard
        Then I return to the home page

    Scenario: Visiting the Dashboard
        Given I am on the home page
        And I enter "c3667b81-92a6-4913-b83c-64cc713cbc1e" into the token field
        And I click the "submitToken" button
        Then I should see "Devices"
        And I should see "Please select a device"

    Scenario: Selecting a Device
        Given I am on the dashboard
        And I select "device-0"
        Then I should see "Zones"

    Scenario: Selecting a Zone
        Given I am on the dashboard
        And I check "zone-0"
        Then I should see "Schedule"

Feature: Dashboard
    As an authenticated user
    I want to select some zones and specify a time
    So that I can schedule portions of my yard to be watered

    Scenario: Attempting to reach the Dashboard unauthenticated
        Given I navigate directly to the dashboard
        Then I return to the home page

    Scenario: Visiting the Dashboard
        Given I am on the home page
        And I enter "c3667b81-92a6-4913-b83c-64cc713cbc1e" into the token field
        And I click the "submitToken" button
        Then I should see "Devices"

    Scenario: Selecting a Device
        Given I am on the dashboard
        And I select "device-0"
        Then I should see "Zones"

    Scenario: Selecting a Zone
        Given I am on the dashboard
        And I check "zone-0"
        Then I should see "Schedule"

Remove the need to select a device

Remove the need to select a device

Default to the first device so this info message is no longer seen.


# encoding: UTF-8
# language: no

@wip
Egenskap: Import av låner
  Som låner, registrert i gammelt system
  For å kunne låne bøker fra Hjørnebiblioteket
  Ønsker jeg å bli låner hos Hjørnebiblioteket

  @wip
  Scenario:
    Gitt at det finnes data som beskriver en låner "Kari"
    Og at "Kari" ikke finnes som låner
    Når dataene importeres til systemet
    Så registrerer systemet at "Kari" er låner

# encoding: UTF-8
# language: no

@wip
Egenskap: Import av låner
  Som adminbruker
  For å slippe å registrere eksisterende lånere på nytt
  Ønsker jeg å importere lånerdata fra eksisterende system

  @wip
  Scenario:
    Gitt at det finnes data som beskriver en låner "Kari"
    Og at "Kari" ikke finnes som låner
    Når dataene importeres til systemet
    Så registrerer systemet at "Kari" er låner

Change property to use administrator as subject


@buyer-dashboard
Feature: Buyer Dashboard

Scenario: Users should see new Dashboard
  Given I am logged in as a buyer user
  And I am on the /buyers page
  Then I see 'Cloud hosting, software and support' text on the page
  And I see 'Digital outcomes, specialists and user research' text on the page

Scenario: Users should see link when there are searches available to view
  Given I am logged in as a buyer user
  And I have created and saved a search called 'my cloud project'
  And I am on the /buyers page
  Then I see the 'View your saved searches' link

Scenario: Users should see message when no searches are created
  Given I am logged in as a buyer user
  And I am on the /buyers page
  Then I see 'You don't have any saved searches' text on the page

Scenario: Users should see message when no requirements are created
  Given I am logged in as a buyer user
  And I am on the /buyers page
  Then I see 'You don't have any requirements' text on the page

Scenario: New users should have a link to join the use research mailing list
  Given I am logged in as a buyer user
  When I am on the /buyers page
  Then I see the 'Join the user research mailing list' link

Scenario: Users on the mailing list should have the link to unsubscribe
  Given I am logged in as a buyer user
  And that user is on the user research mailing list
  When I am on the /buyers page
  Then I see the 'Unsubscribe from the user research mailing list' link

Add checks for user research banner on buyer account page


Feature: Install Vim plugins
  As a lazy Vim user
  I want to install Vim plugins
  without pain

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

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

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

  Scenario: Install to specified path
    Given flavorfile
      """
      flavor '$foo_uri'
      """
    When I run vim-flavor with 'install --vimfiles-path=$tmp'
    Then I get lockfile
      """
      $foo_uri (1.0.2)
      """
    And I get a bootstrap script in '$tmp'
    And I get flavor 'foo' with '1.0.2' in '$tmp'

Feature: Install Vim plugins
  As a lazy Vim user
  I want to install Vim plugins
  without pain

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

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

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

  @wip
  Scenario: Install to specified path
    Given flavorfile
      """
      flavor '$foo_uri'
      """
    When I run vim-flavor with 'install --vimfiles-path=$tmp'
    Then I get lockfile
      """
      $foo_uri (1.0.2)
      """
    And I get a bootstrap script in '$tmp'
    And I get flavor 'foo' with '1.0.2' in '$tmp'

Mark scenarios for the next iteration

Mark scenarios for the next iteration


@JIRA_DS1005
Feature: As a Data Browser User, I want to view the count of all students, staff, and teachers that have ever had an association with my EdOrgs and all the EdOrgs below them, and the number currently associated, so that I can use these counts to ensure my data imports loaded the correct number of records.
Background:
Given I have an open web browser
And I navigated to the Data Browser Home URL
And I was redirected to the Realm page
And I choose realm "Illinois Daybreak School District 4529" in the drop-down list
And I click on the realm page Go button
And I was redirected to the "Simple" IDP Login page

Scenario: Seeing the counts table on the homepage as a staff member
  When I submit the credentials "jstevenson" "jstevenson1234" for the "Simple" login page
  When I navigated to the Data Browser Home URL
  Then I should see a table for counts
    And my counts for <type> are <ever> and <current>
    |type		|ever	|current|
    |Staff		|12	|12	|
    |Students		|124	|124	|
    |Teachers		|4	|4	|
    |Non-Teachers	|8	|8	|

Scenario: Not seeing the counts table on the homepage as a student
  When I submit the credentials "carmen.ortiz" "carmen.ortiz1234" for the "Simple" login page
  When I navigated to the Data Browser Home URL
  Then I should not see a table for counts

@JIRA_DS1005
Feature: As a Data Browser User, I want to view the count of all students, staff, and teachers that have ever had an association with my EdOrgs and all the EdOrgs below them, and the number currently associated, so that I can use these counts to ensure my data imports loaded the correct number of records.
Background:
Given I have an open web browser
And I navigated to the Data Browser Home URL
And I was redirected to the Realm page
And I choose realm "Illinois Daybreak School District 4529" in the drop-down list
And I click on the realm page Go button
And I was redirected to the "Simple" IDP Login page

Scenario: Seeing the counts table on the homepage as a staff member
  When I submit the credentials "jstevenson" "jstevenson1234" for the "Simple" login page
  When I navigated to the Data Browser Home URL
  Then I should see a table for counts
    And my counts for <type> are <ever> and <current>
    |type		|ever	|current|
    |Staff      |16 |16 |
    |Students       |127    |126    |
    |Teachers       | 5 | 5 |
    |Non-Teachers   |13 |12 |

Scenario: Not seeing the counts table on the homepage as a student
  When I submit the credentials "carmen.ortiz" "carmen.ortiz1234" for the "Simple" login page
  When I navigated to the Data Browser Home URL
  Then I should not see a table for counts

Update tests because of additional test data


Feature: Naming

  When inserting or using a cassette, the first argument is the cassette name.
  You can use any string for the name.  VCR will sanitize the string before
  using it as a file name, so that it is a file-system friendly file name.

  Scenario: Name sanitizing
    Given a file named "name_sanitizing.rb" with:
      """
      require 'vcr_cucumber_helpers'

      start_sinatra_app(:port => 7777) do
        get('/') { "Hello" }
      end

      require 'vcr'

      VCR.config do |c|
        c.cassette_library_dir = 'cassettes'
        c.stub_with :fakeweb
      end

      VCR.use_cassette('Fee, Fi Fo Fum', :record => :new_episodes) do
        Net::HTTP.get_response('localhost', '/', 7777)
      end
      """
     And the directory "cassettes" does not exist
    When I run "ruby name_sanitizing.rb"
    Then the file "cassettes/fee_fi_fo_fum.yml" should contain "body: Hello"

Feature: Naming

  When inserting or using a cassette, the first argument is the cassette name.
  You can use any string for the name.  VCR will sanitize the string before
  using it as a file name, so that it is a file-system friendly file name.

  Scenario: Name sanitizing
    Given a file named "name_sanitizing.rb" with:
      """
      require 'vcr_cucumber_helpers'

      start_sinatra_app(:port => 7777) do
        get('/') { "Hello" }
      end

      require 'vcr'

      VCR.config do |c|
        c.cassette_library_dir = 'cassettes'
        c.stub_with :fakeweb
      end

      VCR.use_cassette('Fee, Fi Fo Fum', :record => :new_episodes) do
        Net::HTTP.get_response('localhost', '/', 7777)
      end
      """
     And the directory "cassettes" does not exist
    When I run "ruby name_sanitizing.rb"
    Then the file "cassettes/Fee_Fi_Fo_Fum.yml" should contain "body: Hello"

Fix capitalization of cassette name.

Fix capitalization of cassette name.

This cuke should hopefully pass travis now.


Feature: Past meetings page

  Scenario: No past meetings
    Given there are no past meetings
    And there is 1 upcoming meeting
    When I visit the 'Past Meetings' page
    Then I should see the text "We haven't had any meetings yet!"
    And I should see a link to the 'Upcoming Meetings' page

  Scenario: Two past meetings
    Given there are 2 past meetings
    And there is 1 upcoming meeting
    When I visit the 'Past Meetings' page
    Then I should see 2 meetings listed

  Scenario: User is not logged in
    Given I am not logged in
    And there are 2 past meetings
    When I visit the 'Past Meetings' page
    Then I should not see the text "Edit"
    And I should not see the text "Delete"

Add second scenario verifying behavior when a user is not logged in


txacme.challenges.LibcloudDNSResponder implements a dns-01 challenge responder using libcloud. Installing txacme[libcloud] is necessary to pull in the dependencies for this.

Expand on news fragment a bit.

Expand on news fragment a bit.


@reset-password @notify @skip-staging
Feature: Reset user password

Scenario: Request password reset
  Given I have a buyer user
  And I am on the /user/reset-password page
  When I enter that user.emailAddress in the 'Email address' field
  And I click 'Send reset email' button
  Then I see a success banner message containing 'send a link to reset the password'
  And I receive a 'reset-password' email for that user.emailAddress
  And I wait 2 seconds to ensure the reset token is valid
  And I click the link in that email
  Then I am on the 'Reset password' page
  When I enter that user.password in the 'Password' field
  And I enter that user.password in the 'Confirm password' field
  And I click 'Reset password' button
  Then I am on the 'Log in to the Digital Marketplace' page
  And I see a success banner message containing 'You have successfully changed your password.'

@reset-password @notify @skip-staging
Feature: Reset user password

Scenario: Request password reset
  Given I have a buyer user
  And I wait 2 seconds to ensure the reset token is created after the user
  And I am on the /user/reset-password page
  When I enter that user.emailAddress in the 'Email address' field
  And I click 'Send reset email' button
  Then I see a success banner message containing 'send a link to reset the password'
  And I receive a 'reset-password' email for that user.emailAddress
  And I click the link in that email
  Then I am on the 'Reset password' page
  When I enter that user.password in the 'Password' field
  And I enter that user.password in the 'Confirm password' field
  And I click 'Reset password' button
  Then I am on the 'Log in to the Digital Marketplace' page
  And I see a success banner message containing 'You have successfully changed your password.'

Move wait to between user and token creation

We added a wait to ensure that there was a time difference between user
creation and token creation for password resets. When the token is
decrypted it checks that the token was created after the user.

Unfortunately I put the wait in the wrong place so we have the same
issue. Moving it hear ensures that the token is created after the user.


Feature: Generating pairwise data
  In order to test small, managable datasets while having confidence in test coverage
  As a tester
  I want a set of tests which is smaller than all the possible combinations of my specified inputs

Scenario:
  Given I have the yaml file "inputs.yml" containing:
     """
     media: [Image, Video, Music]
     event with image: [Football, Basketball, Soccer]
     event without image: [Football, Basketball, Soccer]
     """
  When I run pairwise inputs.yml
  Then I should see the output
    """
    | media | event without image | event with image |
    | Image | Football            | Football         |
    | Image | Basketball          | Basketball       |
    | Image | Soccer              | Soccer           |
    | Video | Football            | Soccer           |
    | Video | Basketball          | Soccer           |
    | Video | Soccer              | Soccer           |
    | Music | Football            | Basketball       |
    | Music | Basketball          | Soccer           |
    | Music | Soccer              | Soccer           |

    """

Feature: Generating pairwise data
  In order to test small, managable datasets while having confidence in test coverage
  As a tester
  I want a set of tests which is smaller than all the possible combinations of my specified inputs

Scenario:
  Given I have the yaml file "inputs.yml" containing:
     """
     event with image: [Football, Basketball, Soccer]
     event without image: [Football, Basketball, Soccer]
     media: [Image, Video, Music]
     """
  When I run pairwise inputs.yml
  Then I should see the output
    """
    | event with image | event without image | media |
    | Football         | Football            | Image |
    | Football         | Basketball          | Video |
    | Football         | Soccer              | Music |
    | Basketball       | Football            | Music |
    | Basketball       | Basketball          | Image |
    | Basketball       | Soccer              | Video |
    | Soccer           | Football            | Image |
    | Soccer           | Basketball          | Music |
    | Soccer           | Soccer              | Music |

    """

Tweak feature so inputs and hence outputs are ordered in a more logical way.


Feature: Post Configuration Hook [#423]

  In order to extend Cucumber
  As a developer
  I want to manipulate the Cucumber configuration after it has been created

  Scenario: Using options directly gets a deprecation warning

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.options[:blah]
      end
      """
    When I run cucumber features
    Then STDERR should match
      """
      Deprecated
      """

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.formats << ['html', config.out_stream]
      end
      """
    When I run cucumber features
    Then STDERR should be empty
    And the output should contain
      """
      html
      """

  Scenario: feature directories read from configuration

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.out_stream << "AfterConfiguration hook read feature directories: #{config.feature_dirs.join(', ')}"
      end
      """
    When I run cucumber features
    Then STDERR should be empty
    And the output should contain
      """
      AfterConfiguration hook read feature directories: features
      """

Feature: Post Configuration Hook [#423]

  In order to extend Cucumber
  As a developer
  I want to manipulate the Cucumber configuration after it has been created

  Scenario: Using options directly gets a deprecation warning

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.options[:blah]
      end
      """
    When I run `cucumber features`
    Then the stderr should contain:
      """
      Deprecated
      """

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.formats << ['html', config.out_stream]
      end
      """
    When I run `cucumber features`
    Then the stderr should not contain anything
    And the output should contain:
      """
      html
      """

  Scenario: feature directories read from configuration

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.out_stream << "AfterConfiguration hook read feature directories: #{config.feature_dirs.join(', ')}"
      end
      """
    When I run `cucumber features`
    Then the stderr should not contain anything
    And the output should contain:
      """
      AfterConfiguration hook read feature directories: features
      """

Update steps to Aruba steps

Update steps to Aruba steps


Feature: A user can share information about a deployed application with a social network
  As a user
  I want to be able to share my deployed application with my friends on my social networks
  So that I can spread the word about the deploy

  Background:
    Given the following apps have been created
      | Name       |
      | First App  |
      | Second App |
      | Third App  |
      | Fourth App |
    And I choose to deploy "First App"
    And I live in "Norfolk, VA"
    And I belong to the brigade "Test Brigade"
    And I successfully deploy the application "First App"

  Scenario: User able to share to their social networks by clicking a button on the deployed app show page
    When I click the button to share the deployed application
    Then I should be able to share with my facebook and twitter networks

Feature: A user can share information about a deployed application with a social network
  As a user
  I want to be able to share my deployed application with my friends on my social networks
  So that I can spread the word about the deploy

  Background:
    Given the following apps have been created
      | Name       |
      | First App  |
      | Second App |
      | Third App  |
      | Fourth App |
    And I have registered for an account with "testman@example.com"
    And I choose to deploy "First App"
    And I live in "Norfolk, VA"
    And I belong to the brigade "Test Brigade"
    And I successfully deploy the application "First App"

  Scenario: User able to share to their social networks by clicking a button on the deployed app show page
    When I click the button to share the deployed application
    Then I should be able to share with my facebook and twitter networks

Fix story that went red resutling from the merge

- There are two failures I couldn't fix and I think its due to a race
  condition because they pass when I do it manually. Going to stop for
  now so I can deploy


Feature: Publish results

  Scenario: Single passing step
    Given a file named "features/step_definitions/steps.rb" with:
      """
      Given(/pass/) { }
      """
    And a file named "features/pass.feature" with:
      """
      Feature: Test feature
        Scenario: Test scenario
          Given passing
      """
    When I run `cucumber -f Cucumber::Pro`
    Then the Cucumber Pro results endpoint should receive JSON:
      """
      [
        {
          "path":"features/pass.feature",
          "line":3,
          "status":"passed",
          "rev":"4",
          "run":"123"
        }
      ]
      """

Feature: Publish results

  Scenario: Single passing step
    Given a git repo with remote "origin" at "git@github.com:cucumber-ltd/cucumber-pro-test.git"
    Given a file named "features/step_definitions/steps.rb" with:
      """
      Given(/pass/) { }
      """
    And a file named "features/pass.feature" with:
      """
      Feature: Test feature
        Scenario: Test scenario
          Given passing
      """
    When I run `cucumber -f Cucumber::Pro`
    Then the "api/github/cucumber-ltd/cucumber-pro-test/results" endpoint should receive JSON:
      """
      [
        {
          "path":"features/pass.feature",
          "line":3,
          "status":"passed",
          "rev":"4",
          "run":"123"
        }
      ]
      """

Tidy up the test a bit more

Tidy up the test a bit more


Feature: Types
  Scenario: All types
    Given the JSON is:
      """
      {
        "array": [],
        "float": 10.0,
        "hash": {},
        "integer": 10,
        "string": "json_spec"
      }
      """
    When I get the JSON
    Then the JSON should be a hash
    And the JSON at "array" should be an array
    And the JSON at "float" should be a float
    And the JSON at "hash" should be a hash
    And the JSON at "integer" should be an integer

Feature: Types
  Scenario: All types
    Given the JSON is:
      """
      {
        "array": [],
        "false": true,
        "float": 10.0,
        "hash": {},
        "integer": 10,
        "string": "json_spec",
        "true": true
      }
      """
    When I get the JSON
    Then the JSON should be a hash
    And the JSON at "array" should be an array
    And the JSON at "false" should be a boolean
    And the JSON at "float" should be a float
    And the JSON at "hash" should be a hash
    And the JSON at "hash" should be an object
    And the JSON at "integer" should be an integer
    And the JSON at "string" should be a string
    And the JSON at "true" should be a boolean

Test the more robust JSON type matcher via Cucumber step


Feature: Signing in
  Background:
    Given I am at "/"

  Scenario: Clicking the sign in button
    When I click "Sign in"

    Then the Persona window appears

  Scenario: Registering a new email address

    When I provide the email address "newuser@example.org"

    Then I am prompted to create a password

  Scenario: Signing in
    Given the Persona sign-in window is open

    When I provide the email address "test@example.org"
    And I provide the password "password"
    And I submit my credentials

    Then I am signed in

# vim:ts=2:sw=2:et:tw=78

Feature: Signing in
  Background:
    Given I am at "/"

  Scenario: Clicking the sign in button
    When I click "Sign in"

    Then the Persona window appears

  Scenario: Registering a new email address
    Given the Persona sign-in window is open

    When I provide the email address "newuser@example.org"

    Then I am prompted to create a password

  Scenario: Signing in
    Given the Persona sign-in window is open

    When I provide the email address "test@example.org"
    And I provide the password "password"
    And I submit my credentials

    Then I am signed in

# vim:ts=2:sw=2:et:tw=78

Add back a missing step.

Add back a missing step.


Feature: Show timestamp
    Scenario:   Display Craig's Birthday
        Given the user visits /260150400
        Then the user sees 31 March 1978 01:00:00

Feature: Show timestamp
    Scenario:   Display Craig's Birthday
        Given the user visits /260150400
        Then the user sees 31 March 1978 00:00:00

Correct feature-my development environment is somehow configured incorrectly.


@issue
Feature: Issue #75: behave @features_from_text_file does not work

   | Feature of Cucumber. Reading the source code, I see it partly implemented.
   |
   |   $ behave @list_of_features.txt
   |   https://github.com/jeamland/behave/blob/master/behave/runner.py#L416:L430
   |
   | However it fails because:
   |  * it does not remove the @ from the path
   |  * it does not search the steps/ directory in the parents of the feature files themselves

  Scenario: Reuse relocated tests
    Given I use the current directory as working directory
    When I run "behave -f plain features/runner.feature_configfile.feature"
    Then it should pass with:
      """
      9 scenarios passed, 0 failed, 0 skipped
      """

@issue
Feature: Issue #75: behave @features_from_text_file does not work

   | Feature of Cucumber. Reading the source code, I see it partly implemented.
   |
   |   $ behave @list_of_features.txt
   |   https://github.com/jeamland/behave/blob/master/behave/runner.py#L416:L430
   |
   | However it fails because:
   |  * it does not remove the @ from the path
   |  * it does not search the steps/ directory in the parents of the feature files themselves

  Scenario: Reuse relocated tests
    Given I use the current directory as working directory
    When I run "behave -f plain features/runner.feature_configfile.feature"
    Then it should pass with:
      """
      10 scenarios passed, 0 failed, 0 skipped
      """

Correct expectations (after 1 scenario was added).


# Copyright (c) 2010-2011 SUSE Linux Products GmbH.
# 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 "16" as result
    When I call systemVersion, I should get "2.3" as result
    When I call getApiNamespaces, I should get 46 namespaces
    When I call getApiNamespaceCallList, I should get 659 available api calls
    When I call getApiCallList, I should get 46 available groups

# Copyright (c) 2010-2011 SUSE Linux Products GmbH.
# 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 "16" as result
    When I call systemVersion, I should get "2.4" as result
    When I call getApiNamespaces, I should get 46 namespaces
    When I call getApiNamespaceCallList, I should get 660 available api calls
    When I call getApiCallList, I should get 46 available groups

Fix XMLRPC API test feature

Fix XMLRPC API test feature


Feature: Schema Properties
  Scenario: With string property
    TODO: the "type" attribute should be unnecessary, but
    is there for the moment to please the fake implementation
    we have in the steps.
    ---
    When the schema is:
      """
      {
          "type": "object", // <-- remove me
          "properties": {
              "name": { "type": "string" }
          }
      }
      """
      Then '{ "name": "Felizberto" }' is acceptable JSON
      But '{ "name": 12345" }' is not acceptable JSON

  @ignore
  Scenario: possible useful syntax
    Given the schema is:
      """
      {
          "properties": {
              "name": { "type": "string" }
          }
      }
      """
    And there is a JSON object with a "name" property
    When the value of name is "Felizberto"
    Then the JSON is valid
    When the value of name is "12345"
    Then the JSON is not valid

Feature: Schema Properties
  Scenario: With string property
    When the schema is:
      """
      {
          "properties": {
              "name": { "type": "string" }
          }
      }
      """
      Then '{ "name": "Felizberto" }' is acceptable JSON
      But '{ "name": 12345" }' is not acceptable JSON

  @ignore
  Scenario: possible useful syntax
    Given the schema is:
      """
      {
          "properties": {
              "name": { "type": "string" }
          }
      }
      """
    And there is a JSON object with a "name" property
    When the value of name is "Felizberto"
    Then the JSON is valid
    When the value of name is "12345"
    Then the JSON is not valid

Remove no longer needed type attribute and notes


@not-production @functional-test
Feature: Supplier Submits Clarification Question

Background: Publish requirements
    Given I have a buyer user account
    And I have deleted all draft buyer requirements
    And I have a 'published' set of requirements

Scenario: Set up suppliers and supplier users
    Given I have test suppliers
    And The test suppliers have users
    And Test supplier users are active

Scenario: Supplier asks a question
    Given I am on the 'Digital Marketplace' login page
    And I login as a 'Supplier' user
    And I am on the public view of the opportunity
    When I click 'Log in to ask a question'
    Then I am taken to the 'Ask a question' page
    When I enter 'How do I ask a question?' in the 'clarification-question' field
    And I click the 'Ask question' button
    Then there is a success banner message containing 'Your question has been sent.'

@not-production @functional-test
Feature: Supplier Submits Clarification Question

Background: Publish requirements
    Given I have a buyer user account
    And I have deleted all draft buyer requirements
    And I have a 'published' set of requirements

Scenario: Set up suppliers and supplier users
    Given I have test suppliers
    And The test suppliers have users
    And Test supplier users are active

Scenario: Supplier asks a question
    Given I am on the 'Digital Marketplace' login page
    And I login as a 'Supplier' user
    And I am on the public view of the opportunity
    When I click 'Ask a question'
    Then I am taken to the 'Ask a question' page
    When I enter 'How do I ask a question?' in the 'clarification-question' field
    And I click the 'Ask question' button
    Then there is a success banner message containing 'Your question has been sent.'

Update for new link text on "Ask a question" page

If a user is already logged in then they now see the link text "Ask a question" rather than "Log in to ask a question", which is only shown when no user is logged in.


Feature: /tournaments

@ignore @todo
Scenario: todo
	Given todo

Feature: GET /tournaments

# todo: Add all tournaments
@ignore @todo
Scenario Outline: happy path
	When get /tournaments
	Then result should contain starts <starts>
	And result should contain discipline <discipline>
	And result should contain slug <slug>

	Examples:
		| starts                          | discipline | slug           |
		| 18 Feb 2017 Australia/Melbourne | gc         | u21-worlds-eoi |

Add feature specifications 'GET /tournaments'


Feature: Basic Operation

This is a test of the basic operation of the Brilliant compiler.
It will likely go away once we get the compiler generally working as expected.

Scenario: Exit code
  Given the program:
    """
    exit(123)
    """
  When the program is executed
  Then the exit code should be 123

Scenario: String literals
  Given the program:
    """
    puts("abc")
    """
  When the program is executed
  Then the exit code should be 0
  And the output should be:
    """
    abc
    """

Feature: Basic Operation

This is a test of the basic operation of the Brilliant compiler.
It will likely go away once we get the compiler generally working as expected.

Scenario: Exit code
  Given the program:
    """
    exit(123)
    """
  When the program is executed
  Then the exit code should be 123

Scenario: String literals
  Given the program:
    """
    puts("Hello, World!")
    """
  When the program is executed
  Then the exit code should be 0
  And the output should be:
    """
    Hello, World!
    """

Add string literals and the puts() function.


@api
Feature: Display information about campaigns in UI

  Background:
    Given I want to create a certificate via the API
    But that URL already has a dataset
    And I apply a campaign "brian"
    And I request a certificate via the API

  Scenario: list campaigns
    When I visit the campaigns page
    Then I should see "brian"

  Scenario: view single campaign
    When I visit the campaign page for "brian"
    Then I should see "1 dataset inspected"
    And I should see "0 datasets added"
    And I should see "0 certificates published"
    And I should see "1 dataset already existed"

  Scenario: view single campaign as CSV
    When I visit the campaign page for "brian.csv"
    Then I should get a CSV file

@api
Feature: Display information about campaigns in UI

  Background:
    Given I want to create a certificate via the API
    And I apply a campaign "brian"
    And I request a certificate via the API
    And the certificate is created
    And I request a certificate via the API

  Scenario: list campaigns
    When I visit the campaigns page
    Then I should see "brian"

  Scenario: view single campaign
    When I visit the campaign page for "brian"
    Then I should see "2 datasets inspected"
    And I should see "1 dataset added"
    And I should see "1 certificate published"
    And I should see "1 dataset already existed"

  Scenario: view single campaign as CSV
    When I visit the campaign page for "brian.csv"
    Then I should get a CSV file

Add a working dataset to features

Add a working dataset to features


Feature: TypeScript package installer

As a Node.js + TypeScript developer
I want to write TypeScript packages managed with NPM that can reuse one another
so that I can have modular source code.

  Scenario: NPM postinstall
    Given an NPM package "leaf1" written in TypeScript
    And a single file "lib/export/leaf1.d.ts" describing the interface
    When "leaf1" package in installed
    And the TypeScript package installer runs as a postinstall hook
    Then the file will be copied into the typings directory.

  Scenario: Local development
    Given an NPM package under development
    And a single file "lib/export/leaf1.d.ts" describing the interface
    When I run tests with "make test"
    Then the tests will execute.

  Scenario: Multiple reuse
    Given two NPM packages "leaf1" and "leaf2" written in TypeScript
    And each package depends on Node package described by "node.d.ts"
    When both packages are installed
    Then they will depend on a single copy of "node.d.ts"

Feature: TypeScript package installer

As a Node.js + TypeScript developer
I want to write TypeScript packages managed with NPM that can reuse one another
so that I can have modular source code.

  Scenario: NPM postinstall
    Given an NPM package "leaf1" written in TypeScript
    And a single file "lib/index.d.ts" describing the interface
    When "leaf1" package is installed
    And the TypeScript package installer runs as a postinstall hook
    Then "leaf1/index.d.ts" will be copied into the typings directory.

  Scenario: Local development
    Given an NPM package under development
    And a single file "lib/index.d.ts" describing the interface
    When I run tests with "make test"
    Then the tests will execute.

  Scenario: Multiple reuse
    Given two NPM packages "leaf1" and "leaf2" written in TypeScript
    And each package depends on Node package described by "node.d.ts"
    When both packages are installed
    Then they will depend on a single copy of "node.d.ts"

Update expected behavior in Gherkin feature file


Feature: Jobs debug API

  @jobs.requires_auth
  Scenario: Basic check the endpoint for analyses report output
    Given System is running
    Given Jobs debug API is running
    When I ask for analyses report for ecosystem maven
    Then I should get 200 status code

  @jobs.requires_auth
  Scenario: Basic check the endpoint for analyses report output
    Given System is running
    Given Jobs debug API is running
    When I ask for analyses report for ecosystem npm
    Then I should get 200 status code

  @jobs.requires_auth
  Scenario: Basic check the endpoint for analyses report output
    Given System is running
    Given Jobs debug API is running
    When I ask for analyses report for ecosystem pypi
    Then I should get 200 status code

Feature: Jobs debug API

  Scenario: Basic check the endpoint for analyses report output w/o authorization token
    Given System is running
    Given Jobs debug API is running
    When I ask for analyses report for ecosystem maven
    Then I should get 401 status code

  Scenario: Basic check the endpoint for analyses report output w/o authorization token
    Given System is running
    Given Jobs debug API is running
    When I ask for analyses report for ecosystem npm
    Then I should get 401 status code

  Scenario: Basic check the endpoint for analyses report output w/o authorization token
    Given System is running
    Given Jobs debug API is running
    When I ask for analyses report for ecosystem pypi
    Then I should get 401 status code

Check that the analyses-report requires token


Feature: It is possible to interactively fill in a form from the CLI

  Scenario: Provide a value different than the default value
    When I run the command "form:name" and I provide as input
      """
      Menno[enter]
      """
    Then the output should be
      """
      Your name [Matthias]: Array
      (
          [name] => Menno
      )
      """

  Scenario: Provide no value, the default value will be used
    When I run the command "form:name" and I provide as input "[enter]"
    Then the command has finished successfully
    And the output should be
      """
      Your name [Matthias]: Array
      (
          [name] => Matthias
      )
      """

  Scenario: Provide invalid input, the form errors will be printed
    When I run the command "form:name" and I provide as input
      """
      A[enter]
      """
    Then the command was not successful
    And the output should contain
      """
      [RuntimeException]
      Invalid data provided: name:
          ERROR: This value is too short. It should have 4 character or more.
      """

  Scenario: Select a value
    When I run the command "form:color" and I provide as input
      """
      blue[enter]
      """
    Then the command has finished successfully
    And the output should be
      """
      Select color [red]:
        [red   ] Red
        [blue  ] Blue
        [yellow] Yellow
      > Array
      (
          [color] => blue
      )
      """

Feature: It is possible to interactively fill in a form from the CLI

  Scenario: Provide a value different than the default value
    When I run the command "form:name" and I provide as input
      """
      Menno[enter]
      """
    Then the output should be
      """
      Your name [Matthias]: Array
      (
          [name] => Menno
      )
      """

  Scenario: Provide no value, the default value will be used
    When I run the command "form:name" and I provide as input "[enter]"
    Then the command has finished successfully
    And the output should be
      """
      Your name [Matthias]: Array
      (
          [name] => Matthias
      )
      """

  Scenario: Provide invalid input, the form errors will be printed
    When I run the command "form:name" and I provide as input
      """
      A[enter]
      """
    Then the command was not successful
    And the output should contain
      """
      This value is too short. It should have 4 character or more.
      """

  Scenario: Select a value
    When I run the command "form:color" and I provide as input
      """
      blue[enter]
      """
    Then the command has finished successfully
    And the output should be
      """
      Select color [red]:
        [red   ] Red
        [blue  ] Blue
        [yellow] Yellow
      > Array
      (
          [color] => blue
      )
      """

Make scenario less specific to make it pass :)


Feature: expect error

  Expect a proc to change the state of some object.

  Scenario: expect error
    Given a file named "expect_error_spec.rb" with:
      """
      describe Object, "#non_existent_message" do
        it "should raise" do
          expect{Object.non_existent_message}.to raise_error(NameError)
        end
      end

      #deliberate failure
      describe Object, "#public_instance_methods" do
        it "should raise" do
          expect{Object.public_instance_methods}.to raise_error(NameError)
        end
      end
      """
    When I run "rspec ./expect_error_spec.rb"
    Then the output should contain "2 examples, 1 failure"
    Then the output should contain "expected NameError but nothing was raised"

  Scenario: expect no error
    Given a file named "expect_no_error_spec.rb" with:
      """
      describe Object, "#public_instance_methods" do
        it "should not raise" do
          expect{Object.public_instance_methods}.to_not raise_error(NameError)
        end
      end

      #deliberate failure
      describe Object, "#non_existent_message" do
        it "should not raise" do
          expect{Object.non_existent_message}.to_not raise_error(NameError)
        end
      end
      """
    When I run "rspec ./expect_no_error_spec.rb"
    Then the output should contain "2 examples, 1 failure"
    Then the output should contain "undefined method `non_existent_message'"

Feature: expect error

  Expect a proc to raise an error when called.

  Scenario: expect error
    Given a file named "expect_error_spec.rb" with:
      """
      describe Object, "#non_existent_message" do
        it "should raise" do
          expect{Object.non_existent_message}.to raise_error(NameError)
        end
      end

      #deliberate failure
      describe Object, "#public_instance_methods" do
        it "should raise" do
          expect{Object.public_instance_methods}.to raise_error(NameError)
        end
      end
      """
    When I run "rspec ./expect_error_spec.rb"
    Then the output should contain "2 examples, 1 failure"
    Then the output should contain "expected NameError but nothing was raised"

  Scenario: expect no error
    Given a file named "expect_no_error_spec.rb" with:
      """
      describe Object, "#public_instance_methods" do
        it "should not raise" do
          expect{Object.public_instance_methods}.to_not raise_error(NameError)
        end
      end

      #deliberate failure
      describe Object, "#non_existent_message" do
        it "should not raise" do
          expect{Object.non_existent_message}.to_not raise_error(NameError)
        end
      end
      """
    When I run "rspec ./expect_no_error_spec.rb"
    Then the output should contain "2 examples, 1 failure"
    Then the output should contain "undefined method `non_existent_message'"

Fix description of cuke feature.

Fix description of cuke feature.


Feature: export statements

Scenario: export { a }
  Given file "a.ts" is
    """
    const a = 1;
    export { a };
    """
  And file "b.ts" is import { a } from './a';
  When analyzing "tsconfig.json"
  Then the result is {}

Scenario: export { a } from file
  Given file "a.ts" is export const a = 1;
  Given file "b.ts" is
    """
    import { a } from "./a";
    export { a };
    """
  And file "c.ts" is import { a } from './b';
  When analyzing "tsconfig.json"
  Then the result is {}

Scenario: Include files from sub-folder, without error
  Given file "x/a.ts" is
    """
    export type A = 1;
    export type A_unused = 2;
    """
  And file "b.ts" is
    """
    import { A } from './x/a'
    export const a: A = 0
    """
  When analyzing "tsconfig.json"
  Then the result is { "b.ts": ["a"], "x/a.ts": ["A_unused"] }

Add test of import from sub-folder

Add test of import from sub-folder


@javascript
Feature: Hovercards
  In order to not having to leave the page to view a persons profile
  As a user
  I want to use hovercards

  Background:
    Given a user named "Bob Jones" with email "bob@bob.bob"
    And "bob@bob.bob" has a public post with text "public stuff"
    And a user named "Alice" with email "alice@alice.alice"
    And "alice@alice.alice" has a public post with text "alice public stuff"
    And the post with text "public stuff" is reshared by "alice@alice.alice"
    And the post with text "alice public stuff" is reshared by "bob@bob.bob"
    And I sign in as "alice@alice.alice"

  Scenario: Hovercards on the main stream
    Given I am on "bob@bob.bob"'s page
    Then I should see "public stuff" within ".stream_element"
    When I activate the first hovercard
    Then I should see a hovercard
    When I deactivate the first hovercard
    Then I should not see a hovercard

  Scenario: Hovercards on the main stream in reshares
    When I am on "bob@bob.bob"'s page
    Then I should see "alice public stuff" within ".reshare"
    When I hover "Alice" within ".reshare"
    Then I should not see a hovercard
    When I am on "alice@alice.alice"'s page
    Then I should see "public stuff" within ".reshare"
    When I hover "Bob Jones" within ".reshare"
    Then I should see a hovercard

@javascript
Feature: Hovercards
  In order to not having to leave the page to view a persons profile
  As a user
  I want to use hovercards

  Background:
    Given a user named "Bob Jones" with email "bob@bob.bob"
    And "bob@bob.bob" has a public post with text "public stuff"
    And a user named "Alice" with email "alice@alice.alice"
    And "alice@alice.alice" has a public post with text "alice public stuff"
    And the post with text "public stuff" is reshared by "alice@alice.alice"
    And the post with text "alice public stuff" is reshared by "bob@bob.bob"
    And I sign in as "alice@alice.alice"

  Scenario: Hovercards on the main stream
    Given I am on "bob@bob.bob"'s page
    Then I should see "public stuff" within ".stream_element"
    When I activate the first hovercard
    Then I should see a hovercard
    When I deactivate the first hovercard
    Then I should not see a hovercard

  Scenario: Hovercards on the main stream in reshares
    Given I am on "bob@bob.bob"'s page
    Then I should see "public stuff" within ".stream_element"
    When I hover "Alice" within ".reshare"
    Then I should not see a hovercard
    When I am on "alice@alice.alice"'s page
    Then I should see "public stuff" within ".stream_element"
    When I hover "Bob Jones" within ".reshare"
    Then I should see a hovercard

Make feature consistent with other features.

Actually, I just trying to make this feature pass.


Feature: Snapshots

  Background:
    * Make sure that gnome-boxes is running
    * Wait until overview is loaded

  @snapshots_create_an_revert
  Scenario: Create snapshots and revert to them
    * Create new box "Core-5"
    * Create snapshot "working network" from machine "Core-5"
    * Go into "Core-5" box
    * Wait for "sleep 1" end
    * Type "sudo ifconfig eth0 down"
    * Press "back" in "Core-5" vm
    * Wait for "sleep 5" end
    * Create snapshot "network down" from machine "Core-5"
    When "network down" is visible with command "virsh snapshot-current boxes-unknown |grep description"
    When Cannot ping "Core-5"
    * Revert machine "Core-5" to state "working network"
    When "working network" is visible with command "virsh snapshot-current boxes-unknown |grep description"
    When Ping "Core-5"
    * Revert machine "Core-5" to state "network down"
    Then Cannot ping "Core-5"

  @delete_snapshots
  Scenario: Delete snapshots
    * Initiate new box "Core-5" installation
    * Create snapshot "working network" from machine "Core-5"
    * Create snapshot "network down" from machine "Core-5"
    * Delete machines "Core-5" snapshot "working network"
    * Delete machines "Core-5" snapshot "network down"
    Then "error: domain 'boxes-unknown' has no current snapshot" is visible with command "virsh snapshot-current boxes-unknown"

Feature: Snapshots

  Background:
    * Make sure that gnome-boxes is running
    * Wait until overview is loaded

  @snapshots_create_an_revert
  Scenario: Create snapshots and revert to them
    * Create new box "Core-5"
    * Create snapshot "working network" from machine "Core-5"
    * Go into "Core-5" box
    * Wait for "sleep 1" end
    * Type "sudo ifconfig eth0 down"
    * Press "back" in "Core-5" vm
    * Wait for "sleep 5" end
    * Create snapshot "network down" from machine "Core-5"
    When "network down" is visible with command "virsh snapshot-current boxes-unknown |grep description"
    When Cannot ping "Core-5"
    * Revert machine "Core-5" to state "working network"
    * Wait for "sleep 5" end
    When "working network" is visible with command "virsh snapshot-current boxes-unknown |grep description"
    When Ping "Core-5"
    * Revert machine "Core-5" to state "network down"
    * Wait for "sleep 5" end
    Then Cannot ping "Core-5"

  @delete_snapshots
  Scenario: Delete snapshots
    * Initiate new box "Core-5" installation
    * Create snapshot "working network" from machine "Core-5"
    * Create snapshot "network down" from machine "Core-5"
    * Delete machines "Core-5" snapshot "working network"
    * Delete machines "Core-5" snapshot "network down"
    Then "error: domain 'boxes-unknown' has no current snapshot" is visible with command "virsh snapshot-current boxes-unknown"

tests: Add 5 seconds sleep after snapshot revert

Time it takes to revert VMs to snapshots varies a lot so lets wait at
least 5 seconds before checking for the process to have finished.

https://bugzilla.gnome.org/show_bug.cgi?id=744703


Feature: "vcloud-launch" works as a useful command-line tool
  In order to use "vcloud-launch" from the CLI
  I want to have it behave like a typical Unix tool
  So I don't get surpised

  Scenario: Common arguments work
    When I get help for "vcloud-launch"
    Then the exit status should be 0
    And the banner should be present
    And the banner should document that this app takes options
    And the following options should be documented:
      |--version|
      |--dont-power-on|
      |--continue-on-error|
    And the banner should document that this app's arguments are:
      |org_config_file|

Feature: "vcloud-launch" works as a useful command-line tool
  In order to use "vcloud-launch" from the CLI
  I want to have it behave like a typical Unix tool
  So I don't get surpised

  Scenario: Common arguments work
    When I get help for "vcloud-launch"
    Then the exit status should be 0
    And the banner should be present
    And the banner should document that this app takes options
    And the following options should be documented:
      |--version|
      |--dont-power-on|
      |--continue-on-error|
      |--verbose|
      |--quiet|
    And the banner should document that this app's arguments are:
      |org_config_file|

Add --verbose and --quiet to features tests


Feature: Php-metrics-dashboard features

  Background: Generate a PhpMetric report for a project
    Given I am in the root directory
    And I have a config file with content:
    """
    {
        "sf-bootstrap": {
            "url": "git@github.com:Romibuzi/sf-bootstrap.git",
            "excluded-dirs": ["app", "vendor"]
        }
    }
    """
    When I run "generate-reports" command
    Then I should get "sf-bootstrap" directory in projects sources folder
    And "sf-bootstrap" sources folder should be a git repository
    Then I should get "sf-bootstrap" directory in projects reports folder
    And I should get a report file in "sf-bootstrap" reports folder

  Scenario: View this report on the web interface
    When I call GET "/"
    Then The response code should be 200
    And The reponse should contains "List of your scanned projects"
    And The reponse should contains "sf-bootstrap"
    When I call GET "/sf-bootstrap"
    Then The response code should be 200
    And The reponse should contains "List of reports for the project sf-bootstrap"
    And The reponse should contains a report link for the actual date

Feature: Php-metrics-dashboard features

  Background: Generate a PhpMetric report for a project
    Given I am in the root directory
    And I have a config file with content:
    """
    {
        "sf-bootstrap": {
            "url": "https://github.com/romibuzi/sf-bootstrap",
            "excluded-dirs": ["app", "vendor"]
        }
    }
    """
    When I run "generate-reports" command
    Then I should get "sf-bootstrap" directory in projects sources folder
    And "sf-bootstrap" sources folder should be a git repository
    Then I should get "sf-bootstrap" directory in projects reports folder
    And I should get a report file in "sf-bootstrap" reports folder

  Scenario: View this report on the web interface
    When I call GET "/"
    Then The response code should be 200
    And The reponse should contains "List of your scanned projects"
    And The reponse should contains "sf-bootstrap"
    When I call GET "/sf-bootstrap"
    Then The response code should be 200
    And The reponse should contains "List of reports for the project sf-bootstrap"
    And The reponse should contains a report link for the actual date

[Behat] Use https instead of git for travis access


Feature: Notify push to repository
  In order to automatically process a repository
  As a regular user
  I want to use a webhook in my repository to notify Mezuro of new pushes

  @kalibro_configuration_restart @kalibro_processor_restart
  Scenario: Valid repository
    Given I am a regular user
    And I have a sample configuration with native metrics
    And I have a sample repository
    And I start to process that repository
    And I wait up for a ready processing
    When I push some commits to the repository
    Then Mezuro should process the repository again

  @kalibro_configuration_restart @kalibro_processor_restart
  Scenario: Invalid repository
    Given I am a regular user
    When I push some commits to an invalid repository
    Then I should get a not found error

  @kalibro_configuration_restart @kalibro_processor_restart
  Scenario: Repository with an errored processing
    Given I am a regular user
    And I have a sample configuration with native metrics
    And I have a compound metric configuration with script "rtrnaqdfwqefwqr213r2145211234ed a = b=2" within the given mezuro configuration
    And I have a sample repository
    And I start to process that repository
    And I wait up for an error processing
    When I push some commits to the repository
    Then Mezuro should process the repository again

Feature: Notify push to repository
  In order to automatically process a repository
  As a regular user
  I want to use a webhook in my repository to notify Mezuro of new pushes

  @kalibro_configuration_restart @kalibro_processor_restart
  Scenario: Valid repository
    Given I am a regular user
    And I have a sample configuration with hotspot metrics
    And I have a sample repository
    And I start to process that repository
    And I wait up for a ready processing
    When I push some commits to the repository
    Then Mezuro should process the repository again

  @kalibro_configuration_restart @kalibro_processor_restart
  Scenario: Invalid repository
    Given I am a regular user
    When I push some commits to an invalid repository
    Then I should get a not found error

  @kalibro_configuration_restart @kalibro_processor_restart
  Scenario: Repository with an errored processing
    Given I am a regular user
    And I have a sample configuration with native metrics
    And I have a compound metric configuration with script "rtrnaqdfwqefwqr213r2145211234ed a = b=2" within the given mezuro configuration
    And I have a sample repository
    And I start to process that repository
    And I wait up for an error processing
    When I push some commits to the repository
    Then Mezuro should process the repository again

Use metric fu metrics instead of analizo metrics on acceptance tests


Feature: Manage user custom fields

  Scenario: Usermeta CRUD
    Given a WP install

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

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

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

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

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

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

Feature: Manage user custom fields

  Scenario: Usermeta CRUD
    Given a WP install

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

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

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

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

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

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

Update tests to reflect 7433cdb

Update tests to reflect 7433cdb


@reset-schema
@mink:selenium2
@alice(Page) @alice(Blog) @alice(BlogTemplate)
Feature: Edit an article

Background:
    Given I maximize the window
    And I am on homepage

    Scenario: I create a new article and update its slug
        Then I should see "Blog"
        When I follow "Blog"
        Then I should see "Create a post now"
        When I follow "Create a post now"
        Then I should see "Create a new post"
        Then I should see "If this field is empty, the slug will be autogenerated"
        Given I fill in "article_translations_en_name" with "I'm your father."
        And I fill in "article_translations_en_description" with "This is a great description."
        And I select "First blog template" from "Template"
        And I follow "Create"
        And I wait 5 seconds
        Then the url should match "/fr/the-jedi-network/i-m-your-father"
        And I wait 3 seconds
        Then the title should be "I'm your father."
        When I open the settings menu
        And I wait 3 seconds
        Then I should see "Post settings"
        And I should see "I'm your father"
        And I should not see "If this field is empty, the slug will be autogenerated"
        When I fill in "article_settings_translations_en_slug" with "new-custom-slug"
        And I follow "UPDATE"
        And I wait 5 seconds
        Then the url should match "/en/the-jedi-network/new-custom-slug"

@reset-schema
@mink:selenium2
@alice(Page) @alice(Blog) @alice(BlogTemplate)
Feature: Edit an article

Background:
    Given I maximize the window
    And I am on homepage

    Scenario: I create a new article and update its slug
        Then I should see "Blog"
        When I follow "Blog"
        Then I should see "Create a post now"
        When I follow "Create a post now"
        Then I should see "Create a new post"
        Then I should see "If this field is empty, the slug will be autogenerated"
        Given I fill in "article_translations_en_name" with "I'm your father."
        And I fill in "article_translations_en_description" with "This is a great description."
        And I select "First blog template" from "Template"
        And I follow "Create"
        And I wait 5 seconds
        Then the url should match "/en/the-jedi-network/i-m-your-father"
        And I wait 3 seconds
        Then the title should be "I'm your father."
        When I open the settings menu
        And I wait 3 seconds
        Then I should see "Post settings"
        And I should see "I'm your father"
        And I should not see "If this field is empty, the slug will be autogenerated"
        When I fill in "article_settings_translations_en_slug" with "new-custom-slug"
        And I follow "UPDATE"
        And I wait 5 seconds
        Then the url should match "/en/the-jedi-network/new-custom-slug"

Fix “I create a new article and update its slug” scenario


Feature: Adhearsion Ahn CLI (daemon)
  As an Adhearsion user
  I want the ahn command to provide a 'daemon' command
  So that I can start my adhearsion app as a daemon

  Scenario: Command daemon with path works correctly
    Given JRuby skip test
    Given that I create a valid app under "path/somewhere"
    When I run `ahn daemon path/somewhere`
    And I cd to "path/somewhere"
    And I terminate the process using the pid file "adhearsion.pid"
    Then the output should contain "Daemonizing now"
    And the exit status should be 0

  Scenario: Command daemon with pid option
    Given JRuby skip test
    Given that I create a valid app under "path/somewhere"
    When I run `ahn daemon path/somewhere --pid-file=ahn.pid`
    And I cd to "path/somewhere"
    And I terminate the process using the pid file "ahn.pid"
    Then the output should contain "Daemonizing now"

Feature: Adhearsion Ahn CLI (daemon)
  As an Adhearsion user
  I want the ahn command to provide a 'daemon' command
  So that I can start my adhearsion app as a daemon

  Scenario: Command daemon with path works correctly
    Given JRuby skip test
    Given that I create a valid app under "path/somewhere"
    When I run `ahn daemon path/somewhere`
    And I cd to "path/somewhere"
    And I terminate the process using the pid file "adhearsion.pid"
    Then the exit status should be 0

  Scenario: Command daemon with pid option
    Given JRuby skip test
    Given that I create a valid app under "path/somewhere"
    When I run `ahn daemon path/somewhere --pid-file=ahn.pid`
    And I cd to "path/somewhere"
    And I terminate the process using the pid file "ahn.pid"
    Then the exit status should be 0

[BUGFIX] Remove some unnecessary assertions from some features


@typical_usage
Feature: Uninstall Vim plugins
  In order to automate boring steps,
  as a lazy Vim user,
  I want to use a declarative way to delete Vim plugins from my configuration.

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

  Scenario: Install after deleting some flavors in flavorfile
    Given flavorfile
      """ruby
      flavor '$foo_uri'
      flavor '$bar_uri'
      """
    And I run `vim-flavor install`
    When I edit flavorfile as
      """ruby
      flavor '$bar_uri'
      """
    And I run `vim-flavor install` again
    Then I get lockfile
      """
      $bar_uri (2.0.2)
      """
    And I get a bootstrap script in '$home/.vim'
    And I get flavor '$bar_uri' with '2.0.2' in '$home/.vim'
    But I don't have flavor '$foo_uri' in '$home/.vim'

@typical_usage
Feature: Uninstall Vim plugins
  In order to automate boring steps,
  as a lazy Vim user,
  I want to use a declarative way to delete Vim plugins from my configuration.

  Background:
    Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
    And a repository "bar" with versions "2.0.0 2.0.1 2.0.2"

  Scenario: Install after deleting some flavors in flavorfile
    Given a flavorfile with:
      """ruby
      flavor '$foo_uri'
      flavor '$bar_uri'
      """
    And I run `vim-flavor install`
    And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"
    When I edit the flavorfile as:
      """ruby
      flavor '$bar_uri'
      """
    And I run `vim-flavor install`
    Then it should pass
    And a lockfile is created with:
      """
      $bar_uri (2.0.2)
      """
    And a bootstrap script is created in "$home/.vim"
    And a flavor "$bar_uri" version "2.0.2" is deployed to "$home/.vim"
    But a flavor "$foo_uri" is not deployed to "$home/.vim"

Rewrite "Uninstall Vim plugins" feature

Rewrite "Uninstall Vim plugins" feature


@c
Feature: C executable

	Scenario: Hello world
		Given a project configuration
		"""
		local c = require('configure.lang.c')

		function configure(build)
			local compiler = c.compiler.find{build = build}
			local exe = compiler:link_executable{
				name = "hello-world",
				sources = {'main.c', },
			}
		end
		"""
		And a source file main.c
		"""
		#include <stdio.h>
		int main() { printf("Hello, world!\n"); return 0; }
		"""
		When I configure and build
		Then I can launch bin/hello-world

	Scenario: Static runtime
		Given a project configuration
		"""
		local c = require('configure.lang.c')

		function configure(build)
			local compiler = c.compiler.find{build = build}
			local exe = compiler:link_executable{
				name = "hello-world",
				sources = {'main.c', },
				runtime = 'static',
			}
		end
		"""
		And a source file main.c
		"""
		#include <stdio.h>
		int main() { printf("Hello, world!\n"); return 0; }
		"""
		When I configure and build
		Then I can launch bin/hello-world
		And build/bin/hello-world is a static executable

@c
Feature: C executable

	Scenario: Hello world
		Given a project configuration
		"""
		local c = require('configure.lang.c')

		function configure(build)
			local compiler = c.compiler.find{build = build}
			local exe = compiler:link_executable{
				name = "hello-world",
				sources = {'main.c', },
			}
		end
		"""
		And a source file main.c
		"""
		#include <stdio.h>
		int main() { printf("Hello, world!\n"); return 0; }
		"""
		When I configure and build
		Then I can launch bin/hello-world

	Scenario: Static runtime
		Given a project configuration
		"""
		local c = require('configure.lang.c')

		function configure(build)
			local compiler = c.compiler.find{build = build}
			local exe = compiler:link_executable{
				name = "hello-world",
				sources = {'main.c', },
				runtime = 'static',
				extension = '.exe'
			}
		end
		"""
		And a source file main.c
		"""
		#include <stdio.h>
		int main() { printf("Hello, world!\n"); return 0; }
		"""
		When I configure and build
		Then I can launch bin/hello-world.exe
		And build/bin/hello-world.exe is a static executable

test.features: Use .exe extension to avoid special handling on windows.


@chrome @en.wikipedia.beta.wmflabs.org @firefox @login @test2.wikipedia.org
Feature: Scenarios that trigger notifications

  Scenario: Mark all as unread
    Given I am logged in with no notifications
      And I have a Flow message that triggers an alert notification
      And another user mentions me on the wiki
      And I am on the "Selenium Echo flyout test page" page
      And I have new notifications
      And I click the notification flyout button
      And I see the notification flyout
      And I click for the Messages view
    When I click the mark all as read button
      And I am on the "Selenium Echo flyout test page" page
    Then I have no new notifications

@chrome @en.wikipedia.beta.wmflabs.org @firefox @login @test2.wikipedia.org
Feature: Scenarios that trigger notifications

  Scenario: Mark all as read
    Given I am logged in with no notifications
      And I have a Flow message that triggers an alert notification
      And another user mentions me on the wiki
      And I am on the "Selenium Echo flyout test page" page
      And I have new notifications
      And I click the notification flyout button
      And I see the notification flyout
      And I click for the Messages view
    When I click the mark all as read button
      And I am on the "Selenium Echo flyout test page" page
    Then I have no new notifications

Fix typo in scenario name

Fix typo in scenario name

Change-Id: I90cf03197c715dc7c786479056f95137245ef939


Feature: Log in/out links
In order to easily log in and log out
As a user
I want to see the appropriate link

Scenario: A non logged in guest user should be redirected to login page
  Given I am not logged in
  And I am on the homepage
  Then I should be redirected to login page

@omniauth_test
Scenario: A logged in user on the search page should see a logout link
  Given I am logged in
  And I am on the homepage
  Then I should see a logout link
  And I should see "Log-out dev123" as the text of the logout link

@omniauth_test
Scenario: A non aleph logged in user should have access denied
  Given I am logged in as a non aleph user
  And I am on the homepage
  Then I should have access denied

Feature: Log in/out links
In order to easily log in and log out
As a user
I want to see the appropriate link

Scenario: A non logged in guest user should be redirected to login page
  Given I am not logged in
  And I am on the homepage
  Then I should be redirected to login page

@omniauth_test
Scenario: A logged in user on the search page should see a logout link
  Given I am logged in
  And I am on the homepage
  Then I should see a logout link
  And I should see "Log-out Dev" as the text of the logout link

@omniauth_test
Scenario: A non aleph logged in user should have access denied
  Given I am logged in as a non aleph user
  And I am on the homepage
  Then I should have access denied

Update test to reflect new assets

Update test to reflect new assets


@use_http_client
Feature: querying for data grouped by day
    This feature is for querying for data grouped by day

    @wip
    Scenario: grouping data by day
         Given I have the data in "daily_timestamps.json"
           And I have a bucket named "day"
          When I post the data to "/day"
          Then I should get back a status of "200"
          When I go to "/day?period=day"
          Then the JSON should have "12" results

    @wip
    Scenario: grouping data by day between two allowed timestamps
         Given I have the data in "daily_timestamps.json"
           And I have a bucket named "day"
          When I post the data to "/day"
          Then I should get back a status of "200"
          When I go to "/day?period=day&start_at=2013-04-04T00:00:00Z&end_at=2013-04-08T00:00:00Z"
          Then the JSON should have "4" results

@use_http_client
Feature: querying for data grouped by day
    This feature is for querying for data grouped by day

    Scenario: grouping data by day
         Given I have the data in "daily_timestamps.json"
           And I have a bucket named "day"
          When I post the data to "/day"
          Then I should get back a status of "200"
          When I go to "/day?period=day"
          Then the JSON should have "12" results

    Scenario: grouping data by day between two timestamps
         Given I have the data in "daily_timestamps.json"
           And I have a bucket named "day"
          When I post the data to "/day"
          Then I should get back a status of "200"
          When I go to "/day?period=day&start_at=2013-04-04T00:00:00Z&end_at=2013-04-11T00:00:00Z"
          Then the JSON should have "7" results

Fix test data to be more than 7 days

Fix test data to be more than 7 days