mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-15 01:20:59 +00:00
[Behat] Notifcation context extraction
This commit is contained in:
parent
6f962e2728
commit
46181b8039
43 changed files with 109 additions and 540 deletions
|
|
@ -27,6 +27,7 @@
|
|||
<parameter key="sylius.behat.context.ui.admin.managing_taxons.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxonsContext</parameter>
|
||||
<parameter key="sylius.behat.context.ui.admin.managing_tax_rate.class">Sylius\Behat\Context\Ui\Admin\ManagingTaxRateContext</parameter>
|
||||
<parameter key="sylius.behat.context.ui.admin.managing_zones.class">Sylius\Behat\Context\Ui\Admin\ManagingZonesContext</parameter>
|
||||
<parameter key="sylius.behat.context.ui.admin.notification.class">Sylius\Behat\Context\Ui\Admin\NotificationContext</parameter>
|
||||
|
||||
<parameter key="sylius.behat.context.ui.cart.class">Sylius\Behat\Context\Ui\CartContext</parameter>
|
||||
<parameter key="sylius.behat.context.ui.channel.class">Sylius\Behat\Context\Ui\ChannelContext</parameter>
|
||||
|
|
@ -53,7 +54,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.country.create" />
|
||||
<argument type="service" id="sylius.behat.page.admin.country.update" />
|
||||
<argument type="service" id="sylius.behat.current_page_resolver" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -62,7 +62,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.currency.create" />
|
||||
<argument type="service" id="sylius.behat.page.admin.currency.update" />
|
||||
<argument type="service" id="sylius.behat.current_page_resolver" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -70,7 +69,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.customer.create" />
|
||||
<argument type="service" id="sylius.behat.page.admin.customer.index" />
|
||||
<argument type="service" id="sylius.behat.page.admin.customer.update" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -78,7 +76,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.locale.create" />
|
||||
<argument type="service" id="sylius.behat.page.admin.locale.index" />
|
||||
<argument type="service" id="sylius.behat.page.admin.locale.update" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -87,7 +84,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.payment_method.index" />
|
||||
<argument type="service" id="sylius.behat.page.admin.payment_method.update" />
|
||||
<argument type="service" id="sylius.behat.current_page_resolver" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -96,7 +92,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.product_attribute.index" />
|
||||
<argument type="service" id="sylius.behat.page.admin.product_attribute.update" />
|
||||
<argument type="service" id="sylius.behat.current_page_resolver" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -105,7 +100,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.product_option.create" />
|
||||
<argument type="service" id="sylius.behat.page.admin.product_option.update" />
|
||||
<argument type="service" id="sylius.behat.current_page_resolver" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -134,7 +128,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.tax_category.create" />
|
||||
<argument type="service" id="sylius.behat.page.admin.tax_category.update" />
|
||||
<argument type="service" id="sylius.behat.current_page_resolver" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -142,7 +135,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.taxon.create" />
|
||||
<argument type="service" id="sylius.behat.page.admin.taxon.update" />
|
||||
<argument type="service" id="sylius.behat.current_page_resolver" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -151,7 +143,6 @@
|
|||
<argument type="service" id="sylius.behat.page.admin.tax_rate.create" />
|
||||
<argument type="service" id="sylius.behat.page.admin.tax_rate.update" />
|
||||
<argument type="service" id="sylius.behat.current_page_resolver" />
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
|
|
@ -164,6 +155,11 @@
|
|||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
<service id="sylius.behat.context.ui.admin.notification" class="%sylius.behat.context.ui.admin.notification.class%" scope="scenario">
|
||||
<argument type="service" id="sylius.behat.notification_checker" />
|
||||
<tag name="sylius.behat.context" />
|
||||
</service>
|
||||
|
||||
<service id="sylius.behat.context.ui.cart" class="%sylius.behat.context.ui.cart.class%" scope="scenario">
|
||||
<argument type="service" id="sylius.behat.shared_storage" container="symfony" />
|
||||
<argument type="service" id="sylius.behat.page.shop.cart.cart_summary" />
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ default:
|
|||
- sylius.behat.context.setup.security
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_countries
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_countries && @ui"
|
||||
|
|
|
|||
|
|
@ -20,5 +20,6 @@ default:
|
|||
- sylius.behat.context.setup.zone
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_zones
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_zones && @ui"
|
||||
|
|
|
|||
|
|
@ -20,5 +20,6 @@ default:
|
|||
- sylius.behat.context.setup.zone
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_channels
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_channels && @ui"
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@ default:
|
|||
- sylius.behat.context.setup.currency
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_currencies
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_currencies && @ui"
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@ default:
|
|||
- sylius.behat.context.setup.security
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_locales
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_locales && @ui"
|
||||
|
|
|
|||
|
|
@ -16,5 +16,6 @@ default:
|
|||
- sylius.behat.context.transform.shared_storage
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_payment_methods
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_payment_methods && @ui"
|
||||
|
|
|
|||
|
|
@ -16,5 +16,6 @@ default:
|
|||
- sylius.behat.context.setup.security
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_product_attributes
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_product_attributes && @ui"
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@ default:
|
|||
- sylius.behat.context.setup.security
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_product_options
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_product_options && @ui"
|
||||
|
|
|
|||
|
|
@ -27,5 +27,6 @@ default:
|
|||
- sylius.behat.context.setup.taxonomy
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_promotions
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_promotions && @ui"
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ default:
|
|||
- sylius.behat.context.setup.zone
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_shipping_methods
|
||||
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_shipping_methods && @ui"
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ default:
|
|||
- sylius.behat.context.setup.taxation
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_tax_categories
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_tax_categories && @ui"
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@ default:
|
|||
- sylius.behat.context.setup.zone
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_tax_rate
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_tax_rates && @ui"
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@ default:
|
|||
- sylius.behat.context.setup.taxonomy
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_taxons
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_taxons && @ui"
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@ default:
|
|||
- sylius.behat.context.setup.user
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_customers
|
||||
- sylius.behat.context.ui.admin.notification
|
||||
filters:
|
||||
tags: "@managing_customers && @ui"
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ Feature: Adding a new country
|
|||
Given I want to add a new country
|
||||
When I choose "France"
|
||||
And I add it
|
||||
Then I should be notified about successful creation
|
||||
Then I should be notified that it has been successfully created
|
||||
And the country "France" should appear in the store
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Feature: Adding countries with provinces
|
|||
When I choose "United Kingdom"
|
||||
And I add the "Scotland" province with "GB-SCT" code
|
||||
And I add it
|
||||
Then I should be notified about successful creation
|
||||
Then I should be notified that it has been successfully created
|
||||
And the country "United Kingdom" should appear in the store
|
||||
And the country "United Kingdom" should have the "Scotland" province
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ Feature: Adding countries with provinces
|
|||
And I add the "Scotland" province with "GB-SCT" code
|
||||
And I add the "Northern Ireland" province with "GB-NIR" code and "N.Ireland" abbreviation
|
||||
And I add it
|
||||
Then I should be notified about successful creation
|
||||
Then I should be notified that it has been successfully created
|
||||
And the country "United Kingdom" should appear in the store
|
||||
And the country "United Kingdom" should have the "Scotland" province
|
||||
And the country "United Kingdom" should have the "Northern Ireland" province
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Feature: Editing country
|
|||
And I want to edit this country
|
||||
When I disable it
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this country should be disabled
|
||||
|
||||
@ui
|
||||
|
|
@ -22,7 +22,7 @@ Feature: Editing country
|
|||
And I want to edit this country
|
||||
When I enable it
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this country should be enabled
|
||||
|
||||
@ui
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Feature: Managing provinces of a country
|
|||
Given I want to edit this country
|
||||
When I add the "Scotland" province with "GB-SCT" code
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this country should have the "Scotland" province
|
||||
|
||||
@ui @javascript
|
||||
|
|
@ -22,7 +22,7 @@ Feature: Managing provinces of a country
|
|||
And I want to edit this country
|
||||
When I delete the "Northern Ireland" province of this country
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this country should not have the "Northern Ireland" province
|
||||
|
||||
@ui @javascript
|
||||
|
|
@ -32,6 +32,6 @@ Feature: Managing provinces of a country
|
|||
When I delete the "Northern Ireland" province of this country
|
||||
And I add the "Scotland" province with "GB-SCT" code
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this country should not have the "Northern Ireland" province
|
||||
And this country should have the "Scotland" province
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ Feature: Adding a new locale
|
|||
Given I want to create a new locale
|
||||
When I choose Norwegian
|
||||
And I add it
|
||||
Then I should be notified about successful creation
|
||||
Then I should be notified that it has been successfully created
|
||||
And the store should be available in the Norwegian language
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Feature: Editing a locale
|
|||
And I want to edit this locale
|
||||
When I disable it
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this locale should be disabled
|
||||
|
||||
@ui
|
||||
|
|
@ -22,5 +22,5 @@ Feature: Editing a locale
|
|||
And I want to edit this locale
|
||||
When I enable it
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this locale should be enabled
|
||||
|
|
|
|||
|
|
@ -27,5 +27,5 @@ Feature: Editing shipping method
|
|||
Given I want to modify a shipping method "UPS Carrier"
|
||||
When I rename it to "UPS Transport" in "English (United States)"
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this shipping method name should be "UPS Transport"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ Feature: Toggling a shipping method
|
|||
And I want to modify this shipping method
|
||||
When I disable it
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this shipping method should be disabled
|
||||
|
||||
@ui
|
||||
|
|
@ -24,5 +24,5 @@ Feature: Toggling a shipping method
|
|||
And I want to modify this shipping method
|
||||
When I enable it
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this shipping method should be enabled
|
||||
|
|
|
|||
|
|
@ -26,5 +26,5 @@ Feature: Editing tax category
|
|||
Given I want to modify a tax category "Alcohol"
|
||||
When I rename it to "Food & Alcohol"
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this tax category name should be "Food & Alcohol"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ Feature: Editing tax rate
|
|||
Given I want to modify a tax rate "European Union Sales Tax"
|
||||
When I rename it to "EU VAT"
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this tax rate name should be "EU VAT"
|
||||
|
||||
@ui
|
||||
|
|
@ -36,7 +36,7 @@ Feature: Editing tax rate
|
|||
Given I want to modify a tax rate "European Union Sales Tax"
|
||||
When I specify its amount as 16%
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this tax rate amount should be 16%
|
||||
|
||||
@ui
|
||||
|
|
@ -45,7 +45,7 @@ Feature: Editing tax rate
|
|||
And I want to modify a tax rate "European Union Sales Tax"
|
||||
And I change it to be applicable for the "Food and Beverage" tax category
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this tax rate should be applicable for the "Food and Beverage" tax category
|
||||
|
||||
@ui
|
||||
|
|
@ -54,5 +54,5 @@ Feature: Editing tax rate
|
|||
And I want to modify a tax rate "European Union Sales Tax"
|
||||
And I change its zone to "The Rest of the World"
|
||||
And I save my changes
|
||||
Then I should be notified about successful edition
|
||||
Then I should be notified that it has been successfully edited
|
||||
And this tax rate should be applicable in "The Rest of the World" zone
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingChannelsContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'channel';
|
||||
|
||||
/**
|
||||
* @var IndexPageInterface
|
||||
*/
|
||||
|
|
@ -111,14 +109,6 @@ final class ManagingChannelsContext implements Context
|
|||
$this->createPage->create();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the channel :channelName should appear in the registry
|
||||
* @Then the channel :channelName should be in the registry
|
||||
|
|
@ -316,14 +306,6 @@ final class ManagingChannelsContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(this channel) should be disabled$/
|
||||
*/
|
||||
|
|
@ -361,14 +343,6 @@ final class ManagingChannelsContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulDeletion()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it cannot be deleted
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ use Sylius\Behat\Page\Admin\Country\CreatePageInterface;
|
|||
use Sylius\Behat\Page\Admin\Country\IndexPageInterface;
|
||||
use Sylius\Behat\Page\Admin\Country\UpdatePageInterface;
|
||||
use Sylius\Behat\Service\CurrentPageResolverInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\Addressing\Model\CountryInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -26,8 +25,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingCountriesContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'country';
|
||||
|
||||
/**
|
||||
* @var IndexPageInterface
|
||||
*/
|
||||
|
|
@ -48,30 +45,22 @@ final class ManagingCountriesContext implements Context
|
|||
*/
|
||||
private $currentPageResolver;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param IndexPageInterface $indexPage
|
||||
* @param CreatePageInterface $createPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param CurrentPageResolverInterface $currentPageResolver
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
IndexPageInterface $indexPage,
|
||||
CreatePageInterface $createPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
CurrentPageResolverInterface $currentPageResolver
|
||||
) {
|
||||
$this->indexPage = $indexPage;
|
||||
$this->createPage = $createPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->currentPageResolver = $currentPageResolver;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -143,22 +132,6 @@ final class ManagingCountriesContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified about successful creation
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified about successful edition
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^the (country "([^"]+)") should appear in the store$/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use Sylius\Behat\Page\Admin\Currency\CreatePageInterface;
|
|||
use Sylius\Behat\Page\Admin\Currency\IndexPageInterface;
|
||||
use Sylius\Behat\Page\Admin\Currency\UpdatePageInterface;
|
||||
use Sylius\Behat\Service\CurrentPageResolverInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\Currency\Model\CurrencyInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -25,8 +24,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingCurrenciesContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'currency';
|
||||
|
||||
/**
|
||||
* @var IndexPageInterface
|
||||
*/
|
||||
|
|
@ -42,11 +39,6 @@ final class ManagingCurrenciesContext implements Context
|
|||
*/
|
||||
private $updatePage;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @var CurrentPageResolverInterface
|
||||
*/
|
||||
|
|
@ -57,20 +49,17 @@ final class ManagingCurrenciesContext implements Context
|
|||
* @param CreatePageInterface $createPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param CurrentPageResolverInterface $currentPageResolver
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
IndexPageInterface $indexPage,
|
||||
CreatePageInterface $createPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
CurrentPageResolverInterface $currentPageResolver
|
||||
) {
|
||||
$this->createPage = $createPage;
|
||||
$this->indexPage = $indexPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->currentPageResolver = $currentPageResolver;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -98,14 +87,6 @@ final class ManagingCurrenciesContext implements Context
|
|||
$this->createPage->create();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyCreated()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When I specify its exchange rate as :exchangeRate
|
||||
*/
|
||||
|
|
@ -161,14 +142,6 @@ final class ManagingCurrenciesContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(this currency) should be disabled$/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use Behat\Behat\Context\Context;
|
|||
use Sylius\Behat\Page\Admin\Crud\UpdatePageInterface;
|
||||
use Sylius\Behat\Page\Admin\Crud\IndexPageInterface;
|
||||
use Sylius\Behat\Page\Admin\Customer\CreatePageInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\User\Model\CustomerInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -24,8 +23,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingCustomersContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'customer';
|
||||
|
||||
/**
|
||||
* @var IndexPageInterface
|
||||
*/
|
||||
|
|
@ -41,27 +38,19 @@ final class ManagingCustomersContext implements Context
|
|||
*/
|
||||
private $updatePage;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param CreatePageInterface $createPage
|
||||
* @param IndexPageInterface $indexPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
CreatePageInterface $createPage,
|
||||
IndexPageInterface $indexPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
UpdatePageInterface $updatePage
|
||||
) {
|
||||
$this->createPage = $createPage;
|
||||
$this->indexPage = $indexPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -106,14 +95,6 @@ final class ManagingCustomersContext implements Context
|
|||
$this->createPage->create();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the customer :customer should appear in the store
|
||||
* @Then the customer :customer should still have this email
|
||||
|
|
@ -161,14 +142,6 @@ final class ManagingCustomersContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(this customer) with name "([^"]*)" should appear in the store$/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use Behat\Behat\Context\Context;
|
|||
use Sylius\Behat\Page\Admin\Locale\CreatePageInterface;
|
||||
use Sylius\Behat\Page\Admin\Locale\IndexPageInterface;
|
||||
use Sylius\Behat\Page\Admin\Locale\UpdatePageInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\Locale\Model\LocaleInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -24,8 +23,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingLocalesContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'locale';
|
||||
|
||||
/**
|
||||
* @var CreatePageInterface
|
||||
*/
|
||||
|
|
@ -41,27 +38,19 @@ final class ManagingLocalesContext implements Context
|
|||
*/
|
||||
private $updatePage;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param CreatePageInterface $createPage
|
||||
* @param IndexPageInterface $indexPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
CreatePageInterface $createPage,
|
||||
IndexPageInterface $indexPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
UpdatePageInterface $updatePage
|
||||
) {
|
||||
$this->createPage = $createPage;
|
||||
$this->indexPage = $indexPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -121,22 +110,6 @@ final class ManagingLocalesContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified about successful creation
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified about successful edition
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the store should be available in the :name language
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use Sylius\Behat\Page\Admin\Crud\IndexPageInterface;
|
|||
use Sylius\Behat\Page\Admin\PaymentMethod\CreatePageInterface;
|
||||
use Sylius\Behat\Page\Admin\PaymentMethod\UpdatePageInterface;
|
||||
use Sylius\Behat\Service\CurrentPageResolverInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\Payment\Model\PaymentMethodInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -26,8 +25,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingPaymentMethodsContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'payment_method';
|
||||
|
||||
/**
|
||||
* @var CreatePageInterface
|
||||
*/
|
||||
|
|
@ -48,30 +45,22 @@ final class ManagingPaymentMethodsContext implements Context
|
|||
*/
|
||||
private $currentPageResolver;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param CreatePageInterface $createPage
|
||||
* @param IndexPageInterface $indexPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param CurrentPageResolverInterface $currentPageResolver
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
CreatePageInterface $createPage,
|
||||
IndexPageInterface $indexPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
CurrentPageResolverInterface $currentPageResolver
|
||||
) {
|
||||
$this->createPage = $createPage;
|
||||
$this->indexPage = $indexPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->currentPageResolver = $currentPageResolver;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -146,14 +135,6 @@ final class ManagingPaymentMethodsContext implements Context
|
|||
$currentPage->chooseGateway($gatewayName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then this payment method :element should be :value
|
||||
*/
|
||||
|
|
@ -199,14 +180,6 @@ final class ManagingPaymentMethodsContext implements Context
|
|||
$this->createPage->create();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfullyCreated()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the payment method :paymentMethodName should appear in the registry
|
||||
* @Then the payment method :paymentMethodName should be in the registry
|
||||
|
|
@ -327,14 +300,6 @@ final class ManagingPaymentMethodsContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(this payment method) should no longer exist in the registry$/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use Sylius\Behat\Page\Admin\Crud\IndexPageInterface;
|
|||
use Sylius\Behat\Page\Admin\Product\Attribute\CreatePageInterface;
|
||||
use Sylius\Behat\Page\Admin\Product\Attribute\UpdatePageInterface;
|
||||
use Sylius\Behat\Service\CurrentPageResolverInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\Product\Model\AttributeInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -25,8 +24,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingProductAttributesContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'product_attribute';
|
||||
|
||||
/**
|
||||
* @var CreatePageInterface
|
||||
*/
|
||||
|
|
@ -42,11 +39,6 @@ final class ManagingProductAttributesContext implements Context
|
|||
*/
|
||||
private $updatePage;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @var CurrentPageResolverInterface
|
||||
*/
|
||||
|
|
@ -57,20 +49,17 @@ final class ManagingProductAttributesContext implements Context
|
|||
* @param IndexPageInterface $indexPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param CurrentPageResolverInterface $currentPageResolver
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
CreatePageInterface $createPage,
|
||||
IndexPageInterface $indexPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
CurrentPageResolverInterface $currentPageResolver
|
||||
) {
|
||||
$this->createPage = $createPage;
|
||||
$this->indexPage = $indexPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->currentPageResolver = $currentPageResolver;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -107,14 +96,6 @@ final class ManagingProductAttributesContext implements Context
|
|||
$this->createPage->create();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the attribute :name should appear in the store
|
||||
* @Then I should see the product attribute :name in the list
|
||||
|
|
@ -154,14 +135,6 @@ final class ManagingProductAttributesContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the code field should be disabled
|
||||
*/
|
||||
|
|
@ -276,14 +249,6 @@ final class ManagingProductAttributesContext implements Context
|
|||
$this->indexPage->deleteResourceOnPage(['code' => $productAttribute->getCode(), 'name' => $productAttribute->getName()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulDeletion()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(this product attribute) should no longer exist in the registry$/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use Sylius\Behat\Page\Admin\Crud\IndexPageInterface;
|
|||
use Sylius\Behat\Page\Admin\ProductOption\CreatePageInterface;
|
||||
use Sylius\Behat\Page\Admin\ProductOption\UpdatePageInterface;
|
||||
use Sylius\Behat\Service\CurrentPageResolverInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\Product\Model\OptionInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -25,8 +24,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingProductOptionsContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'product_option';
|
||||
|
||||
/**
|
||||
* @var IndexPageInterface
|
||||
*/
|
||||
|
|
@ -47,30 +44,22 @@ final class ManagingProductOptionsContext implements Context
|
|||
*/
|
||||
private $currentPageResolver;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param IndexPageInterface $indexPage
|
||||
* @param CreatePageInterface $createPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param CurrentPageResolverInterface $currentPageResolver
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
IndexPageInterface $indexPage,
|
||||
CreatePageInterface $createPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
CurrentPageResolverInterface $currentPageResolver
|
||||
) {
|
||||
$this->indexPage = $indexPage;
|
||||
$this->createPage = $createPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->currentPageResolver = $currentPageResolver;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -159,22 +148,6 @@ final class ManagingProductOptionsContext implements Context
|
|||
$currentPage->addOptionValue($code, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfullyCreated()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the product option :productOptionName should appear in the registry
|
||||
* @Then the product option :productOptionName should be in the registry
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingPromotionsContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'promotion';
|
||||
|
||||
/**
|
||||
* @var SharedStorageInterface
|
||||
*/
|
||||
|
|
@ -72,7 +70,7 @@ final class ManagingPromotionsContext implements Context
|
|||
IndexPageInterface $indexPage,
|
||||
CreatePageInterface $createPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
) {
|
||||
$this->sharedStorage = $sharedStorage;
|
||||
|
|
@ -177,14 +175,6 @@ final class ManagingPromotionsContext implements Context
|
|||
$this->createPage->fillActionOption('Amount', $amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that :element is required
|
||||
*/
|
||||
|
|
@ -341,14 +331,6 @@ final class ManagingPromotionsContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^I delete a ("([^"]+)" promotion)$/
|
||||
* @When /^I try to delete a ("([^"]+)" promotion)$/
|
||||
|
|
@ -361,14 +343,6 @@ final class ManagingPromotionsContext implements Context
|
|||
$this->indexPage->deleteResourceOnPage(['name' => $promotion->getName()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulDeletion()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(this promotion) should no longer exist in the promotion registry$/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingShippingMethodsContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'shipping_method';
|
||||
|
||||
/**
|
||||
* @var SharedStorageInterface
|
||||
*/
|
||||
|
|
@ -135,14 +133,6 @@ final class ManagingShippingMethodsContext implements Context
|
|||
$this->createPage->create();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfullyCreated()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When I choose :calculatorName calculator
|
||||
* @When I do not specify amount for :calculatorName calculator
|
||||
|
|
@ -246,14 +236,6 @@ final class ManagingShippingMethodsContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified about successful edition
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that :element is required
|
||||
*/
|
||||
|
|
@ -388,14 +370,6 @@ final class ManagingShippingMethodsContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulDeletion()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it is in use
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use Sylius\Behat\Page\Admin\Crud\IndexPageInterface;
|
|||
use Sylius\Behat\Page\Admin\TaxCategory\UpdatePageInterface;
|
||||
use Sylius\Behat\Page\Admin\TaxCategory\CreatePageInterface;
|
||||
use Sylius\Behat\Service\CurrentPageResolverInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\Taxation\Model\TaxCategoryInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -25,8 +24,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingTaxCategoriesContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'tax_category';
|
||||
|
||||
/**
|
||||
* @var IndexPageInterface
|
||||
*/
|
||||
|
|
@ -47,30 +44,22 @@ final class ManagingTaxCategoriesContext implements Context
|
|||
*/
|
||||
private $currentPageResolver;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param IndexPageInterface $indexPage
|
||||
* @param CreatePageInterface $createPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param CurrentPageResolverInterface $currentPageResolver
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
IndexPageInterface $indexPage,
|
||||
CreatePageInterface $createPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
CurrentPageResolverInterface $currentPageResolver
|
||||
) {
|
||||
$this->indexPage = $indexPage;
|
||||
$this->createPage = $createPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->currentPageResolver = $currentPageResolver;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -93,14 +82,6 @@ final class ManagingTaxCategoriesContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulDeletion()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given I want to create a new tax category
|
||||
*/
|
||||
|
|
@ -158,14 +139,6 @@ final class ManagingTaxCategoriesContext implements Context
|
|||
$this->createPage->describeItAs($description);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given I want to modify a tax category :taxCategory
|
||||
* @Given /^I want to modify (this tax category)$/
|
||||
|
|
@ -195,14 +168,6 @@ final class ManagingTaxCategoriesContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified about successful edition
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(this tax category) name should be "([^"]+)"$/
|
||||
* @Then /^(this tax category) should still be named "([^"]+)"$/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use Behat\Behat\Context\Context;
|
|||
use Sylius\Behat\Page\Admin\Crud\IndexPageInterface;
|
||||
use Sylius\Behat\Page\Admin\TaxRate\UpdatePageInterface;
|
||||
use Sylius\Behat\Service\CurrentPageResolverInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Behat\Page\Admin\TaxRate\CreatePageInterface;
|
||||
use Sylius\Component\Core\Model\TaxRateInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
|
@ -25,8 +24,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingTaxRateContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'tax_rate';
|
||||
|
||||
/**
|
||||
* @var IndexPageInterface
|
||||
*/
|
||||
|
|
@ -47,30 +44,22 @@ final class ManagingTaxRateContext implements Context
|
|||
*/
|
||||
private $currentPageResolver;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param IndexPageInterface $indexPage
|
||||
* @param CreatePageInterface $createPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param CurrentPageResolverInterface $currentPageResolver
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
IndexPageInterface $indexPage,
|
||||
CreatePageInterface $createPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
CurrentPageResolverInterface $currentPageResolver
|
||||
) {
|
||||
$this->indexPage = $indexPage;
|
||||
$this->createPage = $createPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->currentPageResolver = $currentPageResolver;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -160,14 +149,6 @@ final class ManagingTaxRateContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When I delete tax rate :taxRate
|
||||
*/
|
||||
|
|
@ -188,14 +169,6 @@ final class ManagingTaxRateContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulDeletion()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given I want to modify a tax rate :taxRate
|
||||
* @Given /^I want to modify (this tax rate)$/
|
||||
|
|
@ -225,14 +198,6 @@ final class ManagingTaxRateContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified about successful edition
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(this tax rate) name should be "([^"]+)"$/
|
||||
* @Then /^(this tax rate) should still be named "([^"]+)"$/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use Behat\Behat\Context\Context;
|
|||
use Sylius\Behat\Page\Admin\Taxon\CreatePageInterface;
|
||||
use Sylius\Behat\Page\Admin\Taxon\UpdatePageInterface;
|
||||
use Sylius\Behat\Service\CurrentPageResolverInterface;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
use Sylius\Component\Core\Model\TaxonInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -24,8 +23,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingTaxonsContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'taxon';
|
||||
|
||||
/**
|
||||
* @var CreatePageInterface
|
||||
*/
|
||||
|
|
@ -41,27 +38,19 @@ final class ManagingTaxonsContext implements Context
|
|||
*/
|
||||
private $currentPageResolver;
|
||||
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param CreatePageInterface $createPage
|
||||
* @param UpdatePageInterface $updatePage
|
||||
* @param CurrentPageResolverInterface $currentPageResolver
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(
|
||||
CreatePageInterface $createPage,
|
||||
UpdatePageInterface $updatePage,
|
||||
CurrentPageResolverInterface $currentPageResolver,
|
||||
NotificationCheckerInterface $notificationChecker
|
||||
CurrentPageResolverInterface $currentPageResolver
|
||||
) {
|
||||
$this->createPage = $createPage;
|
||||
$this->updatePage = $updatePage;
|
||||
$this->currentPageResolver = $currentPageResolver;
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -196,30 +185,6 @@ final class ManagingTaxonsContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfullyCreated()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^the ("[^"]+" taxon) should appear in the registry$/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
final class ManagingZonesContext implements Context
|
||||
{
|
||||
const RESOURCE_NAME = 'zone';
|
||||
|
||||
/**
|
||||
* @var CreatePageInterface
|
||||
*/
|
||||
|
|
@ -190,30 +188,6 @@ final class ManagingZonesContext implements Context
|
|||
$this->updatePage->saveChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulCreation()
|
||||
{
|
||||
$this->notificationChecker->checkCreationNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedAboutSuccessfulEdition()
|
||||
{
|
||||
$this->notificationChecker->checkEditionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted()
|
||||
{
|
||||
$this->notificationChecker->checkDeletionNotification(self::RESOURCE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^the (zone named "[^"]+") with (the "[^"]+" (?:country|province|zone) member) should appear in the registry$/
|
||||
*/
|
||||
|
|
|
|||
59
src/Sylius/Behat/Context/Ui/Admin/NotificationContext.php
Normal file
59
src/Sylius/Behat/Context/Ui/Admin/NotificationContext.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Sylius package.
|
||||
*
|
||||
* (c) Paweł Jędrzejewski
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Sylius\Behat\Context\Ui\Admin;
|
||||
|
||||
use Behat\Behat\Context\Context;
|
||||
use Sylius\Behat\NotificationType;
|
||||
use Sylius\Behat\Service\NotificationCheckerInterface;
|
||||
|
||||
/**
|
||||
* @author Arkadiusz Krakowiak <arkadiusz.krakowiak@lakion.com>
|
||||
*/
|
||||
final class NotificationContext implements Context
|
||||
{
|
||||
/**
|
||||
* @var NotificationCheckerInterface
|
||||
*/
|
||||
private $notificationChecker;
|
||||
|
||||
/**
|
||||
* @param NotificationCheckerInterface $notificationChecker
|
||||
*/
|
||||
public function __construct(NotificationCheckerInterface $notificationChecker)
|
||||
{
|
||||
$this->notificationChecker = $notificationChecker;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully created
|
||||
*/
|
||||
public function iShouldBeNotifiedItHasBeenSuccessfullyCreated()
|
||||
{
|
||||
$this->notificationChecker->checkNotification('has been successfully created.', NotificationType::success());
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully edited
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyEdited()
|
||||
{
|
||||
$this->notificationChecker->checkNotification('has been successfully updated.', NotificationType::success());
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified that it has been successfully deleted
|
||||
*/
|
||||
public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted()
|
||||
{
|
||||
$this->notificationChecker->checkNotification('has been successfully deleted.', NotificationType::success());
|
||||
}
|
||||
}
|
||||
|
|
@ -34,42 +34,6 @@ final class NotificationChecker implements NotificationCheckerInterface
|
|||
$this->notificationAccessor = $notificationAccessor;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws NotificationExpectationMismatchException
|
||||
*/
|
||||
public function checkCreationNotification($resource)
|
||||
{
|
||||
$message = sprintf('%s has been successfully created.', $this->humanizeResourceName($resource));
|
||||
|
||||
$this->checkNotification($message, NotificationType::success());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws NotificationExpectationMismatchException
|
||||
*/
|
||||
public function checkDeletionNotification($resource)
|
||||
{
|
||||
$message = sprintf('%s has been successfully deleted.', $this->humanizeResourceName($resource));
|
||||
|
||||
$this->checkNotification($message, NotificationType::success());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws NotificationExpectationMismatchException
|
||||
*/
|
||||
public function checkEditionNotification($resource)
|
||||
{
|
||||
$message = sprintf('%s has been successfully updated.', $this->humanizeResourceName($resource));
|
||||
|
||||
$this->checkNotification($message, NotificationType::success());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
@ -106,14 +70,4 @@ final class NotificationChecker implements NotificationCheckerInterface
|
|||
{
|
||||
return false !== strpos($this->notificationAccessor->getMessage(), $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $resourceName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function humanizeResourceName($resourceName)
|
||||
{
|
||||
return ucfirst(str_replace('_', ' ', $resourceName));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,21 +19,6 @@ use Sylius\Behat\NotificationType;
|
|||
*/
|
||||
interface NotificationCheckerInterface
|
||||
{
|
||||
/**
|
||||
* @param string $resource
|
||||
*/
|
||||
public function checkDeletionNotification($resource);
|
||||
|
||||
/**
|
||||
* @param string $resource
|
||||
*/
|
||||
public function checkCreationNotification($resource);
|
||||
|
||||
/**
|
||||
* @param string $resource
|
||||
*/
|
||||
public function checkEditionNotification($resource);
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param NotificationType $type
|
||||
|
|
|
|||
|
|
@ -41,30 +41,6 @@ class NotificationCheckerSpec extends ObjectBehavior
|
|||
$this->shouldImplement(NotificationCheckerInterface::class);
|
||||
}
|
||||
|
||||
function it_checks_if_successful_creation_notification_has_appeared(NotificationAccessorInterface $notificationAccessor)
|
||||
{
|
||||
$notificationAccessor->getType()->willReturn(NotificationType::success());
|
||||
$notificationAccessor->getMessage()->willReturn('Some resource has been successfully created.');
|
||||
|
||||
$this->checkCreationNotification('some_resource');
|
||||
}
|
||||
|
||||
function it_checks_if_successful_edition_notification_has_appeared(NotificationAccessorInterface $notificationAccessor)
|
||||
{
|
||||
$notificationAccessor->getType()->willReturn(NotificationType::success());
|
||||
$notificationAccessor->getMessage()->willReturn('Some resource has been successfully updated.');
|
||||
|
||||
$this->checkEditionNotification('some_resource');
|
||||
}
|
||||
|
||||
function it_checks_if_successful_deletion_notification_has_appeared(NotificationAccessorInterface $notificationAccessor)
|
||||
{
|
||||
$notificationAccessor->getType()->willReturn(NotificationType::success());
|
||||
$notificationAccessor->getMessage()->willReturn('Some resource has been successfully deleted.');
|
||||
|
||||
$this->checkDeletionNotification('some_resource');
|
||||
}
|
||||
|
||||
function it_checks_if_successful_notification_has_appeared(NotificationAccessorInterface $notificationAccessor)
|
||||
{
|
||||
$notificationAccessor->getType()->willReturn(NotificationType::success());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue