Skip to content

Commit

Permalink
[PriceHistory] Reflect changes from the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafikooo committed Mar 17, 2023
1 parent af8844e commit 75b24af
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@managing_product_variants
@viewing_price_history
Feature: Seeing the correct catalog price history after creating a product variant
In order to be aware of historical product prices
As an Administrator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@managing_product_variants
@viewing_price_history
Feature: Seeing the correct catalog price history after editing a product variant
In order to be aware of historical product prices
As an Administrator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@managing_catalog_promotions
@viewing_price_history_after_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
Expand All @@ -14,14 +14,14 @@ Feature: Seeing the price history of a product variant after changes to catalog
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
@api
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
@api
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@managing_catalog_promotions
@viewing_price_history_after_catalog_promotions
Feature: Seeing the price history of a simple product after changes to catalog promotions
In order to be aware of historical simple product prices
As an Administrator
Expand All @@ -13,7 +13,7 @@ Feature: Seeing the price history of a simple product after changes to catalog p
And it reduces price by "90%"
And I am logged in as an administrator

@todo
@api
Scenario: Seeing the catalog price history of a simple product
Given the "Winter sale" catalog promotion is enabled
When I disable "Winter sale" catalog promotion
Expand All @@ -23,7 +23,7 @@ Feature: Seeing the price history of a simple product after changes to catalog p
And there should be a log entry on the 2nd position with the "$10.00" selling price, "$100.00" original price and datetime of the price change
And there should be a log entry on the 3rd position with the "$100.00" selling price, no original price and datetime of the price change

@todo
@api
Scenario: Seeing the catalog price history of a simple product with a price different than an original price
Given "Wyborowa Vodka" variant is originally priced at "$120.00" in "United States" channel
And the "Winter sale" catalog promotion is enabled
Expand Down
4 changes: 3 additions & 1 deletion src/Sylius/Behat/Resources/config/suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ imports:
- suites/api/product/managing_product_variants.yml
- suites/api/product/managing_product_variants_ajax.yml
- suites/api/product/managing_products.yml
- suites/api/product/viewing_products.yml
- suites/api/product/viewing_price_history.yml
- suites/api/product/viewing_price_history_after_catalog_promotions.yml
- suites/api/product/viewing_product_reviews.yml
- suites/api/product/viewing_product_variants.yml
- suites/api/product/viewing_products.yml
- suites/api/promotion/applying_catalog_promotions.yml
- suites/api/promotion/applying_promotion_coupon.yml
- suites/api/promotion/applying_promotion_rules.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski

default:
suites:
api_viewing_price_history:
contexts:
- sylius.behat.context.hook.doctrine_orm

- sylius.behat.context.transform.channel
- sylius.behat.context.transform.lexical
- sylius.behat.context.transform.product
- sylius.behat.context.transform.product_variant
- sylius.behat.context.transform.shared_storage

- sylius.behat.context.setup.admin_api_security
- sylius.behat.context.setup.admin_user
- sylius.behat.context.setup.channel
- sylius.behat.context.setup.product
- Sylius\Behat\Context\Setup\CatalogPromotionContext

- sylius.behat.context.api.admin.managing_product_variants
- sylius.behat.context.api.admin.save
- Sylius\Behat\Context\Api\Admin\ChannelPricingLogEntryContext
filters:
tags: "@viewing_price_history&&@api"
javascript: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski

default:
suites:
api_viewing_price_history_after_catalog_promotions:
contexts:
- sylius.behat.context.hook.doctrine_orm

- sylius.behat.context.transform.channel
- sylius.behat.context.transform.lexical
- sylius.behat.context.transform.product
- sylius.behat.context.transform.product_variant
- sylius.behat.context.transform.shared_storage
- Sylius\Behat\Context\Transform\CatalogPromotionContext

- sylius.behat.context.setup.admin_api_security
- sylius.behat.context.setup.admin_user
- sylius.behat.context.setup.channel
- sylius.behat.context.setup.product
- Sylius\Behat\Context\Setup\CatalogPromotionContext

- sylius.behat.context.api.admin.managing_catalog_promotions
- Sylius\Behat\Context\Api\Admin\ChannelPricingLogEntryContext

filters:
tags: "@viewing_price_history_after_catalog_promotions&&@api"
javascript: false
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@

<many-to-one field="productVariant" target-entity="Sylius\Component\Product\Model\ProductVariantInterface" inversed-by="channelPricings">
<join-column name="product_variant_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" />
<cascade>
<cascade-persist />
</cascade>
</many-to-one>
</mapped-superclass>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

<many-to-one field="channelPricing" target-entity="Sylius\Component\Core\Model\ChannelPricingInterface">
<join-column name="channel_pricing_id" nullable="false" on-delete="CASCADE" />
<cascade>
<cascade-persist />
</cascade>
</many-to-one>
</mapped-superclass>
</doctrine-mapping>

0 comments on commit 75b24af

Please sign in to comment.