Skip to content

Commit

Permalink
feature #14852 [PriceHistory] Behat scenarios (Rafikooo)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.13 <!-- see the comment below -->                  |
| Bug fix?        | no                                                      |
| New feature?    |yes                                                       |
| BC breaks?      | no                                                      |
| Deprecations?   | no<!-- don't forget to update the UPGRADE-*.md file --> |
| License         | MIT                                                          |

Move https://github.com/Sylius/PriceHistoryPlugin scenarios into Sylius

<!--
 - Bug fixes must be submitted against the 1.12 branch
 - Features and deprecations must be submitted against the 1.13 branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

88db81f [PriceHistory][Scenarios] Channel setup
668bd90 [PriceHistory][Scenarios] Accessing price history
33a7407 [PriceHistory][Scenarios] Add catalog promotion cases
615f704 [PriceHistory][Scenarios] Add deleting old log entries
805b93a [PriceHistory][Scenarios] Add log entry creation after product's price change
1161ec2 [PriceHistory][Scenarios] Add lowest price displaying in product's show page
30ca912 [PriceHistory][Scenarios][Shop] Add lowest price displaying
10b6752 [PriceHistory] Tag scenarios as @todo
  • Loading branch information
GSadee committed Mar 13, 2023
2 parents 27572d0 + 10b6752 commit 9d3d6f9
Show file tree
Hide file tree
Showing 19 changed files with 804 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
@managing_channels
Feature: Specifying the lowest price for discounted products checking period while creating a channel
In order to show lowest prices only from a specific period
As an Administrator
I want to add a new channel with the lowest price for discounted products checking period

Background:
Given the store has currency "Euro"
And the store has locale "English (United States)"
And the store operates in "United States" and "Poland"
And I am logged in as an administrator

@todo
Scenario: Adding a new channel without specifying the lowest price for discounted products checking period
When I want to create a new channel
And I specify its code as "MOBILE"
And I name it "Mobile"
And I choose "Euro" as the base currency
And I make it available in "English (United States)"
And I choose "English (United States)" as a default locale
And I select the "Order items based" as tax calculation strategy
And I add it
Then I should be notified that it has been successfully created
And the "Mobile" channel should have the lowest price for discounted products checking period set to 30 days

@todo
Scenario: Adding a new channel with a specified lowest price for discounted products checking period
When I want to create a new channel
And I specify its code as "MOBILE"
And I name it "Mobile"
And I choose "Euro" as the base currency
And I make it available in "English (United States)"
And I choose "English (United States)" as a default locale
And I select the "Order items based" as tax calculation strategy
And I specify 15 days as the lowest price for discounted products checking period
And I add it
Then I should be notified that it has been successfully created
And the "Mobile" channel should have the lowest price for discounted products checking period set to 15 days

@todo
Scenario: Being prevented from creating a new channel with the lowest price for discounted products checking period equal to zero
When I want to create a new channel
And I specify its code as "MOBILE"
And I name it "Mobile"
And I choose "Euro" as the base currency
And I make it available in "English (United States)"
And I choose "English (United States)" as a default locale
And I select the "Order items based" as tax calculation strategy
And I specify 0 days as the lowest price for discounted products checking period
And I try to add it
Then I should be notified that the lowest price for discounted products checking period must be greater than 0

@todo
Scenario: Being prevented from creating a new channel with a negative lowest price for discounted products checking period
When I want to create a new channel
And I specify its code as "MOBILE"
And I name it "Mobile"
And I choose "Euro" as the base currency
And I make it available in "English (United States)"
And I choose "English (United States)" as a default locale
And I select the "Order items based" as tax calculation strategy
And I disable showing the lowest price of discounted products
And I specify -10 days as the lowest price for discounted products checking period
And I try to add it
Then I should be notified that the lowest price for discounted products checking period must be greater than 0

@todo
Scenario: Being prevented from creating a new channel with a too big lowest price for discounted products checking period
When I want to create a new channel
And I specify its code as "MOBILE"
And I name it "Mobile"
And I choose "Euro" as the base currency
And I make it available in "English (United States)"
And I choose "English (United States)" as a default locale
And I select the "Order items based" as tax calculation strategy
And I disable showing the lowest price of discounted products
And I specify 99999999999 days as the lowest price for discounted products checking period
And I try to add it
Then I should be notified that the lowest price for discounted products checking period must be lower
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@managing_channels
Feature: Choosing whether to show the lowest product price or not while creating a channel
In order to show the lowest price before the product has been discounted only for certain channels
As an Administrator
I want to add a new channel that has this feature enabled or not

Background:
Given the store has currency "Euro"
And the store has locale "English (United States)"
And the store operates in "United States" and "Poland"
And I am logged in as an administrator

