mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Adjust behat tests
This commit is contained in:
parent
b847995f96
commit
7d6b4d6e5b
4 changed files with 16 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ Feature: Adding images to an existing product
|
|||
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 attach the "sylius.svg" image with "banner" type to this product
|
||||
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
|
||||
|
|
|
|||
|
|
@ -220,6 +220,19 @@ final class ManagingProductImagesContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that svg file is not allowed
|
||||
*/
|
||||
public function iShouldBeNotifiedThatSvgFileIsNotAllowed(): void
|
||||
{
|
||||
Assert::contains(
|
||||
$this->responseChecker->getError($this->client->getLastResponse()),
|
||||
sprintf(
|
||||
'The file is not a valid image.',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
private function createProductImage(
|
||||
string $path,
|
||||
ProductInterface $product,
|
||||
|
|
|
|||
|
|
@ -1086,7 +1086,7 @@ final class ManagingProductsContext implements Context
|
|||
*/
|
||||
public function iShouldBeNotifiedThatSvgTypeIsNotAllowed(): void
|
||||
{
|
||||
$this->assertValidationMessage('image', 'This file type is not allowed.');
|
||||
$this->mediaFormElement->hasValidationErrorWithMessage('This file type is not allowed.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ final class NotificationContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it :has been successfully deleted
|
||||
* @Then I should be notified that they :have been successfully deleted
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue