diff --git a/features/product/managing_products/adding_images_to_existing_product.feature b/features/product/managing_products/adding_images_to_existing_product.feature index 4961898698..ed5b71b502 100644 --- a/features/product/managing_products/adding_images_to_existing_product.feature +++ b/features/product/managing_products/adding_images_to_existing_product.feature @@ -17,7 +17,16 @@ Feature: Adding images to an existing product Then I should be notified that it has been successfully uploaded And the product "Lamborghini Gallardo Model" should have an image with "banner" type - @ui @mink:chromedriver @api + @api @ui @mink:chromedriver + Scenario: Trying to add svg image to an existing product + Given the store has a product "Lamborghini Gallardo Model" + When I want to modify this product + And I attach the "sylius.svg" image + And I save my changes to the images + Then I should be notified that svg file is not allowed + And this product should not have any images + + @api @ui @mink:chromedriver Scenario: Adding multiple images to an existing product Given the store has a product "Lamborghini Gallardo Model" When I want to modify this product diff --git a/src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php b/src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php index 7a0b612136..bc8ef64dd6 100644 --- a/src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php +++ b/src/Sylius/Behat/Context/Ui/Admin/ManagingProductsContext.php @@ -1081,6 +1081,14 @@ final class ManagingProductsContext implements Context ); } + /** + * @Then I should be notified that svg file is not allowed + */ + public function iShouldBeNotifiedThatSvgTypeIsNotAllowed(): void + { + $this->assertValidationMessage('image', 'This file type is not allowed.'); + } + /** * @Then I should be notified that simple product code has to be unique */ diff --git a/src/Sylius/Behat/Resources/fixtures/sylius.svg b/src/Sylius/Behat/Resources/fixtures/sylius.svg new file mode 100755 index 0000000000..ae952b656d --- /dev/null +++ b/src/Sylius/Behat/Resources/fixtures/sylius.svg @@ -0,0 +1 @@ +sylius-logo \ No newline at end of file