Skip to content

Commit

Permalink
Behat fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobTolkemit committed Feb 11, 2019
1 parent 3f24128 commit 5e1ec0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions features/shop/adding_products_to_cart.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@shop
@customer_options
@ui
@javascript
Feature: Adding products with customer options to cart
In order to buy a configured product
As a customer
Expand All @@ -25,7 +27,6 @@ Feature: Adding products with customer options to cart
And the store has a product "Cool Product" priced at "$10.00"
And product "Cool Product" has the customer option group "Some Group"

@ui @javascript
Scenario: Adding a product without required customer options to the cart
Given I view product "Cool Product"
When I enter value "some text" for customer option "Text Option"
Expand All @@ -36,20 +37,16 @@ Feature: Adding products with customer options to cart
And I should see "Cool Product" with unit price "$10.00" in my cart
And my cart's total should be "$10.00"

@ui
@javascript
Scenario: Adding a product with a priced value to the cart
Given I view product "Cool Product"
When I enter value "some text" for customer option "Text Option"
And I select value "Value 3" for customer option "Select Option"
And I enter value "42" for customer option "Number Option"
And I add it to the cart
Then I should be notified that the product has been successfully added
And I should see "Cool Product" with unit price "$10.00" in my cart
And I should see "Cool Product" with unit price "$15.00" in my cart
And my cart's total should be "$15.00"

@ui
@javascript
Scenario: Trying to add a product with unfilled required customer options to the cart
Given customer option "Number Option" is required
And I view product "Cool Product"
Expand All @@ -58,8 +55,6 @@ Feature: Adding products with customer options to cart
Then I should be notified that an option is required
And my cart should be empty

@ui
@javascript
Scenario: Trying to add a product with filled required customer options to the cart
Given customer option "Number Option" is required
And I view product "Cool Product"
Expand All @@ -68,21 +63,17 @@ Feature: Adding products with customer options to cart
Then I should be notified that the product has been successfully added
And I should see "Cool Product" with quantity 1 in my cart

@ui
@javascript
Scenario: Trying to add a product with invalid customer option input to the cart
Given I view product "Cool Product"
When I enter value "not a number" for customer option "Number Option"
And I add it to the cart
Then I should be notified that an option is invalid
And my cart should be empty

@ui
@javascript
Scenario: Trying to add a product with customer option value not meeting constraint
Given customer option "Number Option" has constraint 0 to 10
And I view product "Cool Product"
When I enter value "20" for customer option "Number Option"
And I add it to the cart
Then I should be notified that an option does not meet a constraint
And my cart should be empty
And my cart should be empty
2 changes: 1 addition & 1 deletion tests/Behat/Page/Product/ShowPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private function checkField(string $fieldName, bool $state): void
*/
public function hasRequiredCustomerOptionValidationMessage(): bool
{
$message = 'brille24.form.customer_options.required';
$message = 'This option is required';

return $this->hasValidationMessage($message);
}
Expand Down

0 comments on commit 5e1ec0a

Please sign in to comment.