From a12fc54a56512a8ec1dd6c2c3c07ad2af217eaac Mon Sep 17 00:00:00 2001 From: jkindly Date: Fri, 20 Sep 2024 14:24:20 +0200 Subject: [PATCH] OP-545: Behat --- features/admin/adding_block.feature | 6 +- ...eature => adding_content_template.feature} | 2 +- features/admin/adding_page.feature | 21 ++++- ...ure => managing_content_templates.feature} | 2 +- features/admin/managing_pages.feature | 2 +- .../Provider/ResourceTemplateProviderSpec.php | 52 +++++++++++ .../Context/Setup/ContentTemplateContext.php | 86 ++++++++++++++++++ tests/Behat/Context/Setup/TemplateContext.php | 91 ++++++++----------- tests/Behat/Context/Ui/Admin/BlockContext.php | 6 +- ...Context.php => ContentTemplateContext.php} | 2 +- tests/Behat/Context/Ui/Admin/PageContext.php | 24 ++++- tests/Behat/Context/Ui/Shop/PageContext.php | 8 ++ tests/Behat/Page/Admin/Block/CreatePage.php | 12 +-- .../Page/Admin/Block/CreatePageInterface.php | 2 +- tests/Behat/Page/Admin/Page/CreatePage.php | 22 +++-- .../Page/Admin/Page/CreatePageInterface.php | 6 +- tests/Behat/Page/Shop/Page/ShowPage.php | 6 ++ .../Page/Shop/Page/ShowPageInterface.php | 2 + .../Resources/services/contexts/setup.xml | 4 +- .../Behat/Resources/services/contexts/ui.xml | 2 +- tests/Behat/Resources/suites.yml | 2 +- .../Resources/suites/ui/managing_blocks.yml | 2 +- ...tes.yml => managing_content_templates.yml} | 8 +- .../Resources/suites/ui/managing_pages.yml | 2 + 24 files changed, 278 insertions(+), 94 deletions(-) rename features/admin/{adding_template.feature => adding_content_template.feature} (98%) rename features/admin/{managing_templates.feature => managing_content_templates.feature} (98%) create mode 100644 spec/Provider/ResourceTemplateProviderSpec.php create mode 100644 tests/Behat/Context/Setup/ContentTemplateContext.php rename tests/Behat/Context/Ui/Admin/{TemplateContext.php => ContentTemplateContext.php} (99%) rename tests/Behat/Resources/suites/ui/{managing_templates.yml => managing_content_templates.yml} (50%) diff --git a/features/admin/adding_block.feature b/features/admin/adding_block.feature index c721508e..b7c72bb3 100644 --- a/features/admin/adding_block.feature +++ b/features/admin/adding_block.feature @@ -181,12 +181,12 @@ Feature: Adding blocks Then I should be notified that "Code, Name" fields are too long @ui @javascript - Scenario: Adding block with template - Given there is an existing template named "Homepage" with "Block" type that contains "Textarea, Single media" content elements + Scenario: Adding block with content template + Given there is an existing content template named "Homepage" with "Block" type that contains "Textarea, Single media" content elements When I go to the create block page And I fill the code with "intro" And I fill the name with "Intro" - And I select "Homepage" template + And I select "Homepage" content template And I confirm that I want to use this template And I add it Then I should be notified that the block has been created diff --git a/features/admin/adding_template.feature b/features/admin/adding_content_template.feature similarity index 98% rename from features/admin/adding_template.feature rename to features/admin/adding_content_template.feature index 3197fb24..b6fdb411 100644 --- a/features/admin/adding_template.feature +++ b/features/admin/adding_content_template.feature @@ -1,4 +1,4 @@ -@managing_templates +@managing_content_templates Feature: Adding cms templates In order to create templates As an Administrator diff --git a/features/admin/adding_page.feature b/features/admin/adding_page.feature index 9f2881eb..552fe207 100644 --- a/features/admin/adding_page.feature +++ b/features/admin/adding_page.feature @@ -210,15 +210,30 @@ Feature: Adding new page And I should see newly created "Multiple media" content element in Content elements section @ui @javascript - Scenario: Adding page with template - Given there is an existing template named "Homepage" with "Page" type that contains "Textarea, Single media" content elements + Scenario: Adding page with content template + Given there is an existing content template named "Homepage" with "Page" type that contains "Textarea, Single media" content elements When I go to the create page page And I fill the code with "my_page" And I fill the slug with "my_page" And I fill the name with "My page" - And I select "Homepage" template + And I select "Homepage" content template And I confirm that I want to use this template And I add it Then I should be notified that the page has been created And I should see newly created "Textarea" content element in Content elements section And I should see newly created "Single media" content element in Content elements section + + @ui @javascript + Scenario: Adding page with with a custom template + Given there is an existing template with "@SyliusCmsPlugin/Shop/Page/custom.html.twig" value + When I go to the create page page + And I fill the code with "my_page" + And I fill the slug with "my-page" + And I fill the name with "My page" + And I select "United States" channel + And I select "@SyliusCmsPlugin/Shop/Page/custom.html.twig" template + And I add it + Then I should be notified that the page has been created + And I go to the "my-page" page + And The rendered page should contain custom layout code + diff --git a/features/admin/managing_templates.feature b/features/admin/managing_content_templates.feature similarity index 98% rename from features/admin/managing_templates.feature rename to features/admin/managing_content_templates.feature index 0dd95fd9..7da7d5ae 100644 --- a/features/admin/managing_templates.feature +++ b/features/admin/managing_content_templates.feature @@ -1,4 +1,4 @@ -@managing_templates +@managing_content_templates Feature: Managing cms templates In order to manage existing templates As an Administrator diff --git a/features/admin/managing_pages.feature b/features/admin/managing_pages.feature index 27c73d3d..6e02852b 100644 --- a/features/admin/managing_pages.feature +++ b/features/admin/managing_pages.feature @@ -11,7 +11,7 @@ Feature: Managing cms pages @ui Scenario: Deleting page Given there is a page in the store - When I go to the pages page + When I go to the cms pages page And I delete this page Then I should be notified that the page has been deleted And I should see empty list of pages diff --git a/spec/Provider/ResourceTemplateProviderSpec.php b/spec/Provider/ResourceTemplateProviderSpec.php new file mode 100644 index 00000000..42660386 --- /dev/null +++ b/spec/Provider/ResourceTemplateProviderSpec.php @@ -0,0 +1,52 @@ +get('sylius_cms.templates.pages')->willReturn([ + '@CustomTemplate/Page.html.twig' => '@CustomTemplate/Page.html.twig', + ]); + + $parameterBag->get('sylius_cms.templates.blocks')->willReturn([ + '@CustomTemplate/Block.html.twig' => '@CustomTemplate/Block.html.twig', + ]); + + $this->beConstructedWith($parameterBag); + } + + public function it_is_initializable(): void + { + $this->shouldHaveType(ResourceTemplateProvider::class); + } + + public function it_implements_resource_template_provider_interface(): void + { + $this->shouldImplement(ResourceTemplateProviderInterface::class); + } + + public function it_returns_default_and_custom_page_templates(): void + { + $this->getPageTemplates()->shouldReturn([ + 'sylius.ui.default' => '@SyliusCmsPlugin/Shop/Page/show.html.twig', + '@CustomTemplate/Page.html.twig' => '@CustomTemplate/Page.html.twig', + ]); + } + + public function it_returns_default_and_custom_block_templates(): void + { + $this->getBlockTemplates()->shouldReturn([ + 'sylius.ui.default' => '@SyliusCmsPlugin/Shop/Block/show.html.twig', + '@CustomTemplate/Block.html.twig' => '@CustomTemplate/Block.html.twig', + ]); + } +} diff --git a/tests/Behat/Context/Setup/ContentTemplateContext.php b/tests/Behat/Context/Setup/ContentTemplateContext.php new file mode 100644 index 00000000..a86f23df --- /dev/null +++ b/tests/Behat/Context/Setup/ContentTemplateContext.php @@ -0,0 +1,86 @@ +createTemplate($name, $type); + + $this->saveTemplate($template); + } + + /** + * @Given there are :firstContentElement and :secondContentElement content elements in this template + */ + public function thereAreContentElementsInThisTemplate(string $firstContentElement, string $secondContentElement): void + { + /** @var TemplateInterface $template */ + $template = $this->sharedStorage->get('template'); + $template->setContentElements([ + ['type' => ContentElementHelper::getContentElementValueByName($firstContentElement)], + ['type' => ContentElementHelper::getContentElementValueByName($secondContentElement)], + ]); + + $this->saveTemplate($template); + } + + /** + * @Given there is an existing content template named :templateName with :type type that contains :contentElements content elements + */ + public function thereIsAnExistingTemplateThatContainsContentElements(string $templateName, string $type, string $contentElements): void + { + $template = $this->createTemplate($templateName, $type); + + $contentElements = explode(', ', $contentElements); + + $contentElementsArray = []; + foreach ($contentElements as $contentElement) { + $contentElementsArray[] = ['type' => ContentElementHelper::getContentElementValueByName($contentElement)]; + } + + $template->setContentElements($contentElementsArray); + + $this->saveTemplate($template); + } + + private function createTemplate(string $name, ?string $type = null): TemplateInterface + { + /** @var TemplateInterface $template */ + $template = $this->templateFactory->createNew(); + $template->setName($name); + + if (null !== $type) { + $template->setType($type); + } + + return $template; + } + + private function saveTemplate(TemplateInterface $template): void + { + $this->templateRepository->add($template); + $this->sharedStorage->set('template', $template); + } +} diff --git a/tests/Behat/Context/Setup/TemplateContext.php b/tests/Behat/Context/Setup/TemplateContext.php index 7ed942df..6198794c 100644 --- a/tests/Behat/Context/Setup/TemplateContext.php +++ b/tests/Behat/Context/Setup/TemplateContext.php @@ -5,82 +5,63 @@ namespace Tests\Sylius\CmsPlugin\Behat\Context\Setup; use Behat\Behat\Context\Context; -use Sylius\Behat\Service\SharedStorageInterface; -use Sylius\CmsPlugin\Entity\TemplateInterface; -use Sylius\CmsPlugin\Repository\TemplateRepositoryInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Tests\Sylius\CmsPlugin\Behat\Helpers\ContentElementHelper; +use Behat\Behat\Tester\Exception\PendingException; +use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Yaml\Yaml; final class TemplateContext implements Context { - public function __construct( - private FactoryInterface $templateFactory, - private SharedStorageInterface $sharedStorage, - private TemplateRepositoryInterface $templateRepository, - ) { + private Filesystem $filesystem; + private $tempConfigFile; + private $tempTemplateFile; + + public function __construct() + { + $this->filesystem = new Filesystem(); } /** - * @Given there is a template in the store with :name name - * @Given there is a template in the store with :name name and :type type + * @Given there is an existing template with :template value */ - public function thereIsATemplate(string $name, ?string $type = null): void + public function thereIsAnExistingTemplateWithValue($template) { - $template = $this->createTemplate($name, $type); + $this->tempConfigFile = __DIR__ . '/../../../Application/config/packages/sylius_cms_test.yaml'; + $config = [ + 'sylius_cms' => [ + 'templates' => [ + 'pages' => [$template] + ], + ], + ]; + + $this->filesystem->dumpFile($this->tempConfigFile, Yaml::dump($config)); + + $this->tempTemplateFile = $this->getTemplateFilePath($template); + $dummyTemplateContent = "
This is a test template for: $template
"; - $this->saveTemplate($template); + $this->filesystem->dumpFile($this->tempTemplateFile, $dummyTemplateContent); } /** - * @Given there are :firstContentElement and :secondContentElement content elements in this template + * Get the real template file path from the given template name. */ - public function thereAreContentElementsInThisTemplate(string $firstContentElement, string $secondContentElement): void + private function getTemplateFilePath($template): string { - /** @var TemplateInterface $template */ - $template = $this->sharedStorage->get('template'); - $template->setContentElements([ - ['type' => ContentElementHelper::getContentElementValueByName($firstContentElement)], - ['type' => ContentElementHelper::getContentElementValueByName($secondContentElement)], - ]); - - $this->saveTemplate($template); + $templatePath = str_replace('@SyliusCmsPlugin', 'Application/templates/bundles/SyliusCmsPlugin', $template); + return __DIR__ . '/../../../' . $templatePath; } /** - * @Given there is an existing template named :templateName with :type type that contains :contentElements content elements + * @AfterScenario */ - public function thereIsAnExistingTemplateThatContainsContentElements(string $templateName, string $type, string $contentElements): void + public function cleanup(): void { - $template = $this->createTemplate($templateName, $type); - - $contentElements = explode(', ', $contentElements); - - $contentElementsArray = []; - foreach ($contentElements as $contentElement) { - $contentElementsArray[] = ['type' => ContentElementHelper::getContentElementValueByName($contentElement)]; + if ($this->tempConfigFile && file_exists($this->tempConfigFile)) { + $this->filesystem->remove($this->tempConfigFile); } - $template->setContentElements($contentElementsArray); - - $this->saveTemplate($template); - } - - private function createTemplate(string $name, ?string $type = null): TemplateInterface - { - /** @var TemplateInterface $template */ - $template = $this->templateFactory->createNew(); - $template->setName($name); - - if (null !== $type) { - $template->setType($type); + if ($this->tempTemplateFile && file_exists($this->tempTemplateFile)) { + $this->filesystem->remove($this->tempTemplateFile); } - - return $template; - } - - private function saveTemplate(TemplateInterface $template): void - { - $this->templateRepository->add($template); - $this->sharedStorage->set('template', $template); } } diff --git a/tests/Behat/Context/Ui/Admin/BlockContext.php b/tests/Behat/Context/Ui/Admin/BlockContext.php index 92224332..ddeebbcd 100755 --- a/tests/Behat/Context/Ui/Admin/BlockContext.php +++ b/tests/Behat/Context/Ui/Admin/BlockContext.php @@ -401,11 +401,11 @@ public function iShouldSeeEmptyListOfBlocks(): void } /** - * @Then I select :templateName template + * @Then I select :templateName content template */ - public function iSelectTemplate(string $templateName): void + public function iSelectContentTemplate(string $templateName): void { - $this->resolveCurrentPage()->selectTemplate($templateName); + $this->resolveCurrentPage()->selectContentTemplate($templateName); } /** diff --git a/tests/Behat/Context/Ui/Admin/TemplateContext.php b/tests/Behat/Context/Ui/Admin/ContentTemplateContext.php similarity index 99% rename from tests/Behat/Context/Ui/Admin/TemplateContext.php rename to tests/Behat/Context/Ui/Admin/ContentTemplateContext.php index 78939072..eb48faba 100644 --- a/tests/Behat/Context/Ui/Admin/TemplateContext.php +++ b/tests/Behat/Context/Ui/Admin/ContentTemplateContext.php @@ -17,7 +17,7 @@ use Tests\Sylius\CmsPlugin\Behat\Service\RandomStringGeneratorInterface; use Webmozart\Assert\Assert; -final class TemplateContext implements Context +final class ContentTemplateContext implements Context { public function __construct( private SharedStorageInterface $sharedStorage, diff --git a/tests/Behat/Context/Ui/Admin/PageContext.php b/tests/Behat/Context/Ui/Admin/PageContext.php index bf984a82..db966a1c 100755 --- a/tests/Behat/Context/Ui/Admin/PageContext.php +++ b/tests/Behat/Context/Ui/Admin/PageContext.php @@ -32,7 +32,7 @@ public function __construct( } /** - * @When I go to the pages page + * @When I go to the cms pages page */ public function iGoToTheCmsPagesPage(): void { @@ -99,6 +99,14 @@ public function iFillTheNameWith(string $name): void $this->resolveCurrentPage()->fillName($name); } + /** + * @When I select :code channel + */ + public function iSelectChannel(string $code): void + { + $this->resolveCurrentPage()->selectChannel($code); + } + /** * @When I fill the slug with :slug */ @@ -292,11 +300,11 @@ public function iShouldNotSeeContentElementInTheContentElementsSection(string $c } /** - * @Then I select :templateName template + * @Then I select :templateName content template */ - public function iSelectTemplate(string $templateName): void + public function iSelectContentTemplate(string $templateName): void { - $this->resolveCurrentPage()->selectTemplate($templateName); + $this->resolveCurrentPage()->selectContentTemplate($templateName); } /** @@ -307,6 +315,14 @@ public function iConfirmThatIWantToUseThisTemplate(): void $this->resolveCurrentPage()->confirmUseTemplate(); } + /** + * @Then I select :templateName template + */ + public function iSelectTemplate(string $templateName): void + { + $this->resolveCurrentPage()->selectTemplate($templateName); + } + /** * @When I add it * @When I try to add it diff --git a/tests/Behat/Context/Ui/Shop/PageContext.php b/tests/Behat/Context/Ui/Shop/PageContext.php index fa1898da..d8eabe35 100755 --- a/tests/Behat/Context/Ui/Shop/PageContext.php +++ b/tests/Behat/Context/Ui/Shop/PageContext.php @@ -108,4 +108,12 @@ public function iShouldSeePageTitle(string $title): void { Assert::true($this->showPage->hasTitle($title)); } + + /** + * @Then The rendered page should contain custom layout code + */ + public function theRenderedPageShouldContainCustomLayoutCode() + { + Assert::true($this->showPage->hasCustomLayoutCode()); + } } diff --git a/tests/Behat/Page/Admin/Block/CreatePage.php b/tests/Behat/Page/Admin/Block/CreatePage.php index 23a6528f..a3409322 100755 --- a/tests/Behat/Page/Admin/Block/CreatePage.php +++ b/tests/Behat/Page/Admin/Block/CreatePage.php @@ -265,18 +265,18 @@ public function addTaxonsListContentElementWithTaxons(array $taxons): void } } - public function selectTemplate(string $templateName): void + public function selectContentTemplate(string $templateName): void { - $dropdown = $this->getElement('template_select_dropdown'); + $dropdown = $this->getElement('content_template_select_dropdown'); $dropdown->click(); $dropdown->waitFor(5, function () use ($templateName): bool { - return $this->hasElement('template_select_dropdown_item', [ + return $this->hasElement('content_template_select_dropdown_item', [ '%item%' => $templateName, ]); }); - $item = $this->getElement('template_select_dropdown_item', [ + $item = $this->getElement('content_template_select_dropdown_item', [ '%item%' => $templateName, ]); @@ -300,8 +300,8 @@ protected function getDefinedElements(): array 'association_dropdown_collection' => '.field > label:contains("Collections") ~ .sylius-autocomplete', 'association_dropdown_collection_item' => '.field > label:contains("Collections") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")', 'content_elements_add_button' => '#sylius_cms_block_contentElements a[data-form-collection="add"]', - 'template_select_dropdown' => 'h5:contains("Content elements template") ~ .column .field > .sylius-autocomplete', - 'template_select_dropdown_item' => 'h5:contains("Content elements template") ~ .column .field > .sylius-autocomplete > div.menu > div.item:contains("%item%")', + 'content_template_select_dropdown' => 'h5:contains("Content elements template") ~ .column .field > .sylius-autocomplete', + 'content_template_select_dropdown_item' => 'h5:contains("Content elements template") ~ .column .field > .sylius-autocomplete > div.menu > div.item:contains("%item%")', ], ); } diff --git a/tests/Behat/Page/Admin/Block/CreatePageInterface.php b/tests/Behat/Page/Admin/Block/CreatePageInterface.php index 59644f53..ad5ed7db 100755 --- a/tests/Behat/Page/Admin/Block/CreatePageInterface.php +++ b/tests/Behat/Page/Admin/Block/CreatePageInterface.php @@ -47,7 +47,7 @@ public function addTaxonsListContentElementWithTaxons(array $taxons): void; public function disable(): void; - public function selectTemplate(string $templateName): void; + public function selectContentTemplate(string $templateName): void; public function confirmUseTemplate(): void; } diff --git a/tests/Behat/Page/Admin/Page/CreatePage.php b/tests/Behat/Page/Admin/Page/CreatePage.php index 22580b85..bf2ddaa6 100755 --- a/tests/Behat/Page/Admin/Page/CreatePage.php +++ b/tests/Behat/Page/Admin/Page/CreatePage.php @@ -274,18 +274,18 @@ public function addTaxonsListContentElementWithTaxons(array $taxons): void } } - public function selectTemplate(string $templateName): void + public function selectContentTemplate(string $templateName): void { - $dropdown = $this->getElement('template_select_dropdown'); + $dropdown = $this->getElement('content_template_select_dropdown'); $dropdown->click(); $dropdown->waitFor(5, function () use ($templateName): bool { - return $this->hasElement('template_select_dropdown_item', [ + return $this->hasElement('content_template_select_dropdown_item', [ '%item%' => $templateName, ]); }); - $item = $this->getElement('template_select_dropdown_item', [ + $item = $this->getElement('content_template_select_dropdown_item', [ '%item%' => $templateName, ]); @@ -300,6 +300,16 @@ public function confirmUseTemplate(): void }); } + public function selectTemplate(string $templateName): void + { + $this->getDocument()->selectFieldOption('Template', $templateName); + } + + public function selectChannel(string $code): void + { + $this->getDocument()->checkField($code); + } + protected function getDefinedElements(): array { return array_merge( @@ -310,8 +320,8 @@ protected function getDefinedElements(): array 'association_dropdown_collection' => '.field > label:contains("Collections") ~ .sylius-autocomplete', 'association_dropdown_collection_item' => '.field > label:contains("Collections") ~ .sylius-autocomplete > div.menu > div.item:contains("%item%")', 'content_elements_add_button' => '#sylius_cms_page_contentElements a[data-form-collection="add"]', - 'template_select_dropdown' => 'h5:contains("Content elements template") ~ .column .field > .sylius-autocomplete', - 'template_select_dropdown_item' => 'h5:contains("Content elements template") ~ .column .field > .sylius-autocomplete > div.menu > div.item:contains("%item%")', + 'content_template_select_dropdown' => 'h5:contains("Content elements template") ~ .column .field > .sylius-autocomplete', + 'content_template_select_dropdown_item' => 'h5:contains("Content elements template") ~ .column .field > .sylius-autocomplete > div.menu > div.item:contains("%item%")', ], ); } diff --git a/tests/Behat/Page/Admin/Page/CreatePageInterface.php b/tests/Behat/Page/Admin/Page/CreatePageInterface.php index 3b533859..912d14ca 100755 --- a/tests/Behat/Page/Admin/Page/CreatePageInterface.php +++ b/tests/Behat/Page/Admin/Page/CreatePageInterface.php @@ -51,7 +51,11 @@ public function addProductsGridByTaxonContentElementWithTaxon(string $taxon): vo public function addTaxonsListContentElementWithTaxons(array $taxons): void; - public function selectTemplate(string $templateName): void; + public function selectContentTemplate(string $templateName): void; public function confirmUseTemplate(): void; + + public function selectTemplate(string $templateName): void; + + public function selectChannel(string $code): void; } diff --git a/tests/Behat/Page/Shop/Page/ShowPage.php b/tests/Behat/Page/Shop/Page/ShowPage.php index d3a1ae9b..c3d44a3c 100755 --- a/tests/Behat/Page/Shop/Page/ShowPage.php +++ b/tests/Behat/Page/Shop/Page/ShowPage.php @@ -67,6 +67,11 @@ public function hasTitle(string $title): bool return $this->getSession()->evaluateScript('return document.title') === $title; } + public function hasCustomLayoutCode(): bool + { + return $this->hasElement('custom-layout'); + } + protected function getDefinedElements(): array { return array_merge(parent::getDefinedElements(), [ @@ -76,6 +81,7 @@ protected function getDefinedElements(): array 'collections' => '.cms-page-collections', 'link' => '.cms-page-link', 'page-image' => '.page-image', + 'custom-layout' => '.custom-layout', ]); } } diff --git a/tests/Behat/Page/Shop/Page/ShowPageInterface.php b/tests/Behat/Page/Shop/Page/ShowPageInterface.php index 8da55940..00f69870 100755 --- a/tests/Behat/Page/Shop/Page/ShowPageInterface.php +++ b/tests/Behat/Page/Shop/Page/ShowPageInterface.php @@ -21,4 +21,6 @@ public function hasPageLink(string $linkName): bool; public function hasPageImage(): bool; public function hasTitle(string $title): bool; + + public function hasCustomLayoutCode(): bool; } diff --git a/tests/Behat/Resources/services/contexts/setup.xml b/tests/Behat/Resources/services/contexts/setup.xml index 57ffbf82..fda5d43e 100644 --- a/tests/Behat/Resources/services/contexts/setup.xml +++ b/tests/Behat/Resources/services/contexts/setup.xml @@ -37,10 +37,12 @@ - + + + diff --git a/tests/Behat/Resources/services/contexts/ui.xml b/tests/Behat/Resources/services/contexts/ui.xml index bde9105c..c575c9fe 100644 --- a/tests/Behat/Resources/services/contexts/ui.xml +++ b/tests/Behat/Resources/services/contexts/ui.xml @@ -60,7 +60,7 @@ - + diff --git a/tests/Behat/Resources/suites.yml b/tests/Behat/Resources/suites.yml index 8acb5a3f..865ba783 100644 --- a/tests/Behat/Resources/suites.yml +++ b/tests/Behat/Resources/suites.yml @@ -3,7 +3,7 @@ imports: - suites/ui/managing_pages.yml - suites/ui/managing_collections.yml - suites/ui/managing_media.yml - - suites/ui/managing_templates.yml + - suites/ui/managing_content_templates.yml - suites/ui/shop_blocks.yml - suites/ui/shop_media.yml - suites/ui/shop_pages.yml diff --git a/tests/Behat/Resources/suites/ui/managing_blocks.yml b/tests/Behat/Resources/suites/ui/managing_blocks.yml index 2b8060ab..ad82c741 100755 --- a/tests/Behat/Resources/suites/ui/managing_blocks.yml +++ b/tests/Behat/Resources/suites/ui/managing_blocks.yml @@ -11,7 +11,7 @@ default: - sylius_cms.behat.context.setup.block - sylius_cms.behat.context.setup.collection - sylius_cms.behat.context.setup.media - - sylius_cms.behat.context.setup.template + - sylius_cms.behat.context.setup.content_template - sylius_cms.behat.context.ui.admin.block filters: diff --git a/tests/Behat/Resources/suites/ui/managing_templates.yml b/tests/Behat/Resources/suites/ui/managing_content_templates.yml similarity index 50% rename from tests/Behat/Resources/suites/ui/managing_templates.yml rename to tests/Behat/Resources/suites/ui/managing_content_templates.yml index 9072486e..5538d7b8 100755 --- a/tests/Behat/Resources/suites/ui/managing_templates.yml +++ b/tests/Behat/Resources/suites/ui/managing_content_templates.yml @@ -1,11 +1,11 @@ default: suites: - ui_managing_templates: + ui_managing_content_templates: contexts: - sylius.behat.context.hook.doctrine_orm - sylius.behat.context.setup.channel - sylius.behat.context.setup.admin_security - - sylius_cms.behat.context.setup.template - - sylius_cms.behat.context.ui.admin.template + - sylius_cms.behat.context.setup.content_template + - sylius_cms.behat.context.ui.admin.content_template filters: - tags: "@managing_templates&&@ui" + tags: "@managing_content_templates&&@ui" diff --git a/tests/Behat/Resources/suites/ui/managing_pages.yml b/tests/Behat/Resources/suites/ui/managing_pages.yml index 349071ad..2c4bd190 100755 --- a/tests/Behat/Resources/suites/ui/managing_pages.yml +++ b/tests/Behat/Resources/suites/ui/managing_pages.yml @@ -11,8 +11,10 @@ default: - sylius_cms.behat.context.setup.media - sylius_cms.behat.context.setup.page - sylius_cms.behat.context.setup.collection + - sylius_cms.behat.context.setup.content_template - sylius_cms.behat.context.setup.template - sylius_cms.behat.context.ui.admin.page + - sylius_cms.behat.context.ui.shop.page filters: tags: "@managing_pages&&@ui"