Skip to content

Commit

Permalink
Changes to scenario and serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
arti0090 committed May 24, 2021
1 parent 55f1073 commit aa54eee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@shopping_cart
Feature: Seeing detailed information of cart
In order to see detailed information of my cart
In order to know more about status of my cart
As a Visitor
I want to be able to see those information of my cart
I want to be able to see detailed information of my cart

Background:
Given the store operates on a single channel in "United States"
Expand All @@ -12,11 +12,10 @@ Feature: Seeing detailed information of cart
Scenario: Viewing items of my cart
When I add 5 of them to my cart
And I check items in my cart
Then my cart should have 5 items of product "T-shirt banana"
Then my cart should have quantity of 5 items of product "T-shirt banana"

@api
Scenario: Viewing items total of my cart
When I add 5 of them to my cart
And I check details of my cart
Then my cart should have "$62.70" items total

1 change: 1 addition & 0 deletions src/Sylius/Behat/Context/Api/Shop/CartContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ public function myCartShouldHaveItemsTotal(int $itemsTotal): void

/**
* @Then /^my cart should have (\d+) items of (product "([^"]+)")$/
* @Then /^my cart should have quantity of (\d+) items of (product "([^"]+)")$/
*/
public function myCartShouldHaveItems(int $quantity, ProductInterface $product): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<itemOperation name="shop_get">
<attribute name="method">GET</attribute>
<attribute name="path">/shop/orders/{tokenValue}</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:order:read</attribute>
</attribute>
</itemOperation>

<itemOperation name="shop_delete">
Expand All @@ -70,6 +73,9 @@
<attribute name="openapi_context">
<attribute name="summary">Deletes cart</attribute>
</attribute>
<attribute name="normalization_context">
<attribute name="groups">shop:order:read</attribute>
</attribute>
</itemOperation>

<itemOperation name="admin_cancel">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
</attribute>

<attribute name="itemsTotal">
<group>admin:order:read</group>
<group>shop:cart:read</group>
<group>shop:order:read</group>
<group>shop:order:account:read</group>
Expand Down

0 comments on commit aa54eee

Please sign in to comment.