Noosfero/noosfero

View on GitHub
plugins/shopping_cart/features/delivery_admin.feature

Summary

Maintainability
Test Coverage
Feature: delivery administration
  As an enterprise's administrator
  I want to create delivery methods
  In order to allow my customer to choose which delivery they want

  Background:
    Given "ShoppingCart" plugin is enabled
    And "Delivery" plugin is enabled
    And the following users
      | login | name |
      | moe | Moe |
    And the following enterprise
      | identifier  | name        | owner |
      | moes-tavern | Moes Tavern | moe |
    And the shopping basket is enabled on "Moes Tavern"
    And "Moe" is admin of "Moes Tavern"
    And I am logged in as "moe"
    And I go to moes-tavern's control panel

  @selenium
  Scenario: enable delivery
    Given I follow "Preferences" within "#section-shopping"
    When I check "Enable shopping basket"
    Then I should see "Deliveries or pickups"

  @selenium
  Scenario: disable delivery
    Given I follow "Preferences" within "#section-shopping"
    When I uncheck "Enable shopping basket"
    Then I should not see "Deliveries or pickups"

  @selenium
  Scenario: create new deliver
    Given I follow "Preferences" within "#section-shopping"
    And I check "Enable shopping basket"
    And I follow "New delivery or pickup"
    And I select "Deliver" from "Type"
    And I fill in "Name" with "Bike"
    And I fill in "Fixed cost" with "8.00"
    And I fill in "delivery_method_free_over_price" with "35.50"
    When I follow "Add"
    Then I should see "Bike" within ".delivery-method"

  @selenium
  Scenario: create new pickup
    Given I follow "Preferences" within "#section-shopping"
    And I check "Enable shopping basket"
    And I follow "New delivery or pickup"
    And I select "Pickup" from "Type"
    And I fill in "Name" with "Bar"
    And I fill in "Fixed cost" with "0.00"
    When I follow "Add"
    Then I should see "Bar"

  @selenium
  Scenario: remove delivery
    Given I follow "Preferences" within "#section-shopping"
    And I check "Enable shopping basket"
    And I follow "New delivery or pickup"
    And I fill in "Name" with "Bike"
    When I follow "Add"
    Then I should see "Bike"
    When I fix button onclick argument
    And I follow "Remove"
    When I confirm the browser dialog
    Then I should not see "Bike"

  @selenium
  Scenario: edit delivery
    Given I follow "Preferences" within "#section-shopping"
    And I check "Enable shopping basket"
    And I follow "New delivery or pickup"
    And I fill in "Name" with "Bike"
    When I follow "Add"
    Then I should see "Bike"
    When I fix button onclick argument
    And I follow "Edit"
    And I fill in "Name" with "Car"
    When I follow "Save"
    Then I should not see "Bike"
    Then I should see "Car"