@todo
Scenario: Adding a new channel with lowest price before the product has been discounted enabled by default
When I want to create a new channel
And I specify its code as "MOBILE"
And I name it "Mobile"
And I choose "Euro" as the base currency
And I make it available in "English (United States)"
And I choose "English (United States)" as a default locale
And I select the "Order items based" as tax calculation strategy
And I add it
Then I should be notified that it has been successfully created
And the "Mobile" channel should have the lowest price of discounted products prior to the current discount enabled

@todo @no-ui
Scenario: Adding a new channel with lowest price before the product has been discounted enabled
When I want to create a new channel
And I specify its code as "MOBILE"
And I name it "Mobile"
And I choose "Euro" as the base currency
And I make it available in "English (United States)"
And I choose "English (United States)" as a default locale
And I select the "Order items based" as tax calculation strategy
And I enable showing the lowest price of discounted products
And I add it
Then I should be notified that it has been successfully created
And the "Mobile" channel should have the lowest price of discounted products prior to the current discount enabled

@todo
Scenario: Adding a new channel with lowest price before the product has been discounted disabled
When I want to create a new channel
And I specify its code as "MOBILE"
And I name it "Mobile"
And I choose "Euro" as the base currency
And I make it available in "English (United States)"
And I choose "English (United States)" as a default locale
And I select the "Order items based" as tax calculation strategy
And I disable showing the lowest price of discounted products
And I add it
Then I should be notified that it has been successfully created
And the "Mobile" channel should have the lowest price of discounted products prior to the current discount disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@managing_channels
Feature: Specifying the lowest price for discounted products checking period while editing a channel
In order to show lowest prices only from a specific period
As an Administrator
I want to edit a channel's lowest price for discounted products checking period

Background:
Given the store operates on a channel named "EU"
And this channel has 15 days set as the lowest price for discounted products checking period
And I am logged in as an administrator

@todo
Scenario: Changing the lowest price for discounted products checking period
When I want to modify a channel "EU"
And I specify 30 days as the lowest price for discounted products checking period
And I save my changes
Then I should be notified that it has been successfully edited
And its lowest price for discounted products checking period should be set to 30 days

@todo
Scenario: Being prevented from changing the lowest price for discounted products checking period to zero
When I want to modify a channel "EU"
And I specify 0 days as the lowest price for discounted products checking period
And I try to save my changes
Then I should be notified that the lowest price for discounted products checking period must be greater than 0

@todo
Scenario: Being prevented from changing the lowest price for discounted products checking period to a negative value
When I want to modify a channel "EU"
And I specify -10 days as the lowest price for discounted products checking period
And I try to save my changes
Then I should be notified that the lowest price for discounted products checking period must be greater than 0

@todo
Scenario: Being prevented from changing the lowest price for discounted products checking period to a too big value
When I want to modify a channel "EU"
And I specify 99999999999 days as the lowest price for discounted products checking period
And I try to save my changes
Then I should be notified that the lowest price for discounted products checking period must be lower
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@managing_channels
Feature: Choosing whether to show the lowest product price or not while editing a channel
In order to show the lowest price before the product has been discounted only for certain channels
As an Administrator
I want to be able to edit channels and enable or disable the lowest price of discounted products on them

Background:
Given the store operates on a channel named "EU Channel"
And the store operates on another channel named "US Channel"
And the channel "EU Channel" has showing the lowest price of discounted products enabled
And the channel "US Channel" has showing the lowest price of discounted products disabled
And I am logged in as an administrator

@todo
Scenario: Enabling showing the lowest price of discounted products on a channel
When I want to modify a channel "US Channel"
And I enable showing the lowest price of discounted products
And I save my changes
Then I should be notified that it has been successfully edited
And the "US Channel" channel should have the lowest price of discounted products prior to the current discount enabled

@todo
Scenario: Disabling showing the lowest price of discounted products on a channel
When I want to modify a channel "EU Channel"
And I disable showing the lowest price of discounted products
And I save my changes
Then I should be notified that it has been successfully edited
And the "EU Channel" channel should have the lowest price of discounted products prior to the current discount disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@managing_channels
Feature: Excluding chosen taxons from displaying the lowest price of discounted products
In order not to show the lowest price of discounted products on some taxons
As an Administrator
I want to be able to configure taxons for which the lowest price of discounted products is not displayed

Background:
Given the store operates on a channel named "Poland"
And the store classifies its products as "T-Shirts", "Caps" and "Sweaters"
And I am logged in as an administrator

@todo @javascript
Scenario: Excluding a singular taxon from displaying the lowest price of discounted products
When I want to modify a channel "Poland"
And I exclude the "T-Shirts" taxon from showing the lowest price of discounted products
And I save my changes
Then I should be notified that it has been successfully edited
And this channel should have "T-Shirts" taxon excluded from displaying the lowest price of discounted products

