Skip to content

Instantly share code, notes, and snippets.

@craychee
Last active July 25, 2016 21:44
Show Gist options
  • Select an option

  • Save craychee/9768686 to your computer and use it in GitHub Desktop.

Select an option

Save craychee/9768686 to your computer and use it in GitHub Desktop.
access_product_employee.feature
@api @javascript
Feature: View products.
In order for to buy a product,
As an employee,
I need be able to view products that are on offer.
Background:
Given I am a user with the "employee" role
Given "product" products:
| title | sku | status | field_price_type | field_product_employee_price | field_product_retail_price | field_product_partner_price |
| Monthly Protection | 125 | 1 | monthly | 11.99 | 14.99 | 13.99 |
| Yearly Protection | 124 | 1 | yearly | 51.99 | 54.99 | 53.99 |
And "bundle" products:
| title | sku | field_price_type | field_product_employee_price | field_product_retail_price | field_product_partner_price |
| I am a bundle. | 117 | monthly | 31.99 | 34.99 | 33.99 |
And references to "125,124" on "product" nodes:
| title | status | field_category_name | field_product_category | field_product_subtitle | body | field_product_type |
| Product One | 1 | BackUp and Sharing | category 1 | This is a subtitle. | This is a description. | personal product |
| Product Two | 1 | | category 2 | | | personal product |
| Product Three | 1 | | category 3 | | | personal product |
| Product Four | 1 | | category 1 | | | business product |
And references to "117" on "product" nodes:
| title | status | field_product_subtitle | body | field_product_matrix_components |
| Bundle One | 1 | This is the subtitle of a bundle. | This is the body of a bundle. | 1,2,3 |
Scenario: Navigate to products from the front page and see all products.
Given I am on the homepage
When I click "For Your Home"
Then I should see the heading "Products"
And I am at "/products-services/all"
And I should see the link "Products"
And I should see the link "Bundles"
And I should see the link "Product One"
And I should see the link "Product Two"
And I should see the link "Product Three"
And I should not see the link "Product Four"
And I should not see the link "Bundle One"
And I should see the text "This is a subtitle."
And I should see the text "This is a description."
And I should not see the text "BackUp and Sharing"
And I should not see the text "14.99"
And I should see the text "11.99"
And I should not see the text "13.99"
And I should see the text "month"
And I should not see the text "year"
And I should see the link "Learn More"
And I should not see the text "125"
And I should not see the text "Monthly Protection"
And I should not see the text "Yearly Protection"
Scenario: Toggle to category one from the "Products and Services" page.
Given I am at "/products-services/all"
When I click "category 1"
Then I should see the link "Product One"
And I should not see the link "Product Two"
And I should not see the link "Product Three"
And I should not see the link "Bundle One"
And I should see the text "This is a subtitle."
And I should see the text "This is a description."
And I should not see the text "14.99"
And I should see the text "11.99"
And I should not see the text "13.99"
And I should see the text "month"
And I should not see the text "year"
And I should see the link "Learn More"
And I should not see the text "125"
Scenario: Toggle to category two from the "Products and Services" page.
When I am at "/products-services/category-1"
And I click "category 2"
Then I should not see the link "Product One"
And I should see the link "Product Two"
And I should not see the link "Product Three"
And I should not see the link "Bundle One"
Scenario: Toggle to category one from the "Products and Services" page.
When I am at "/products-services/category-2"
And I click "category 3"
Then I should not see the link "Product One"
And I should not see the link "Product Two"
And I should see the link "Product Three"
And I should not see the link "Bundle One"
Scenario: Click learn more about a product.
When I am at "/products-services/category-3"
And I click "Product Three"
Then I should see the heading "Product Three"
And I should see the text "month"
And I should see the text "year"
And I should see the text "11.99"
And I should see the text "51.99"
And I should not see the text "54.99"
And I should not see the text "53.99"
And I should not see the text "14.99"
And I should not see the text "13.99"
And I am on a "product" node with the title "Product Three"
Scenario: Navigate to bundles from the front page and see only bundles.
When I am on the homepage
And I click "Bundles"
Then I should see the heading "Bundles"
And I am at "/products-services/bundles"
And I should not see the link "Product One"
And I should not see the link "Product Two"
And I should not see the link "Product Three"
And I should see the text "1"
And I should see the text "2"
And I should see the text "3"
And I should see the link "Bundle One"
And I should not see the text "This is the subtitle of a bundle."
And I should not see the text "This is the body of a bundle."
And I should see the text "31.99"
And I should not see the text "34.99"
And I should not see the text "33.99"
And I should see the link "Learn More"
And I should not see the text "117"
Scenario: Click learn more about a bundle.
When I am at "/products-services/bundles"
And I click "Bundle One"
Then I should see the heading "Bundle One"
And I am on a "product" node with the title "Bundle One"
And I should see the text "This is the subtitle of a bundle."
And I should see the text "This is the body of a bundle."
And I should see the text "31.99"
And I should not see the text "34.99"
And I should not see the text "33.99"
And I should not see the text "117"
And I should not see the text "I am a bundle."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment