Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 568bb0a

Browse files
committed
[Behat] add no-api tag to simple product create tests
[Behat] add no-api tag to simple product create tests [Behat] add no-api tag to simple product create tests [Behat] review fixes [Behat] added/removed no-api tags from some scenarios [Behat] added/removed no-api tags from some scenarios [Behat] added/removed no-api tags from some scenarios [Behat] creating product with an autogenerated slug now creates configurable product instead of simple [Behat] suggested changes
1 parent cdad46f commit 568bb0a

9 files changed

Lines changed: 24 additions & 46 deletions

features/product/managing_products/adding_product.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Adding a new product
99
And the store has "Standard" shipping category
1010
And I am logged in as an administrator
1111

12-
@ui @api
12+
@ui @no-api
1313
Scenario: Adding a new simple product with price
1414
Given I want to create a new simple product
1515
When I specify its code as "BOARD_DICE_BREWING"
@@ -20,7 +20,7 @@ Feature: Adding a new product
2020
Then I should be notified that it has been successfully created
2121
And the product "Dice Brewing" should appear in the store
2222

23-
@ui
23+
@ui @no-api
2424
Scenario: Adding a new simple product with discounted price
2525
Given I want to create a new simple product
2626
When I specify its code as "BOARD_DICE_BREWING"
@@ -32,7 +32,7 @@ Feature: Adding a new product
3232
Then I should be notified that it has been successfully created
3333
And the product "Dice Brewing" should appear in the store
3434

35-
@ui @api
35+
@ui @no-api
3636
Scenario: Adding a new simple free product
3737
When I want to create a new simple product
3838
And I specify its code as "BOARD_DICE_BREWING"
@@ -43,7 +43,7 @@ Feature: Adding a new product
4343
Then I should be notified that it has been successfully created
4444
And the product "Dice Brewing" should appear in the store
4545

46-
@ui
46+
@ui @no-api
4747
Scenario: Adding a new simple product with specific shipping category
4848
Given I want to create a new simple product
4949
When I specify its code as "BOARD_DICE_BREWING"
@@ -79,7 +79,7 @@ Feature: Adding a new product
7979
Then I should be notified that it has been successfully created
8080
And the product "Gentleman Jack" should appear in the store
8181

82-
@ui
82+
@ui @no-api
8383
Scenario: Adding a new simple product without shipping required
8484
Given I want to create a new simple product
8585
When I specify its code as "BOARD_DICE_BREWING"

features/product/managing_products/adding_product_with_images.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: Adding a new product with images
88
Given the store operates on a single channel in "United States"
99
And I am logged in as an administrator
1010

11-
@ui @javascript
11+
@ui @javascript @no-api
1212
Scenario: Adding a new simple product with a single image
1313
Given I want to create a new simple product
1414
When I specify its code as "LAMBORGHINI_GALLARDO"
@@ -19,7 +19,7 @@ Feature: Adding a new product with images
1919
Then I should be notified that it has been successfully created
2020
And the product "Lamborghini Gallardo Model" should have an image with "banner" type
2121

22-
@ui @javascript
22+
@ui @javascript @no-api
2323
Scenario: Adding a new simple product with multiple images
2424
Given I want to create a new simple product
2525
When I specify its code as "LAMBORGHINI_GALLARDO"

features/product/managing_products/adding_product_with_only_original_price.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: Adding a product with only original price
88
Given the store operates on a single channel in "United States"
99
And I am logged in as an administrator
1010

11-
@ui
11+
@ui @no-api
1212
Scenario: Adding a new simple product without price
1313
When I want to create a new simple product
1414
And I specify its code as "BOARD_DICE_BREWING"

features/product/managing_products/adding_product_with_prices_for_multiple_channels.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Feature: Adding product with prices for multiple channels
1010
And the store operates on another channel named "Web-GB" in "GBP" currency
1111
And I am logged in as an administrator
1212

13-
@ui
13+
@ui @no-api
1414
Scenario: Configure prices for each channel and currency while adding a new simple product
1515
When I want to create a new simple product
1616
And I specify its code as "BOARD_DICE_BREWING"
@@ -23,7 +23,7 @@ Feature: Adding product with prices for multiple channels
2323
And product "Dice Brewing" should be priced at $10.00 for channel "Web-US"
2424
And product "Dice Brewing" should be priced at £5.00 for channel "Web-GB"
2525

26-
@ui
26+
@ui @no-api
2727
Scenario: Configure prices for each channel while adding a new simple product
2828
When I want to create a new simple product
2929
And I specify its code as "BOARD_DICE_BREWING"
@@ -57,7 +57,7 @@ Feature: Adding product with prices for multiple channels
5757
And I add it
5858
Then I should be notified that price must be defined for every channel
5959

60-
@ui
60+
@ui @no-api
6161
Scenario: Do not specify price while adding a new simple product
6262
When I want to create a new simple product
6363
And I specify its code as "BOARD_DICE_BREWING"

features/product/managing_products/changing_images_of_product.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Feature: Changing images of an existing product
77
Background:
88
Given I am logged in as an administrator
99

10-
@ui @javascript
10+
@ui @javascript @no-api
1111
Scenario: Changing a single image of a simple product
1212
Given the store has a product "Lamborghini Gallardo Model"
1313
And this product has an image "ford.jpg" with "thumbnail" type
@@ -27,7 +27,7 @@ Feature: Changing images of an existing product
2727
Then I should be notified that it has been successfully edited
2828
And this product should have an image with "thumbnail" type
2929

30-
@ui @javascript
30+
@ui @javascript @no-api
3131
Scenario: Changing the type of image of a simple product
3232
Given the store has a product "Lamborghini Ford Model"
3333
And this product has an image "lamborghini.jpg" with "thumbnail" type

