Skip to content

Commit 63c3cf7

Browse files
committed
Test adding similar products
1 parent d25edf3 commit 63c3cf7

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

features/product/managing_products/preventing_xss_attack_while_adding_a_new_product.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ Feature: Preventing a potential XSS attack while adding new product
77
Background:
88
Given the store operates on a single channel in "United States"
99
And the store has "<script>alert('xss')</script>" taxonomy
10+
And the store has "No XSS" taxonomy
1011
And I am logged in as an administrator
1112

1213
@ui @javascript @no-api
1314
Scenario: Preventing a potential XSS attack while adding new product
1415
When I want to create a new simple product
1516
Then I should be able to name it "No XSS" in "English (United States)"
17+
18+
@ui @javascript @no-api
19+
Scenario: Preventing a potential XSS attack while choosing main taxon for a new product
20+
When I want to create a new simple product
21+
Then I should be able to choose main taxon "No XSS"
22+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@managing_products
2+
Feature: Preventing a potential XSS attack while selecting similar product
3+
In order to keep my information safe
4+
As an Administrator
5+
I want to be protected against the potential XSS attacks
6+
7+
Background:
8+
Given the store operates on a single channel in "United States"
9+
And the store has a product association type "Accessories"
10+
And the store has "<script>alert('xss')</script>" and "LG headphones" products
11+
And I am logged in as an administrator
12+
13+
@ui @javascript @no-api
14+
Scenario: Preventing a potential XSS attack while editing product
15+
When I want to create a new simple product
16+
Then I should be able to associate as "Accessories" the "LG headphones" product

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ public function theOptionFieldShouldBeDisabled()
748748

749749
/**
750750
* @When /^I choose main (taxon "[^"]+")$/
751+
* @When /^I should be able to choose main taxon "([^"]+)"$/
751752
*/
752753
public function iChooseMainTaxon(TaxonInterface $taxon)
753754
{
@@ -820,6 +821,7 @@ public function iAttachImageWithType($path, $type = null)
820821

821822
/**
822823
* @When I associate as :productAssociationType the :productName product
824+
* @When I should be able to associate as :productAssociationType the :productName product
823825
* @When I associate as :productAssociationType the :firstProductName and :secondProductName products
824826
*/
825827
public function iAssociateProductsAsProductAssociation(

0 commit comments

Comments
 (0)