@todo @javascript
Scenario: Excluding multiple taxons from displaying the lowest price of discounted products
When I want to modify a channel "Poland"
And I exclude the "T-Shirts" and "Caps" taxons from showing the lowest price of discounted products
And I save my changes
Then I should be notified that it has been successfully edited
And this channel should have "T-Shirts" and "Caps" taxons excluded from displaying the lowest price of discounted products

@todo @no-api @javascript
Scenario: Removing excluded taxon from displaying the lowest price of discounted products
Given the channel "Poland" has "T-Shirts" and "Caps" taxons excluded from showing the lowest price of discounted products
When I want to modify this channel
And I remove the "T-Shirts" taxon from excluded taxons from showing the lowest price of discounted products
And I save my changes
Then I should be notified that it has been successfully edited
And this channel should have "Caps" taxon excluded from displaying the lowest price of discounted products
And this channel should not have "T-Shirts" taxon excluded from displaying the lowest price of discounted products
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@accessing_price_history
Feature: Accessing the price history from the configurable product show page
In order to check the price history of an product variant
As an Administrator
I want to be able to access the price history's page for the given channel from a configurable product show page

Background:
Given the store operates on a single channel in "United States"
And the store has a "Wyborowa Vodka" configurable product
And the product "Wyborowa Vodka" has a "Wyborowa Vodka Exquisite" variant priced at "$40.00" and originally priced at "$15.00"
And the product "Wyborowa Vodka" has a "Wyborowa Vodka Lemon" variant priced at "$10.00"
And I am logged in as an administrator

@todo @no-api
Scenario: Being able to access the price history of variant from the configurable product show page
Given I am browsing products
When I access "Wyborowa Vodka" product page
And I access the price history of a product variant "Wyborowa Vodka Exquisite" for "United States" channel
Then I should see 1 log entries in the catalog price history
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@accessing_price_history
Feature: Accessing the price history from the simple product show page
In order to check the price history of a simple product
As an Administrator
I want to be able to access the price history's page for the given channel from a simple product show page

Background:
Given the store operates on a single channel in "United States"
And the store has a product "Ursus C-355" priced at "$1000.00" in "United States" channel
And there is a catalog promotion with "company_bankruptcy_sale" code and "Company bankruptcy sale" name
And the catalog promotion "Company bankruptcy sale" is available in "United States"
And it applies on "Ursus C-355" product
And it reduces price by "90%"
And it is enabled
And I am logged in as an administrator

@todo @no-api
Scenario: Being able to access price history from simple product show page
Given I am browsing products
When I access "Ursus C-355" product page
And I access the price history of a simple product for "United States" channel
Then I should see 2 log entries in the catalog price history
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@managing_catalog_promotions
Feature: Seeing the price history of a product variant after changes to catalog promotions
In order to be aware of historical variant prices
As an Administrator
I want to browse the catalog price history of a specific variant

Background:
Given the store operates on a single channel in "United States"
And the store has a "Wyborowa Vodka" configurable product
And there is a catalog promotion "Winter sale" with priority 1 that reduces price by "50%" and applies on "Wyborowa Vodka" product
And there is a catalog promotion "Christmas sale" with priority 2 that reduces price by fixed "$5.00" in the "United States" channel and applies on "Wyborowa Vodka" product
And the product "Wyborowa Vodka" has a "Wyborowa Vodka Exquisite" variant priced at "$40.00" and originally priced at "$15.00"
And the product "Wyborowa Vodka" has a "Wyborowa Vodka Lemon" variant priced at "$10.00"
And there is an exclusive catalog promotion "Extra sale" with priority 10 that reduces price by "10%" and applies on "Wyborowa Vodka Lemon" variant
And I am logged in as an administrator

@todo
Scenario: Seeing the catalog price history of a variant with many catalog promotions
And I go to the price history of a variant with code "WYBOROWA_VODKA_EXQUISITE"
Then I should see 2 log entries in the catalog price history
And there should be a log entry on the 1st position with the "$5.00" selling price, "$15.00" original price and datetime of the price change
And there should be a log entry on the 2nd position with the "$40.00" selling price, "$15.00" original price and datetime of the price change

@todo
Scenario: Seeing the catalog price history of a variant with one catalog promotion
And I go to the price history of a variant with code "WYBOROWA_VODKA_LEMON"
Then I should see 2 log entries in the catalog price history
And there should be a log entry on the 1st position with the "$9.00" selling price, "$10.00" original price and datetime of the price change
And there should be a log entry on the 2nd position with the "$10.00" selling price, no original price and datetime of the price change
Loading

0 comments on commit 9d3d6f9

Please sign in to comment.