Skip to content

Commit

Permalink
OP-291: Refactor behats
Browse files Browse the repository at this point in the history
  • Loading branch information
hmfilar committed Jul 26, 2024
1 parent 6d7a7dd commit 72eff60
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 91 deletions.
37 changes: 36 additions & 1 deletion features/adding_product_to_wishlist.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@wishlist
@wishlist @api_wishlist
Feature: Adding a product to wishlist
In order to compare or buy products later
As a Visitor
Expand Down Expand Up @@ -41,3 +41,38 @@ Feature: Adding a product to wishlist
And I log out
And I log in again
Then I should have one item in my wishlist

@api
Scenario: Adding a product to wishlist with API as an anonymous user
Given user has a wishlist
And the store has a product "Jack Daniels Gentleman" priced at "$10.00"
When user adds product "Jack Daniels Gentleman" to the wishlist
Then user should have product "Jack Daniels Gentleman" in the wishlist

@api
Scenario: Adding a product to wishlist with API as an authenticated user
Given there is a user "test@example.com"
And user "test@example.com" "sylius" is authenticated
And the store has a product "Jack Daniels Gentleman" priced at "$10.00"
When user has a wishlist
And user adds product "Jack Daniels Gentleman" to the wishlist
Then user should have product "Jack Daniels Gentleman" in the wishlist

@api
Scenario: Anonymous user tries to add product to another user's wishlist with API
Given there is a user "test@example.com"
And user "test@example.com" "sylius" is authenticated
And the store has a product "Jack Daniels Gentleman" priced at "$10.00"
When user has a wishlist
And user is unauthenticated
Then user tries to add product "Jack Daniels Gentleman" to the wishlist

@api
Scenario: Authenticated user tries to add product to another user's wishlist with API
Given there is a user "test@example.com"
And user "test@example.com" "sylius" is authenticated
And the store has a product "Jack Daniels Gentleman" priced at "$10.00"
When user has a wishlist
And there is a user "test1@example.com"
And user "test1@example.com" "sylius" is authenticated
Then user tries to add product "Jack Daniels Gentleman" to the wishlist
39 changes: 37 additions & 2 deletions features/adding_product_to_wishlist_on_multiple_channels.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@wishlist
@wishlist @api_wishlist
Feature: Adding a product to wishlist
In order to compare or buy products later
As a Visitor
Expand All @@ -12,7 +12,7 @@ Feature: Adding a product to wishlist
And all store products appear under a main taxonomy

@ui
Scenario: Adding product to wishlist in the first channel checking wishlist on the second channel.
Scenario: Adding product to wishlist in the first channel checking wishlist on the second channel
Given I change my current channel to "Web-EU"
When I add "Leprechaun's Silver" product to my wishlist
And I should be notified that the product has been successfully added to my wishlist
Expand Down Expand Up @@ -65,3 +65,38 @@ Feature: Adding a product to wishlist
And I go to the wishlist page
And I should have one item in my wishlist

@api
Scenario: Adding product to wishlist with API in the first channel checking wishlist on the second channel
Given I am browsing channel "Web-EU"
And user has a wishlist
When user adds product "Leprechaun's Silver" to the wishlist in "Web-EU"
Then user should have product "Leprechaun's Silver" in the wishlist
Then I am browsing channel "Web-US"
And user has a wishlist in "Web-US"
Then user should have an empty wishlist in "Web-US"

@api
Scenario: Adding product to wishlisht with API on both channels
Given I change my current channel to "Web-EU"
And user has a wishlist in "Web-EU"
When user adds product "Leprechaun's Silver" to the wishlist in "Web-EU"
Then user should have product "Leprechaun's Silver" in the wishlist
Then I change my current channel to "Web-US"
And user has a wishlist in "Web-US"
When user adds product "Leprechaun's Gold" to the wishlist in "Web-US"
Then user should have product "Leprechaun's Gold" in the wishlist

@api
Scenario: Adding product to wishlist with API on both channels and removing from one channel
Given I change my current channel to "Web-EU"
And user has a wishlist in "Web-EU"
When user adds product "Leprechaun's Silver" to the wishlist in "Web-EU"
Then user should have product "Leprechaun's Silver" in the wishlist
Then I change my current channel to "Web-US"
And user has a wishlist in "Web-US"
When user adds product "Leprechaun's Gold" to the wishlist in "Web-US"
Then user should have product "Leprechaun's Gold" in the wishlist
Then user removes product "Leprechaun's Gold" from the wishlist
Then user should have an empty wishlist
And I change my current channel to "Web-EU"
Then user should have product "Leprechaun's Silver" in the wishlist on "Web-EU"
39 changes: 0 additions & 39 deletions features/api/adding_product_to_wishlist.feature

This file was deleted.

This file was deleted.

0 comments on commit 72eff60

Please sign in to comment.