features/product/managing_products/editing_product_slug.feature

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,17 @@ Feature: Editing product's slug
1010

1111
@ui @javascript @api
1212
Scenario: Creating a product with an autogenerated slug
13-
When I want to create a new simple product
13+
When I want to create a new configurable product
1414
And I specify its code as "BOARD_MANSION_OF_MADNESS"
1515
And I name it "Mansion of Madness" in "English (United States)"
16-
And I set its price to "$100.00" for "United States" channel
1716
And I add it
1817
Then the slug of the "Mansion of Madness" product should be "mansion-of-madness"
1918

2019
@ui @javascript @api
2120
Scenario: Creating a product with a custom slug
22-
Given I want to create a new simple product
21+
Given I want to create a new configurable product
2322
When I specify its code as "BOARD_MANSION_OF_MADNESS"
2423
And I name it "Mansion of Madness" in "English (United States)"
25-
And I set its price to "$100.00" for "United States" channel
2624
And I set its slug to "mom-board-game" in "English (United States)"
2725
And I add it
2826
Then the slug of the "Mansion of Madness" product should be "mom-board-game"

features/product/managing_products/product_validation.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Feature: Products validation
1313
And this product attribute has set min value as 3 and max value as 30
1414
And I am logged in as an administrator
1515

16-
@ui
16+
@ui @no-api
1717
Scenario: Adding a new simple product without specifying its code
1818
Given I want to create a new simple product
1919
When I name it "Dice Brewing" in "English (United States)"
@@ -22,7 +22,7 @@ Feature: Products validation
2222
Then I should be notified that code is required
2323
And product with name "Dice Brewing" should not be added
2424

25-
@ui
25+
@ui @no-api
2626
Scenario: Adding a new simple product with duplicated code among products
2727
Given the store has a product "7 Wonders" with code "AWESOME_GAME"
2828
And I want to create a new simple product
@@ -33,7 +33,7 @@ Feature: Products validation
3333
Then I should be notified that code has to be unique
3434
And product with name "Dice Brewing" should not be added
3535

36-
@ui
36+
@ui @no-api
3737
Scenario: Adding a new simple product with duplicated code among product variants
3838
Given the store has a product "7 Wonders"
3939
And this product has "7 Wonders: Cities" variant priced at "$30" identified by "AWESOME_GAME"
@@ -45,7 +45,7 @@ Feature: Products validation
4545
Then I should be notified that simple product code has to be unique
4646
And product with name "Dice Brewing" should not be added
4747

48-
@ui
48+
@ui @no-api
4949
Scenario: Adding a new simple product without specifying its slug
5050
Given I want to create a new simple product
5151
When I specify its code as "BOARD_DICE_BREWING"
@@ -56,7 +56,7 @@ Feature: Products validation
5656
Then I should be notified that slug is required
5757
And product with name "Dice Brewing" should not be added
5858

59-
@ui
59+
@ui @no-api
6060
Scenario: Adding a new simple product without specifying its name
6161
Given I want to create a new simple product
6262
When I specify its code as "BOARD_DICE_BREWING"
@@ -65,7 +65,7 @@ Feature: Products validation
6565
Then I should be notified that name is required
6666
And product with code "BOARD_DICE_BREWING" should not be added
6767

68-
@ui
68+
@ui @no-api
6969
Scenario: Adding a new simple product without specifying its price for every channel
7070
Given the store operates on another channel named "Web-GB"
7171
When I want to create a new simple product
@@ -106,7 +106,7 @@ Feature: Products validation
106106
And product with code "BOARD_DICE_BREWING" should not be added
107107

108108
@ui @api
109-
Scenario: Trying to remove name from existing simple product
109+
Scenario: Trying to remove name from existing product
110110
Given the store has a "Dice Brewing" product
111111
And I want to modify this product
112112
When I remove its name from "English (United States)" translation
@@ -133,7 +133,7 @@ Feature: Products validation
133133
And I save my changes
134134
Then I should be notified that I have to define product variants' prices for newly assigned channels first
135135

136-
@ui
136+
@ui @no-api
137137
Scenario: Adding a new simple product with price
138138
Given the store has a "7 Wonders" configurable product with "7-wonders" slug
139139
And I want to create a new configurable product

features/product/managing_products/select_taxons_for_new_product.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Feature: Select taxon for a new product
2121
Then I should be notified that it has been successfully created
2222
And main taxon of product "Gentleman Jack" should be "Sad"
2323

24-
@ui @javascript @api
24+
@ui @javascript @no-api
2525
Scenario: Specifying main taxon for simple product
2626
When I want to create a new simple product
2727
And I choose main taxon "Sad"

src/Sylius/Behat/Context/Api/Admin/ManagingProductsContext.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,6 @@ public function iRenameItToIn(?string $name = null, string $localeCode = 'en_US'
131131
$this->client->updateRequestData($data);
132132
}
133133

134-
/**
135-
* @When /^I set its(?:| default) price to "(?:€|£|\$)([^"]+)" for ("[^"]+" channel)$/
136-
*/
137-
public function iSetItsPriceTo(string $price, ChannelInterface $channel): void
138-
{
139-
$localeCode = $channel->getLocales()->first()->getCode();
140-
141-
$data = [
142-
'translations' => [
143-
$localeCode => [
144-
'locale' => $localeCode,
145-
'price' => $price,
146-
],
147-
],
148-
'channel' => $this->iriConverter->getIriFromItem($channel),
149-
];
150-
151-
$this->client->updateRequestData($data);
152-
}
153-
154134
/**
155135
* @When I set its slug to :slug
156136
* @When I set its slug to :slug in :localeCode

0 commit comments

Comments
 (0)