Skip to content

Commit

Permalink
Test adding similar products
Browse files Browse the repository at this point in the history
  • Loading branch information
mpysiak committed May 10, 2024
1 parent d25edf3 commit 63c3cf7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ Feature: Preventing a potential XSS attack while adding new product
Background:
Given the store operates on a single channel in "United States"
And the store has "<script>alert('xss')</script>" taxonomy
And the store has "No XSS" taxonomy
And I am logged in as an administrator

@ui @javascript @no-api
Scenario: Preventing a potential XSS attack while adding new product
When I want to create a new simple product
Then I should be able to name it "No XSS" in "English (United States)"

@ui @javascript @no-api
Scenario: Preventing a potential XSS attack while choosing main taxon for a new product
When I want to create a new simple product
Then I should be able to choose main taxon "No XSS"

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@managing_products
Feature: Preventing a potential XSS attack while selecting similar product
In order to keep my information safe
As an Administrator
I want to be protected against the potential XSS attacks

Background:
Given the store operates on a single channel in "United States"
And the store has a product association type "Accessories"
And the store has "<script>alert('xss')</script>" and "LG headphones" products
And I am logged in as an administrator

@ui @javascript @no-api
Scenario: Preventing a potential XSS attack while editing product
When I want to create a new simple product
Then I should be able to associate as "Accessories" the "LG headphones" product
2 changes: 2 additions & 0 deletions src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ public function theOptionFieldShouldBeDisabled()

/**
* @When /^I choose main (taxon "[^"]+")$/
* @When /^I should be able to choose main taxon "([^"]+)"$/
*/
public function iChooseMainTaxon(TaxonInterface $taxon)
{
Expand Down Expand Up @@ -820,6 +821,7 @@ public function iAttachImageWithType($path, $type = null)

/**
* @When I associate as :productAssociationType the :productName product
* @When I should be able to associate as :productAssociationType the :productName product
* @When I associate as :productAssociationType the :firstProductName and :secondProductName products
*/
public function iAssociateProductsAsProductAssociation(
Expand Down

0 comments on commit 63c3cf7

Please sign in to comment.