Skip to content

Commit

Permalink
Add behat scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomanhez committed Sep 14, 2021
1 parent 0d1cdda commit d66e101
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@shopping_cart
Feature: Adding a simple product with discounted catalog price to the cart
In order to select products with proper price
As a Visitor
I want to be able to add simple products with discounted catalog price to the cart

Background:
Given the store operates on a single channel in "United States"
And the store has a "T-Shirt" configurable product
And this product has "PHP T-Shirt" variant priced at "$20.00"
And the store has a "Mug" configurable product
And this product has "PHP Mug" variant priced at "$5.00"
And there is a catalog promotion "Winter sale" that reduces price by "25%" and applies on "PHP T-Shirt" variant

@todo
Scenario: Adding a simple product with discounted catalog price to the cart
When I add this product to the cart
Then I should be on my cart summary page
And I should be notified that the product has been successfully added
And I should see "T-Shirt Banana" with unit price "$15.00" in my cart

@todo
Scenario: Adding a simple product with discounted catalog price to the cart as a logged in customer
Given I am a logged in customer
When I add this product to the cart
Then I should be on my cart summary page
And I should be notified that the product has been successfully added
And I should see "T-Shirt Banana" with unit price "$15.00" in my cart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@shopping_cart
Feature: Adding a product with selected variant with discounted catalog price to the cart
In order to select products with proper price
As a Visitor
I want to be able to add products with selected variants to cart

Background:
Given the store operates on a single channel in "United States"
And the store has a product "T-Shirt"
And this product has "PHP T-Shirt" variant priced at "$20"
And there is a catalog promotion "Winter sale" that reduces price by "25%" and applies on "PHP T-Shirt" variant

@todo
Scenario: Adding a product with multiple variants with discounted catalog price to the cart
When I add "PHP T-Shirt" variant of this product to the cart
Then I should be on my cart summary page
And I should be notified that the product has been successfully added
And I should see "T-Shirt Banana" with unit price "$15.00" in my cart
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ Feature: Viewing different discounted price for different product variants
And I select "Wyborowa Apple" variant
Then the product variant price should be "$12.55"
And the product original price should be "$20.00"

@todo
Scenario: Viewing a detailed page with product's discounted catalog price for different variant
Given there is a catalog promotion "For apple drinks" that reduces price by "30%" and applies on "Wyborowa Apple" variant
When I view product "Wyborowa Vodka"
And I select "Wyborowa Apple" variant
Then the product variant price should be "$8,79"
And the product original price should be "$20.00"
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ default:
- sylius.behat.context.setup.shipping_category
- sylius.behat.context.setup.shop_api_security
- sylius.behat.context.setup.user
- Sylius\Behat\Context\Setup\CatalogPromotionContext

- sylius.behat.context.transform.cart
- sylius.behat.context.transform.channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ default:
- sylius.behat.context.setup.taxation
- sylius.behat.context.setup.user
- sylius.behat.context.setup.zone
- Sylius\Behat\Context\Setup\CatalogPromotionContext

- sylius.behat.context.ui.channel
- sylius.behat.context.ui.shop.cart
Expand Down

0 comments on commit d66e101

Please sign in to comment.