From 28e39e27f7f01926ea303d8d225fae99bf5f9c2e Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Thu, 24 Feb 2022 14:58:35 +0100 Subject: [PATCH 1/6] [Channel] Do not consider disabled channel on hostname based request resolver --- UPGRADE-1.10.md | 4 ++++ .../browsing_shop_on_right_channel.feature | 15 +++++++++++++++ src/Sylius/Behat/Context/Ui/ChannelContext.php | 16 ++++++++++++++++ src/Sylius/Behat/Page/Shop/HomePage.php | 6 ++++++ src/Sylius/Behat/Page/Shop/HomePageInterface.php | 2 ++ src/Sylius/Behat/Resources/config/suites.yml | 1 + .../config/suites/ui/channel/channels.yml | 16 ++++++++++++++++ .../Doctrine/ORM/ChannelRepository.php | 5 +++++ .../HostnameBasedRequestResolver.php | 2 +- .../Repository/ChannelRepositoryInterface.php | 3 +++ .../HostnameBasedRequestResolverSpec.php | 4 ++-- 11 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 features/channel/browsing_shop_on_right_channel.feature create mode 100644 src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml diff --git a/UPGRADE-1.10.md b/UPGRADE-1.10.md index 15f0c982419..8fa164ad822 100644 --- a/UPGRADE-1.10.md +++ b/UPGRADE-1.10.md @@ -40,6 +40,10 @@ between guests and logged in customers. 2. Not passing `createdByGuestFlagResolver` through constructor in `Sylius\Component\Core\Cart\Context\ShopBasedCartContext` is deprecated in Sylius 1.10.9 and it will be prohibited in Sylius 2.0. +# UPGRADE FROM `v1.10.9` TO `v1.10.10` + +1. The ChannelRepository findOneByHostname has been deprecated, consider replace it with the new findOneEnabledByHostname method. + # UPGRADE FROM `v1.10.x` TO `v1.10.8` 1. Update `payum/payum` to `^1.7` and execute Doctrine Migrations diff --git a/features/channel/browsing_shop_on_right_channel.feature b/features/channel/browsing_shop_on_right_channel.feature new file mode 100644 index 00000000000..4edb207b8d9 --- /dev/null +++ b/features/channel/browsing_shop_on_right_channel.feature @@ -0,0 +1,15 @@ +@channels +Feature: Browsing shop on right channel + In order to shop + As a Customer + I want to be redirected to the right channel + + Background: + Given the store operates on a channel named "Default" in "USD" currency and with hostname "127.0.0.1" + And the store also operates on a channel named "Alternative" in "USD" currency and with hostname "127.0.0.1" + And the channel "Default" is disabled + + @ui + Scenario: Browsing shop in active channel + When I visit the homepage + Then I should be on channel "Alternative" diff --git a/src/Sylius/Behat/Context/Ui/ChannelContext.php b/src/Sylius/Behat/Context/Ui/ChannelContext.php index 4b96dc88d85..e648b48532c 100644 --- a/src/Sylius/Behat/Context/Ui/ChannelContext.php +++ b/src/Sylius/Behat/Context/Ui/ChannelContext.php @@ -78,4 +78,20 @@ public function shouldSeePluginMainPageWithContent(string $content): void { Assert::same($this->pluginMainPage->getContent(), $content); } + + /** + * @When I visit the homepage + */ + public function iVisitTheHomepage(): void + { + $this->homePage->open(); + } + + /** + * @Then I should be on channel :channel + */ + public function iShouldBeOnChannel(ChannelInterface $channel): void + { + Assert::eq($this->homePage->getMetaTitle(), $channel->getName()); + } } diff --git a/src/Sylius/Behat/Page/Shop/HomePage.php b/src/Sylius/Behat/Page/Shop/HomePage.php index 317695f2852..44470c924b1 100644 --- a/src/Sylius/Behat/Page/Shop/HomePage.php +++ b/src/Sylius/Behat/Page/Shop/HomePage.php @@ -97,6 +97,11 @@ public function getLatestProductsNames(): array ); } + public function getMetaTitle(): string + { + return $this->getElement('meta_title')->getText(); + } + protected function getDefinedElements(): array { return array_merge(parent::getDefinedElements(), [ @@ -105,6 +110,7 @@ protected function getDefinedElements(): array 'latest_products' => '[data-test-latest-products]', 'locale_selector' => '[data-test-locale-selector]', 'logout_button' => '[data-test-logout-button]', + 'meta_title' => 'title', ]); } } diff --git a/src/Sylius/Behat/Page/Shop/HomePageInterface.php b/src/Sylius/Behat/Page/Shop/HomePageInterface.php index 948865257b0..22d90c97cb8 100644 --- a/src/Sylius/Behat/Page/Shop/HomePageInterface.php +++ b/src/Sylius/Behat/Page/Shop/HomePageInterface.php @@ -38,4 +38,6 @@ public function getAvailableLocales(): array; public function switchLocale(string $localeCode): void; public function getLatestProductsNames(): array; + + public function getMetaTitle(): string; } diff --git a/src/Sylius/Behat/Resources/config/suites.yml b/src/Sylius/Behat/Resources/config/suites.yml index c4ba1b0fd87..561eb4cbcc1 100644 --- a/src/Sylius/Behat/Resources/config/suites.yml +++ b/src/Sylius/Behat/Resources/config/suites.yml @@ -74,6 +74,7 @@ imports: - suites/ui/admin/locale.yml - suites/ui/admin/login.yml - suites/ui/cart/shopping_cart.yml + - suites/ui/channel/channels.yml - suites/ui/channel/managing_channels.yml - suites/ui/channel/products_accessibility_in_multiple_channels.yml - suites/ui/channel/theming.yml diff --git a/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml b/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml new file mode 100644 index 00000000000..8c6d2ef5f59 --- /dev/null +++ b/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml @@ -0,0 +1,16 @@ +# This file is part of the Sylius package. +# (c) Paweł Jędrzejewski + +default: + suites: + ui_channels: + contexts: + - sylius.behat.context.hook.doctrine_orm + + - sylius.behat.context.transform.channel + + - sylius.behat.context.setup.channel + + - sylius.behat.context.ui.channel + filters: + tags: "@channels&&@ui" diff --git a/src/Sylius/Bundle/ChannelBundle/Doctrine/ORM/ChannelRepository.php b/src/Sylius/Bundle/ChannelBundle/Doctrine/ORM/ChannelRepository.php index 38811b0bc6e..bf0155b7497 100644 --- a/src/Sylius/Bundle/ChannelBundle/Doctrine/ORM/ChannelRepository.php +++ b/src/Sylius/Bundle/ChannelBundle/Doctrine/ORM/ChannelRepository.php @@ -24,6 +24,11 @@ public function findOneByHostname(string $hostname): ?ChannelInterface return $this->findOneBy(['hostname' => $hostname]); } + public function findOneEnabledByHostname(string $hostname): ?ChannelInterface + { + return $this->findOneBy(['hostname' => $hostname, 'enabled' => true]); + } + public function findOneByCode(string $code): ?ChannelInterface { return $this->findOneBy(['code' => $code]); diff --git a/src/Sylius/Component/Channel/Context/RequestBased/HostnameBasedRequestResolver.php b/src/Sylius/Component/Channel/Context/RequestBased/HostnameBasedRequestResolver.php index b155206fa3c..5d498054bbd 100644 --- a/src/Sylius/Component/Channel/Context/RequestBased/HostnameBasedRequestResolver.php +++ b/src/Sylius/Component/Channel/Context/RequestBased/HostnameBasedRequestResolver.php @@ -25,6 +25,6 @@ public function __construct(private ChannelRepositoryInterface $channelRepositor public function findChannel(Request $request): ?ChannelInterface { - return $this->channelRepository->findOneByHostname($request->getHost()); + return $this->channelRepository->findOneEnabledByHostname($request->getHost()); } } diff --git a/src/Sylius/Component/Channel/Repository/ChannelRepositoryInterface.php b/src/Sylius/Component/Channel/Repository/ChannelRepositoryInterface.php index 076d943b22d..08362b00404 100644 --- a/src/Sylius/Component/Channel/Repository/ChannelRepositoryInterface.php +++ b/src/Sylius/Component/Channel/Repository/ChannelRepositoryInterface.php @@ -18,8 +18,11 @@ interface ChannelRepositoryInterface extends RepositoryInterface { + /** @deprecated No longer used by internal code and not recommended. */ public function findOneByHostname(string $hostname): ?ChannelInterface; + public function findOneEnabledByHostname(string $hostname): ?ChannelInterface; + public function findOneByCode(string $code): ?ChannelInterface; /** diff --git a/src/Sylius/Component/Channel/spec/Context/RequestBased/HostnameBasedRequestResolverSpec.php b/src/Sylius/Component/Channel/spec/Context/RequestBased/HostnameBasedRequestResolverSpec.php index 26e1528ba31..4924827aa38 100644 --- a/src/Sylius/Component/Channel/spec/Context/RequestBased/HostnameBasedRequestResolverSpec.php +++ b/src/Sylius/Component/Channel/spec/Context/RequestBased/HostnameBasedRequestResolverSpec.php @@ -38,7 +38,7 @@ function it_finds_the_channel_by_request_hostname( ): void { $request->getHost()->willReturn('example.org'); - $channelRepository->findOneByHostname('example.org')->willReturn($channel); + $channelRepository->findOneEnabledByHostname('example.org')->willReturn($channel); $this->findChannel($request)->shouldReturn($channel); } @@ -49,7 +49,7 @@ function it_returns_null_if_channel_was_not_found( ): void { $request->getHost()->willReturn('example.org'); - $channelRepository->findOneByHostname('example.org')->willReturn(null); + $channelRepository->findOneEnabledByHostname('example.org')->willReturn(null); $this->findChannel($request)->shouldReturn(null); } From 27406cdab9afd222ca7c53456ecdfb806485f3cb Mon Sep 17 00:00:00 2001 From: Jakub Tobiasz Date: Thu, 14 Jul 2022 14:07:58 +0200 Subject: [PATCH 2/6] Adjust behat scenarios --- .../browsing_shop_on_right_channel.feature | 15 --------------- .../filtering_out_disabled_channels.feature | 15 +++++++++++++++ src/Sylius/Behat/Context/Setup/ChannelContext.php | 7 +++++++ src/Sylius/Behat/Context/Ui/ChannelContext.php | 12 ++---------- .../Behat/Context/Ui/Shop/HomepageContext.php | 1 + .../config/suites/ui/channel/channels.yml | 2 ++ 6 files changed, 27 insertions(+), 25 deletions(-) delete mode 100644 features/channel/browsing_shop_on_right_channel.feature create mode 100644 features/channel/filtering_out_disabled_channels.feature diff --git a/features/channel/browsing_shop_on_right_channel.feature b/features/channel/browsing_shop_on_right_channel.feature deleted file mode 100644 index 4edb207b8d9..00000000000 --- a/features/channel/browsing_shop_on_right_channel.feature +++ /dev/null @@ -1,15 +0,0 @@ -@channels -Feature: Browsing shop on right channel - In order to shop - As a Customer - I want to be redirected to the right channel - - Background: - Given the store operates on a channel named "Default" in "USD" currency and with hostname "127.0.0.1" - And the store also operates on a channel named "Alternative" in "USD" currency and with hostname "127.0.0.1" - And the channel "Default" is disabled - - @ui - Scenario: Browsing shop in active channel - When I visit the homepage - Then I should be on channel "Alternative" diff --git a/features/channel/filtering_out_disabled_channels.feature b/features/channel/filtering_out_disabled_channels.feature new file mode 100644 index 00000000000..f1de252e813 --- /dev/null +++ b/features/channel/filtering_out_disabled_channels.feature @@ -0,0 +1,15 @@ +@channels +Feature: Filtering out disabled channels + In order to avoid mistakes + As a Customer + I want to be able to browse only available shops + + Background: + Given the store operates on a channel named "Fashion" in "USD" currency and with hostname "127.0.0.1" + And the store operates on a channel named "Furniture" in "EUR" currency and with hostname "127.0.0.1" + And the channel "Fashion" is disabled + + @ui + Scenario: Seeing Furniture shop homepage + When I visit the homepage + Then I should see "Furniture" shop diff --git a/src/Sylius/Behat/Context/Setup/ChannelContext.php b/src/Sylius/Behat/Context/Setup/ChannelContext.php index 2c396bd29c6..56d17a608ef 100644 --- a/src/Sylius/Behat/Context/Setup/ChannelContext.php +++ b/src/Sylius/Behat/Context/Setup/ChannelContext.php @@ -256,4 +256,11 @@ private function changeChannelState(ChannelInterface $channel, $state) $this->channelManager->flush(); $this->sharedStorage->set('channel', $channel); } + + private function getHostnameFromUrl(string $url): ?string + { + $parsedUrl = parse_url($url); + + return $parsedUrl['host'] ?? null; + } } diff --git a/src/Sylius/Behat/Context/Ui/ChannelContext.php b/src/Sylius/Behat/Context/Ui/ChannelContext.php index e648b48532c..c8ad41c5de2 100644 --- a/src/Sylius/Behat/Context/Ui/ChannelContext.php +++ b/src/Sylius/Behat/Context/Ui/ChannelContext.php @@ -80,17 +80,9 @@ public function shouldSeePluginMainPageWithContent(string $content): void } /** - * @When I visit the homepage + * @Then I should see :channel shop */ - public function iVisitTheHomepage(): void - { - $this->homePage->open(); - } - - /** - * @Then I should be on channel :channel - */ - public function iShouldBeOnChannel(ChannelInterface $channel): void + public function iShouldSeeShop(ChannelInterface $channel): void { Assert::eq($this->homePage->getMetaTitle(), $channel->getName()); } diff --git a/src/Sylius/Behat/Context/Ui/Shop/HomepageContext.php b/src/Sylius/Behat/Context/Ui/Shop/HomepageContext.php index a06a6e34464..45f7f06a19e 100644 --- a/src/Sylius/Behat/Context/Ui/Shop/HomepageContext.php +++ b/src/Sylius/Behat/Context/Ui/Shop/HomepageContext.php @@ -29,6 +29,7 @@ public function __construct( /** * @When I check latest products * @When I check available taxons + * @When I visit the homepage */ public function iCheckLatestProducts(): void { diff --git a/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml b/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml index 8c6d2ef5f59..b13ca193652 100644 --- a/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml +++ b/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml @@ -12,5 +12,7 @@ default: - sylius.behat.context.setup.channel - sylius.behat.context.ui.channel + + - sylius.behat.context.ui.shop.homepage filters: tags: "@channels&&@ui" From 066cf33f4eaed3a63a8db52beebbffb9746e0a87 Mon Sep 17 00:00:00 2001 From: Jakub Tobiasz Date: Fri, 15 Jul 2022 12:46:10 +0200 Subject: [PATCH 3/6] Update UPGRADE files --- UPGRADE-1.10.md | 4 ---- UPGRADE-1.11.md | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/UPGRADE-1.10.md b/UPGRADE-1.10.md index 8fa164ad822..15f0c982419 100644 --- a/UPGRADE-1.10.md +++ b/UPGRADE-1.10.md @@ -40,10 +40,6 @@ between guests and logged in customers. 2. Not passing `createdByGuestFlagResolver` through constructor in `Sylius\Component\Core\Cart\Context\ShopBasedCartContext` is deprecated in Sylius 1.10.9 and it will be prohibited in Sylius 2.0. -# UPGRADE FROM `v1.10.9` TO `v1.10.10` - -1. The ChannelRepository findOneByHostname has been deprecated, consider replace it with the new findOneEnabledByHostname method. - # UPGRADE FROM `v1.10.x` TO `v1.10.8` 1. Update `payum/payum` to `^1.7` and execute Doctrine Migrations diff --git a/UPGRADE-1.11.md b/UPGRADE-1.11.md index 8c544ff61b2..ac1f674e0ee 100644 --- a/UPGRADE-1.11.md +++ b/UPGRADE-1.11.md @@ -1,3 +1,10 @@ +# UPGRADE FROM `v1.11.6` TO `v1.11.7` + +1. Method `Sylius\Component\Channel\Repository\ChannelRepository::findOneByHostname` has become deprecated, use +`Sylius\Component\Channel\Repository\ChannelRepository::findOneEnabledByHostname` instead. Simultaneously with this change +`Sylius\Component\Channel\Context\RequestBased\HostnameBasedRequestResolver::findChannel` will start selecting only a channel from a range +of enabled channels. + # UPGRADE FROM `v1.11.2` TO `v1.11.3` 1. Order Processors' priorities have changed and `sylius.order_processing.order_prices_recalculator` has now a higher priority than `sylius.order_processing.order_shipment_processor`. From 351425d9928aa430776361ea7d66e39aa087ddf0 Mon Sep 17 00:00:00 2001 From: Jakub Tobiasz Date: Fri, 15 Jul 2022 13:53:14 +0200 Subject: [PATCH 4/6] Update deprecation message --- .../Component/Channel/Repository/ChannelRepositoryInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sylius/Component/Channel/Repository/ChannelRepositoryInterface.php b/src/Sylius/Component/Channel/Repository/ChannelRepositoryInterface.php index 08362b00404..b7169ebbd4b 100644 --- a/src/Sylius/Component/Channel/Repository/ChannelRepositoryInterface.php +++ b/src/Sylius/Component/Channel/Repository/ChannelRepositoryInterface.php @@ -18,7 +18,7 @@ interface ChannelRepositoryInterface extends RepositoryInterface { - /** @deprecated No longer used by internal code and not recommended. */ + /** @deprecated since Sylius 1.11, use the `findOneEnabledByHostname` method instead */ public function findOneByHostname(string $hostname): ?ChannelInterface; public function findOneEnabledByHostname(string $hostname): ?ChannelInterface; From 55edb2d3cae6631c8696ef2b2cdd099466af6dc2 Mon Sep 17 00:00:00 2001 From: Jakub Tobiasz Date: Mon, 18 Jul 2022 10:49:05 +0200 Subject: [PATCH 5/6] Remove redundant method --- src/Sylius/Behat/Context/Setup/ChannelContext.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Sylius/Behat/Context/Setup/ChannelContext.php b/src/Sylius/Behat/Context/Setup/ChannelContext.php index 56d17a608ef..2c396bd29c6 100644 --- a/src/Sylius/Behat/Context/Setup/ChannelContext.php +++ b/src/Sylius/Behat/Context/Setup/ChannelContext.php @@ -256,11 +256,4 @@ private function changeChannelState(ChannelInterface $channel, $state) $this->channelManager->flush(); $this->sharedStorage->set('channel', $channel); } - - private function getHostnameFromUrl(string $url): ?string - { - $parsedUrl = parse_url($url); - - return $parsedUrl['host'] ?? null; - } } From 673eb912beca1cf222880be294eaceeed69b64cc Mon Sep 17 00:00:00 2001 From: Jakub Tobiasz Date: Mon, 18 Jul 2022 11:47:53 +0200 Subject: [PATCH 6/6] Make filtering out scenario available in both ui and api contexts --- .../filtering_out_disabled_channels.feature | 11 +++++--- .../Context/Api/Shop/HomepageContext.php | 28 +++++++++++++++++++ .../Behat/Context/Ui/ChannelContext.php | 8 ------ .../Behat/Context/Ui/Shop/HomepageContext.php | 17 ++++++++++- src/Sylius/Behat/Page/Shop/HomePage.php | 6 ---- .../Behat/Page/Shop/HomePageInterface.php | 2 -- .../config/suites/api/channel/channels.yml | 19 +++++++++++++ .../config/suites/ui/channel/channels.yml | 3 +- 8 files changed, 72 insertions(+), 22 deletions(-) create mode 100644 src/Sylius/Behat/Resources/config/suites/api/channel/channels.yml diff --git a/features/channel/filtering_out_disabled_channels.feature b/features/channel/filtering_out_disabled_channels.feature index f1de252e813..e46e261488c 100644 --- a/features/channel/filtering_out_disabled_channels.feature +++ b/features/channel/filtering_out_disabled_channels.feature @@ -7,9 +7,12 @@ Feature: Filtering out disabled channels Background: Given the store operates on a channel named "Fashion" in "USD" currency and with hostname "127.0.0.1" And the store operates on a channel named "Furniture" in "EUR" currency and with hostname "127.0.0.1" + And there is product "Black T-Shirt" available in "Fashion" channel + And there is product "Old Wardrobe" available in "Furniture" channel And the channel "Fashion" is disabled - @ui - Scenario: Seeing Furniture shop homepage - When I visit the homepage - Then I should see "Furniture" shop + @ui @api + Scenario: Seeing Furniture shop products + When I check latest products + Then I should see "Old Wardrobe" product + And I should not see "Black T-Shirt" product diff --git a/src/Sylius/Behat/Context/Api/Shop/HomepageContext.php b/src/Sylius/Behat/Context/Api/Shop/HomepageContext.php index 967f656916f..67b3b9b537a 100644 --- a/src/Sylius/Behat/Context/Api/Shop/HomepageContext.php +++ b/src/Sylius/Behat/Context/Api/Shop/HomepageContext.php @@ -39,6 +39,34 @@ public function iCheckLatestProducts(): void ); } + /** + * @Then I should see :productName product + */ + public function iShouldSeeProduct(string $productName): void + { + Assert::true( + $this->responseChecker->hasItemWithValue( + $this->productsClient->getLastResponse(), + 'name', + $productName + ) + ); + } + + /** + * @Then I should not see :productName product + */ + public function iShouldNotSeeProduct(string $productName): void + { + Assert::false( + $this->responseChecker->hasItemWithValue( + $this->productsClient->getLastResponse(), + 'name', + $productName + ) + ); + } + /** * @When I check available taxons */ diff --git a/src/Sylius/Behat/Context/Ui/ChannelContext.php b/src/Sylius/Behat/Context/Ui/ChannelContext.php index c8ad41c5de2..4b96dc88d85 100644 --- a/src/Sylius/Behat/Context/Ui/ChannelContext.php +++ b/src/Sylius/Behat/Context/Ui/ChannelContext.php @@ -78,12 +78,4 @@ public function shouldSeePluginMainPageWithContent(string $content): void { Assert::same($this->pluginMainPage->getContent(), $content); } - - /** - * @Then I should see :channel shop - */ - public function iShouldSeeShop(ChannelInterface $channel): void - { - Assert::eq($this->homePage->getMetaTitle(), $channel->getName()); - } } diff --git a/src/Sylius/Behat/Context/Ui/Shop/HomepageContext.php b/src/Sylius/Behat/Context/Ui/Shop/HomepageContext.php index 45f7f06a19e..6ee58ccbab1 100644 --- a/src/Sylius/Behat/Context/Ui/Shop/HomepageContext.php +++ b/src/Sylius/Behat/Context/Ui/Shop/HomepageContext.php @@ -29,7 +29,6 @@ public function __construct( /** * @When I check latest products * @When I check available taxons - * @When I visit the homepage */ public function iCheckLatestProducts(): void { @@ -52,6 +51,22 @@ public function iShouldSeeProductsInTheList(int $numberOfProducts): void Assert::same(count($this->homePage->getLatestProductsNames()), $numberOfProducts); } + /** + * @Then I should see :productName product + */ + public function iShouldSeeProduct(string $productName): void + { + Assert::inArray($productName, $this->homePage->getLatestProductsNames()); + } + + /** + * @Then I should not see :productName product + */ + public function iShouldNotSeeProduct(string $productName): void + { + Assert::true(!in_array($productName, $this->homePage->getLatestProductsNames())); + } + /** * @Then I should see :firstMenuItem in the menu * @Then I should see :firstMenuItem and :secondMenuItem in the menu diff --git a/src/Sylius/Behat/Page/Shop/HomePage.php b/src/Sylius/Behat/Page/Shop/HomePage.php index 44470c924b1..317695f2852 100644 --- a/src/Sylius/Behat/Page/Shop/HomePage.php +++ b/src/Sylius/Behat/Page/Shop/HomePage.php @@ -97,11 +97,6 @@ public function getLatestProductsNames(): array ); } - public function getMetaTitle(): string - { - return $this->getElement('meta_title')->getText(); - } - protected function getDefinedElements(): array { return array_merge(parent::getDefinedElements(), [ @@ -110,7 +105,6 @@ protected function getDefinedElements(): array 'latest_products' => '[data-test-latest-products]', 'locale_selector' => '[data-test-locale-selector]', 'logout_button' => '[data-test-logout-button]', - 'meta_title' => 'title', ]); } } diff --git a/src/Sylius/Behat/Page/Shop/HomePageInterface.php b/src/Sylius/Behat/Page/Shop/HomePageInterface.php index 22d90c97cb8..948865257b0 100644 --- a/src/Sylius/Behat/Page/Shop/HomePageInterface.php +++ b/src/Sylius/Behat/Page/Shop/HomePageInterface.php @@ -38,6 +38,4 @@ public function getAvailableLocales(): array; public function switchLocale(string $localeCode): void; public function getLatestProductsNames(): array; - - public function getMetaTitle(): string; } diff --git a/src/Sylius/Behat/Resources/config/suites/api/channel/channels.yml b/src/Sylius/Behat/Resources/config/suites/api/channel/channels.yml new file mode 100644 index 00000000000..4c398b93437 --- /dev/null +++ b/src/Sylius/Behat/Resources/config/suites/api/channel/channels.yml @@ -0,0 +1,19 @@ +# This file is part of the Sylius package. +# (c) Paweł Jędrzejewski + +default: + suites: + ui_channels: + contexts: + - sylius.behat.context.hook.doctrine_orm + + - sylius.behat.context.transform.channel + + - sylius.behat.context.setup.channel + - sylius.behat.context.setup.product + + - sylius.behat.context.api.channel + - sylius.behat.context.api.shop.homepage + + filters: + tags: "@channels&&@api" diff --git a/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml b/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml index b13ca193652..cec9bb22572 100644 --- a/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml +++ b/src/Sylius/Behat/Resources/config/suites/ui/channel/channels.yml @@ -10,9 +10,10 @@ default: - sylius.behat.context.transform.channel - sylius.behat.context.setup.channel + - sylius.behat.context.setup.product - sylius.behat.context.ui.channel - - sylius.behat.context.ui.shop.homepage + filters: tags: "@channels&&@ui"