From 20060574ce6b7e94f9a39d1c343ad8944f305b55 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Mon, 23 Jun 2025 15:21:41 +0200 Subject: [PATCH 01/18] Added scenario for creating URL Alias --- features/standard/UrlAliases.feature | 15 ++++++ .../config/services/test/components.yaml | 3 ++ .../BrowserContext/ContentViewContext.php | 19 +++++++ .../Behat/Component/CreateUrlAliasForm.php | 49 +++++++++++++++++++ src/lib/Behat/Page/ContentViewPage.php | 27 +++++++++- 5 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 features/standard/UrlAliases.feature create mode 100644 src/lib/Behat/Component/CreateUrlAliasForm.php diff --git a/features/standard/UrlAliases.feature b/features/standard/UrlAliases.feature new file mode 100644 index 0000000000..0a811f187c --- /dev/null +++ b/features/standard/UrlAliases.feature @@ -0,0 +1,15 @@ +@IbexaOSS @IbexaHeadless @IbexaExperience @IbexaCommerce @javascript +Feature: UrlAliases + + Background: + Given I am logged as admin + + @test + Scenario: Create an Url Alias + Given a "folder" Content item named "UrlAliases" exists in root + | name | short_name | + | UrlAliases | UrlAliases | + Given I'm on Content view Page for "UrlAliases" + When I switch to "URL" tab in Content structure + And I create a new direct Url Alias called "TestUrlAlias" in "English (United Kingdom)" language + Then there should be a "/testurlalias" Url Alias on the list with "Direct" type \ No newline at end of file diff --git a/src/bundle/Resources/config/services/test/components.yaml b/src/bundle/Resources/config/services/test/components.yaml index 101c17fbdf..b1dafa1df0 100644 --- a/src/bundle/Resources/config/services/test/components.yaml +++ b/src/bundle/Resources/config/services/test/components.yaml @@ -59,3 +59,6 @@ services: Ibexa\AdminUi\Behat\Component\FullView: ~ Ibexa\AdminUi\Behat\Component\DeleteContentDialog: ~ + + Ibexa\AdminUi\Behat\Component\CreateUrlAliasForm: ~ + diff --git a/src/lib/Behat/BrowserContext/ContentViewContext.php b/src/lib/Behat/BrowserContext/ContentViewContext.php index 69b4303f38..42c4eb9214 100644 --- a/src/lib/Behat/BrowserContext/ContentViewContext.php +++ b/src/lib/Behat/BrowserContext/ContentViewContext.php @@ -168,4 +168,23 @@ public function iSendContentToTrash(): void { $this->contentViewPage->sendToTrash(); } + + /** + * @When I create a new direct Url Alias called :path in :languageName language + */ + public function iCreateNewUrlAlias(string $path, string $languageName): void + { + $this->contentViewPage->createNewDirectUrlAlias($path, $languageName, false); + } + + /** + * @Then there should be a :path Url Alias on the list with :type type + */ + public function verifyUrlAliasExists(string $path, string $type): void + { + Assert::assertTrue( + $this->contentViewPage->isUrlAliasOnTheList($path, $type), + sprintf('Url alias "%s" with type "%s" not found', $path, $type) + ); + } } diff --git a/src/lib/Behat/Component/CreateUrlAliasForm.php b/src/lib/Behat/Component/CreateUrlAliasForm.php new file mode 100644 index 0000000000..f217c844d0 --- /dev/null +++ b/src/lib/Behat/Component/CreateUrlAliasForm.php @@ -0,0 +1,49 @@ +ibexaDropdown = $ibexaDropdown; + } + + public function verifyIsLoaded(): void + { + $this->getHTMLPage()->find($this->getLocator('title'))->assert()->textEquals('Create a new URL alias'); + } + + public function createNewUrlAlias(string $path, string $languageName, bool $isRedirecting): void + { + $this->getHTMLPage()->find($this->getLocator('pathInput'))->setValue($path); + $this->getHTMLPage()->find($this->getLocator('languageDropdown'))->click(); + $this->ibexaDropdown->verifyIsLoaded(); + $this->ibexaDropdown->selectOption($languageName); + $this->getHTMLPage()->find($this->getLocator('createButton'))->click(); + } + + protected function specifyLocators(): array + { + return [ + new VisibleCSSLocator('title', '#ibexa-modal--custom-url-alias .modal-title'), + new VisibleCSSLocator('createButton', '#custom_url_add_add'), + new VisibleCSSLocator('pathInput', '#custom_url_add_path'), + new VisibleCSSLocator('languageDropdown', '.ibexa-custom-url-from__item .ibexa-dropdown__selection-info'), + ]; + } +} diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index 52fe1183e0..f7dd411e75 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -13,11 +13,13 @@ use Ibexa\AdminUi\Behat\Component\ContentActionsMenu; use Ibexa\AdminUi\Behat\Component\ContentItemAdminPreview; use Ibexa\AdminUi\Behat\Component\ContentTypePicker; +use Ibexa\AdminUi\Behat\Component\CreateUrlAliasForm; use Ibexa\AdminUi\Behat\Component\DeleteContentDialog; use Ibexa\AdminUi\Behat\Component\Dialog; use Ibexa\AdminUi\Behat\Component\IbexaDropdown; use Ibexa\AdminUi\Behat\Component\LanguagePicker; use Ibexa\AdminUi\Behat\Component\SubItemsList; +use Ibexa\AdminUi\Behat\Component\Table\TableBuilder; use Ibexa\AdminUi\Behat\Component\TranslationDialog; use Ibexa\AdminUi\Behat\Component\UniversalDiscoveryWidget; use Ibexa\AdminUi\Behat\Component\UpperMenu; @@ -85,6 +87,10 @@ class ContentViewPage extends Page private DeleteContentDialog $deleteContentDialog; + private CreateUrlAliasForm $createUrlAliasForm; + + private TableBuilder $tableBuilder; + public function __construct( Session $session, Router $router, @@ -101,7 +107,9 @@ public function __construct( UniversalDiscoveryWidget $universalDiscoveryWidget, IbexaDropdown $ibexaDropdown, UpperMenu $upperMenu, - DeleteContentDialog $deleteContentDialog + DeleteContentDialog $deleteContentDialog, + CreateUrlAliasForm $createUrlAliasForm, + TableBuilder $tableBuilder ) { parent::__construct($session, $router); $this->contentActionsMenu = $contentActionsMenu; @@ -118,6 +126,8 @@ public function __construct( $this->ibexaDropdown = $ibexaDropdown; $this->upperMenu = $upperMenu; $this->deleteContentDialog = $deleteContentDialog; + $this->createUrlAliasForm = $createUrlAliasForm; + $this->tableBuilder = $tableBuilder; } public function startCreatingContent(string $contentTypeName, ?string $language = null) @@ -294,6 +304,19 @@ public function isBookmarked(): bool return $this->getHTMLPage()->find($this->getLocator('isBookmarked'))->isVisible(); } + public function createNewDirectUrlAlias(string $path, string $languageName, bool $isRedirecting): void + { + $this->getHTMLPage()->find($this->getLocator('addUrlAliasButton'))->click(); + $this->createUrlAliasForm->createNewUrlAlias($path, $languageName, $isRedirecting); + } + + public function isUrlAliasOnTheList(string $path, string $type): bool + { + $customUrlAliasesTable = $this->tableBuilder->newTable()->withParentLocator($this->getLocator('customUrlAliasesTable'))->build(); + + return $customUrlAliasesTable->hasElement(['URL' => $path, 'Type' => $type]); + } + protected function specifyLocators(): array { return [ @@ -308,6 +331,8 @@ protected function specifyLocators(): array new VisibleCSSLocator('ibexaDropdownPreview', '.ibexa-raw-content-title__language-form .ibexa-dropdown__selection-info'), new VisibleCSSLocator('moreTab', '.ibexa-tabs__tab--more'), new VisibleCSSLocator('popupMenuItem', '.ibexa-popup-menu__item .ibexa-popup-menu__item-content'), + new VisibleCSSLocator('addUrlAliasButton', '#ibexa-tab-location-view-urls [data-bs-target="#ibexa-modal--custom-url-alias"]'), + new VisibleCSSLocator('customUrlAliasesTable', '#ibexa-tab-location-view-urls .ibexa-table'), ]; } From d6971e656cefc52d58e9ff3815196de0bd5bb08d Mon Sep 17 00:00:00 2001 From: barbaragr Date: Fri, 19 Sep 2025 15:57:19 +0200 Subject: [PATCH 02/18] Fixed errors --- .idea/.gitignore | 8 + .idea/admin-ui.iml | 22 ++ .idea/inspectionProfiles/Project_Default.xml | 7 + .idea/misc.xml | 7 + .idea/modules.xml | 8 + .idea/php.xml | 276 ++++++++++++++++++ .idea/phpunit.xml | 10 + .idea/vcs.xml | 4 + features/standard/UrlAliases.feature | 16 +- .../BrowserContext/ContentViewContext.php | 6 +- src/lib/Behat/Page/ContentViewPage.php | 2 +- 11 files changed, 359 insertions(+), 7 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/admin-ui.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/php.xml create mode 100644 .idea/phpunit.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..13566b81b0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/admin-ui.iml b/.idea/admin-ui.iml new file mode 100644 index 0000000000..c16e2ae3a4 --- /dev/null +++ b/.idea/admin-ui.iml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000..325e2c7d19 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000..2aa37a1880 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000..6a3bcc9be4 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000000..1092188b21 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml new file mode 100644 index 0000000000..4f8104cfb1 --- /dev/null +++ b/.idea/phpunit.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..d843f340d2 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/features/standard/UrlAliases.feature b/features/standard/UrlAliases.feature index 0a811f187c..4099c84507 100644 --- a/features/standard/UrlAliases.feature +++ b/features/standard/UrlAliases.feature @@ -5,11 +5,21 @@ Feature: UrlAliases Given I am logged as admin @test - Scenario: Create an Url Alias + Scenario: Create a redirect Url Alias Given a "folder" Content item named "UrlAliases" exists in root | name | short_name | | UrlAliases | UrlAliases | Given I'm on Content view Page for "UrlAliases" When I switch to "URL" tab in Content structure - And I create a new direct Url Alias called "TestUrlAlias" in "English (United Kingdom)" language - Then there should be a "/testurlalias" Url Alias on the list with "Direct" type \ No newline at end of file + And I create a new redirect Url Alias called "RedirectUrlAlias" in "English (United Kingdom)" language + Then there should be a "/redirecturlalias" Url Alias on the list with "Redirect" type + + @test2 + Scenario: Create a direct Url Alias + Given a "folder" Content item named "UrlAliases" exists in root + | name | short_name | + | UrlAliases | UrlAliases | + Given I'm on Content view Page for "UrlAliases" + When I switch to "URL" tab in Content structure + And I create a new direct Url Alias called "DirectUrlAlias" in "English (United Kingdom)" language + Then there should be a "/directurlalias" Url Alias on the list with "Direct" type \ No newline at end of file diff --git a/src/lib/Behat/BrowserContext/ContentViewContext.php b/src/lib/Behat/BrowserContext/ContentViewContext.php index 42c4eb9214..918c6a89ed 100644 --- a/src/lib/Behat/BrowserContext/ContentViewContext.php +++ b/src/lib/Behat/BrowserContext/ContentViewContext.php @@ -170,11 +170,11 @@ public function iSendContentToTrash(): void } /** - * @When I create a new direct Url Alias called :path in :languageName language + * @When I create a new redirect Url Alias called :path in :languageName language */ - public function iCreateNewUrlAlias(string $path, string $languageName): void + public function iCreateNewRedirectUrlAlias(string $path, string $languageName): void { - $this->contentViewPage->createNewDirectUrlAlias($path, $languageName, false); + $this->contentViewPage->createNewUrlAlias($path, $languageName, true); } /** diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index f7dd411e75..bcd0f37724 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -304,7 +304,7 @@ public function isBookmarked(): bool return $this->getHTMLPage()->find($this->getLocator('isBookmarked'))->isVisible(); } - public function createNewDirectUrlAlias(string $path, string $languageName, bool $isRedirecting): void + public function createNewUrlAlias(string $path, string $languageName, bool $isRedirecting): void { $this->getHTMLPage()->find($this->getLocator('addUrlAliasButton'))->click(); $this->createUrlAliasForm->createNewUrlAlias($path, $languageName, $isRedirecting); From 197bc58ae59feffd26093710fc53baf5b3c2474a Mon Sep 17 00:00:00 2001 From: barbaragr Date: Wed, 24 Sep 2025 23:19:34 +0200 Subject: [PATCH 03/18] Step definition reduction --- features/standard/UrlAliases.feature | 8 +++----- .../Resources/config/services/test/components.yaml | 2 +- .../Behat/BrowserContext/ContentViewContext.php | 7 ++++--- ...ateUrlAliasForm.php => CreateUrlAliasModal.php} | 11 ++++++++--- src/lib/Behat/Page/ContentViewPage.php | 14 ++++++++------ 5 files changed, 24 insertions(+), 18 deletions(-) rename src/lib/Behat/Component/{CreateUrlAliasForm.php => CreateUrlAliasModal.php} (75%) diff --git a/features/standard/UrlAliases.feature b/features/standard/UrlAliases.feature index 4099c84507..06f9e40787 100644 --- a/features/standard/UrlAliases.feature +++ b/features/standard/UrlAliases.feature @@ -1,25 +1,23 @@ -@IbexaOSS @IbexaHeadless @IbexaExperience @IbexaCommerce @javascript +@IbexaOSS @IbexaHeadless @IbexaExperience @IbexaCommerce @javascript @test Feature: UrlAliases Background: Given I am logged as admin - @test Scenario: Create a redirect Url Alias Given a "folder" Content item named "UrlAliases" exists in root | name | short_name | | UrlAliases | UrlAliases | Given I'm on Content view Page for "UrlAliases" When I switch to "URL" tab in Content structure - And I create a new redirect Url Alias called "RedirectUrlAlias" in "English (United Kingdom)" language + And I create a new Url Alias called "RedirectUrlAlias" in "English (United Kingdom)" language with redirect "true" Then there should be a "/redirecturlalias" Url Alias on the list with "Redirect" type - @test2 Scenario: Create a direct Url Alias Given a "folder" Content item named "UrlAliases" exists in root | name | short_name | | UrlAliases | UrlAliases | Given I'm on Content view Page for "UrlAliases" When I switch to "URL" tab in Content structure - And I create a new direct Url Alias called "DirectUrlAlias" in "English (United Kingdom)" language + And I create a new Url Alias called "DirectUrlAlias" in "English (United Kingdom)" language with redirect "false" Then there should be a "/directurlalias" Url Alias on the list with "Direct" type \ No newline at end of file diff --git a/src/bundle/Resources/config/services/test/components.yaml b/src/bundle/Resources/config/services/test/components.yaml index 907e5a7f2c..c87348d52d 100644 --- a/src/bundle/Resources/config/services/test/components.yaml +++ b/src/bundle/Resources/config/services/test/components.yaml @@ -60,7 +60,7 @@ services: Ibexa\AdminUi\Behat\Component\DeleteContentDialog: ~ - Ibexa\AdminUi\Behat\Component\CreateUrlAliasForm: ~ + Ibexa\AdminUi\Behat\Component\CreateUrlAliasModal: ~ Ibexa\AdminUi\Behat\Component\TrashSearch: ~ diff --git a/src/lib/Behat/BrowserContext/ContentViewContext.php b/src/lib/Behat/BrowserContext/ContentViewContext.php index 918c6a89ed..44811f9bc0 100644 --- a/src/lib/Behat/BrowserContext/ContentViewContext.php +++ b/src/lib/Behat/BrowserContext/ContentViewContext.php @@ -170,11 +170,12 @@ public function iSendContentToTrash(): void } /** - * @When I create a new redirect Url Alias called :path in :languageName language + * @When I create a new Url Alias called :path in :languageName language with redirect :redirect */ - public function iCreateNewRedirectUrlAlias(string $path, string $languageName): void + public function iCreateNewUrlAlias(string $path, string $languageName, string $redirect_string): void { - $this->contentViewPage->createNewUrlAlias($path, $languageName, true); + $redirect = filter_var($redirect_string, FILTER_VALIDATE_BOOLEAN); + $this->contentViewPage->createNewUrlAlias($path, $languageName, $redirect); } /** diff --git a/src/lib/Behat/Component/CreateUrlAliasForm.php b/src/lib/Behat/Component/CreateUrlAliasModal.php similarity index 75% rename from src/lib/Behat/Component/CreateUrlAliasForm.php rename to src/lib/Behat/Component/CreateUrlAliasModal.php index f217c844d0..f5d4df7ee5 100644 --- a/src/lib/Behat/Component/CreateUrlAliasForm.php +++ b/src/lib/Behat/Component/CreateUrlAliasModal.php @@ -11,10 +11,9 @@ use Ibexa\Behat\Browser\Component\Component; use Ibexa\Behat\Browser\Locator\VisibleCSSLocator; -final class CreateUrlAliasForm extends Component +final class CreateUrlAliasModal extends Component { use \Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; - private IbexaDropdown $ibexaDropdown; public function __construct(Session $session, IbexaDropdown $ibexaDropdown) @@ -28,12 +27,17 @@ public function verifyIsLoaded(): void $this->getHTMLPage()->find($this->getLocator('title'))->assert()->textEquals('Create a new URL alias'); } - public function createNewUrlAlias(string $path, string $languageName, bool $isRedirecting): void + public function createNewUrlAlias(string $path, string $languageName, bool $redirect): void { $this->getHTMLPage()->find($this->getLocator('pathInput'))->setValue($path); $this->getHTMLPage()->find($this->getLocator('languageDropdown'))->click(); $this->ibexaDropdown->verifyIsLoaded(); $this->ibexaDropdown->selectOption($languageName); + $redirectToggleState = $this->getHTMLPage()->find($this->getLocator('redirectToggle')); + //$this->setInteractiveBreakpoint(get_defined_vars()); + if ($redirect !== $redirectToggleState->hasClass('ibexa-toggle--is-checked')) { + $this->getHTMLPage()->find($this->getLocator('redirectToggle'))->click(); + } $this->getHTMLPage()->find($this->getLocator('createButton'))->click(); } @@ -44,6 +48,7 @@ protected function specifyLocators(): array new VisibleCSSLocator('createButton', '#custom_url_add_add'), new VisibleCSSLocator('pathInput', '#custom_url_add_path'), new VisibleCSSLocator('languageDropdown', '.ibexa-custom-url-from__item .ibexa-dropdown__selection-info'), + new VisibleCSSLocator('redirectToggle', '.ibexa-custom-url-from__item .ibexa-toggle'), ]; } } diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index bcd0f37724..a29f28ec8b 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -13,7 +13,7 @@ use Ibexa\AdminUi\Behat\Component\ContentActionsMenu; use Ibexa\AdminUi\Behat\Component\ContentItemAdminPreview; use Ibexa\AdminUi\Behat\Component\ContentTypePicker; -use Ibexa\AdminUi\Behat\Component\CreateUrlAliasForm; +use Ibexa\AdminUi\Behat\Component\CreateUrlAliasModal; use Ibexa\AdminUi\Behat\Component\DeleteContentDialog; use Ibexa\AdminUi\Behat\Component\Dialog; use Ibexa\AdminUi\Behat\Component\IbexaDropdown; @@ -36,6 +36,7 @@ class ContentViewPage extends Page { + use \Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; /** @var \Ibexa\AdminUi\Behat\Component\ContentActionsMenu Element representing the right menu */ private $contentActionsMenu; @@ -87,7 +88,7 @@ class ContentViewPage extends Page private DeleteContentDialog $deleteContentDialog; - private CreateUrlAliasForm $createUrlAliasForm; + private CreateUrlAliasModal $createUrlAliasModal; private TableBuilder $tableBuilder; @@ -108,7 +109,7 @@ public function __construct( IbexaDropdown $ibexaDropdown, UpperMenu $upperMenu, DeleteContentDialog $deleteContentDialog, - CreateUrlAliasForm $createUrlAliasForm, + CreateUrlAliasModal $createUrlAliasModal, TableBuilder $tableBuilder ) { parent::__construct($session, $router); @@ -126,7 +127,7 @@ public function __construct( $this->ibexaDropdown = $ibexaDropdown; $this->upperMenu = $upperMenu; $this->deleteContentDialog = $deleteContentDialog; - $this->createUrlAliasForm = $createUrlAliasForm; + $this->CreateUrlAliasModal = $createUrlAliasModal; $this->tableBuilder = $tableBuilder; } @@ -304,10 +305,11 @@ public function isBookmarked(): bool return $this->getHTMLPage()->find($this->getLocator('isBookmarked'))->isVisible(); } - public function createNewUrlAlias(string $path, string $languageName, bool $isRedirecting): void + public function createNewUrlAlias(string $path, string $languageName, bool $redirect): void { $this->getHTMLPage()->find($this->getLocator('addUrlAliasButton'))->click(); - $this->createUrlAliasForm->createNewUrlAlias($path, $languageName, $isRedirecting); + // $this->setInteractiveBreakpoint(get_defined_vars()); + $this->CreateUrlAliasModal->createNewUrlAlias($path, $languageName, $redirect); } public function isUrlAliasOnTheList(string $path, string $type): bool From d77f71c1c9a847d3c5f7e00769c1d04c383d8678 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Fri, 3 Oct 2025 15:54:11 +0200 Subject: [PATCH 04/18] After cs-fix --- features/standard/UrlAliases.feature | 2 +- src/lib/Behat/Component/CreateUrlAliasModal.php | 6 ++---- src/lib/Behat/Page/ContentViewPage.php | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/features/standard/UrlAliases.feature b/features/standard/UrlAliases.feature index 06f9e40787..40d9aec10d 100644 --- a/features/standard/UrlAliases.feature +++ b/features/standard/UrlAliases.feature @@ -20,4 +20,4 @@ Feature: UrlAliases Given I'm on Content view Page for "UrlAliases" When I switch to "URL" tab in Content structure And I create a new Url Alias called "DirectUrlAlias" in "English (United Kingdom)" language with redirect "false" - Then there should be a "/directurlalias" Url Alias on the list with "Direct" type \ No newline at end of file + Then there should be a "/directurlalias" Url Alias on the list with "Direct" type diff --git a/src/lib/Behat/Component/CreateUrlAliasModal.php b/src/lib/Behat/Component/CreateUrlAliasModal.php index f5d4df7ee5..5258eb99b3 100644 --- a/src/lib/Behat/Component/CreateUrlAliasModal.php +++ b/src/lib/Behat/Component/CreateUrlAliasModal.php @@ -13,7 +13,6 @@ final class CreateUrlAliasModal extends Component { - use \Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; private IbexaDropdown $ibexaDropdown; public function __construct(Session $session, IbexaDropdown $ibexaDropdown) @@ -34,10 +33,9 @@ public function createNewUrlAlias(string $path, string $languageName, bool $redi $this->ibexaDropdown->verifyIsLoaded(); $this->ibexaDropdown->selectOption($languageName); $redirectToggleState = $this->getHTMLPage()->find($this->getLocator('redirectToggle')); - //$this->setInteractiveBreakpoint(get_defined_vars()); if ($redirect !== $redirectToggleState->hasClass('ibexa-toggle--is-checked')) { - $this->getHTMLPage()->find($this->getLocator('redirectToggle'))->click(); - } + $this->getHTMLPage()->find($this->getLocator('redirectToggle'))->click(); + } $this->getHTMLPage()->find($this->getLocator('createButton'))->click(); } diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index 5dbb2c16f5..06f227527f 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -36,7 +36,6 @@ class ContentViewPage extends Page { - use \Ibexa\Behat\Core\Debug\InteractiveDebuggerTrait; /** @var \Ibexa\AdminUi\Behat\Component\ContentActionsMenu Element representing the right menu */ private $contentActionsMenu; @@ -308,7 +307,6 @@ public function isBookmarked(): bool public function createNewUrlAlias(string $path, string $languageName, bool $redirect): void { $this->getHTMLPage()->find($this->getLocator('addUrlAliasButton'))->click(); - // $this->setInteractiveBreakpoint(get_defined_vars()); $this->CreateUrlAliasModal->createNewUrlAlias($path, $languageName, $redirect); } From b6c3bb99fefb6f3417fa934e242c835eaa9ee480 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Fri, 3 Oct 2025 15:55:16 +0200 Subject: [PATCH 05/18] removed .idea --- .idea/.gitignore | 8 - .idea/admin-ui.iml | 22 -- .idea/inspectionProfiles/Project_Default.xml | 7 - .idea/misc.xml | 7 - .idea/modules.xml | 8 - .idea/php.xml | 276 ------------------- .idea/phpunit.xml | 10 - .idea/vcs.xml | 4 - 8 files changed, 342 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/admin-ui.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/php.xml delete mode 100644 .idea/phpunit.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81b0..0000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/admin-ui.iml b/.idea/admin-ui.iml deleted file mode 100644 index c16e2ae3a4..0000000000 --- a/.idea/admin-ui.iml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 325e2c7d19..0000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 2aa37a1880..0000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 6a3bcc9be4..0000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index 1092188b21..0000000000 --- a/.idea/php.xml +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml deleted file mode 100644 index 4f8104cfb1..0000000000 --- a/.idea/phpunit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index d843f340d2..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From 913652e5e6ed2d899476b9e4c440fa5fd99ee037 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Fri, 3 Oct 2025 16:02:43 +0200 Subject: [PATCH 06/18] Fixes after phpstan --- src/lib/Behat/Page/ContentViewPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index 06f227527f..6656302e4c 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -126,7 +126,7 @@ public function __construct( $this->ibexaDropdown = $ibexaDropdown; $this->upperMenu = $upperMenu; $this->deleteContentDialog = $deleteContentDialog; - $this->CreateUrlAliasModal = $createUrlAliasModal; + $this->createUrlAliasModal = $createUrlAliasModal; $this->tableBuilder = $tableBuilder; } @@ -307,7 +307,7 @@ public function isBookmarked(): bool public function createNewUrlAlias(string $path, string $languageName, bool $redirect): void { $this->getHTMLPage()->find($this->getLocator('addUrlAliasButton'))->click(); - $this->CreateUrlAliasModal->createNewUrlAlias($path, $languageName, $redirect); + $this->createUrlAliasModal->createNewUrlAlias($path, $languageName, $redirect); } public function isUrlAliasOnTheList(string $path, string $type): bool From 0f7e43a7dfb958ade6796b05ab4c6d1f4f09ceac Mon Sep 17 00:00:00 2001 From: barbaragr Date: Fri, 3 Oct 2025 16:32:28 +0200 Subject: [PATCH 07/18] Fixed unclosed '{' --- src/lib/Behat/BrowserContext/ContentViewContext.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/Behat/BrowserContext/ContentViewContext.php b/src/lib/Behat/BrowserContext/ContentViewContext.php index 91c44e302d..c4e274cae3 100644 --- a/src/lib/Behat/BrowserContext/ContentViewContext.php +++ b/src/lib/Behat/BrowserContext/ContentViewContext.php @@ -196,5 +196,6 @@ public function verifyUrlAliasExists(string $path, string $type): void $this->contentViewPage->isUrlAliasOnTheList($path, $type), sprintf('Url alias "%s" with type "%s" not found', $path, $type) ); + } } From bfaf0b9551a644fdfeae95e23ad1b26ca451694c Mon Sep 17 00:00:00 2001 From: barbaragr Date: Mon, 6 Oct 2025 07:17:10 +0200 Subject: [PATCH 08/18] Removed test tag --- features/standard/UrlAliases.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/standard/UrlAliases.feature b/features/standard/UrlAliases.feature index 40d9aec10d..2f397647cc 100644 --- a/features/standard/UrlAliases.feature +++ b/features/standard/UrlAliases.feature @@ -1,4 +1,4 @@ -@IbexaOSS @IbexaHeadless @IbexaExperience @IbexaCommerce @javascript @test +@IbexaOSS @IbexaHeadless @IbexaExperience @IbexaCommerce @javascript Feature: UrlAliases Background: From 54d122eedbf2dba2924794cc37ebc78a2fc948c1 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Mon, 6 Oct 2025 08:17:28 +0200 Subject: [PATCH 09/18] After cs-fix --- src/lib/Behat/BrowserContext/ContentViewContext.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/Behat/BrowserContext/ContentViewContext.php b/src/lib/Behat/BrowserContext/ContentViewContext.php index c4e274cae3..3fe58e1b2c 100644 --- a/src/lib/Behat/BrowserContext/ContentViewContext.php +++ b/src/lib/Behat/BrowserContext/ContentViewContext.php @@ -168,7 +168,7 @@ public function iSendContentToTrash(): void { $this->contentViewPage->sendToTrash(); } - + /** * @Then I should see the alert :alertMessage appear */ @@ -197,5 +197,4 @@ public function verifyUrlAliasExists(string $path, string $type): void sprintf('Url alias "%s" with type "%s" not found', $path, $type) ); } - } From 55d51ad85ca0ebe9a2a9604dba572eccf46b0da4 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Mon, 6 Oct 2025 11:20:56 +0200 Subject: [PATCH 10/18] Added dependencies --- dependencies.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 dependencies.json diff --git a/dependencies.json b/dependencies.json new file mode 100644 index 0000000000..5cec80d19d --- /dev/null +++ b/dependencies.json @@ -0,0 +1,11 @@ +{ + "recipesEndpoint": "", + "packages": [ + { + "requirement": "ibx-9747-add-behat-tests-coverage-for-URL-aliases as 4.6.x-dev", + "repositoryUrl": "https://github.com/ibexa/product-catalog", + "package": "ibexa/product-catalog", + "shouldBeAddedAsVCS": true + } + ] +} \ No newline at end of file From 82da847125200c6b76582005f99c991e35fff964 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Mon, 6 Oct 2025 11:28:51 +0200 Subject: [PATCH 11/18] Fixed dependencies --- dependencies.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.json b/dependencies.json index 5cec80d19d..af7b31012b 100644 --- a/dependencies.json +++ b/dependencies.json @@ -2,7 +2,7 @@ "recipesEndpoint": "", "packages": [ { - "requirement": "ibx-9747-add-behat-tests-coverage-for-URL-aliases as 4.6.x-dev", + "requirement": "dev-ibx-9747-add-behat-tests-coverage-for-URL-aliases as 4.6.x-dev", "repositoryUrl": "https://github.com/ibexa/product-catalog", "package": "ibexa/product-catalog", "shouldBeAddedAsVCS": true From 2638fd10aa5aeab2d7f4fc85f2a247551bd2f5e8 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Mon, 6 Oct 2025 14:37:20 +0200 Subject: [PATCH 12/18] Fixed CSSLocator type --- src/lib/Behat/Page/ContentViewPage.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index 6656302e4c..03ac452129 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -112,6 +112,7 @@ public function __construct( TableBuilder $tableBuilder ) { parent::__construct($session, $router); + $this->contentActionsMenu = $contentActionsMenu; $this->subItemList = $subItemList; $this->contentTypePicker = $contentTypePicker; @@ -312,7 +313,11 @@ public function createNewUrlAlias(string $path, string $languageName, bool $redi public function isUrlAliasOnTheList(string $path, string $type): bool { - $customUrlAliasesTable = $this->tableBuilder->newTable()->withParentLocator($this->getLocator('customUrlAliasesTable'))->build(); + + /** @var \Ibexa\Behat\Browser\Locator\CSSLocator $locator */ + $locator = $this->getLocator('customUrlAliasesTable'); + $customUrlAliasesTable = $this->tableBuilder->newTable()->withParentLocator($locator)->build(); + // $customUrlAliasesTable = $this->tableBuilder->newTable()->withParentLocator($this->getLocator('customUrlAliasesTable'))->build(); return $customUrlAliasesTable->hasElement(['URL' => $path, 'Type' => $type]); } From 1e163ea6a180c6b3808cd7d53a3f5adc0385138d Mon Sep 17 00:00:00 2001 From: barbaragr Date: Mon, 6 Oct 2025 14:38:33 +0200 Subject: [PATCH 13/18] Removed comment --- src/lib/Behat/Page/ContentViewPage.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index 03ac452129..8850314534 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -317,7 +317,6 @@ public function isUrlAliasOnTheList(string $path, string $type): bool /** @var \Ibexa\Behat\Browser\Locator\CSSLocator $locator */ $locator = $this->getLocator('customUrlAliasesTable'); $customUrlAliasesTable = $this->tableBuilder->newTable()->withParentLocator($locator)->build(); - // $customUrlAliasesTable = $this->tableBuilder->newTable()->withParentLocator($this->getLocator('customUrlAliasesTable'))->build(); return $customUrlAliasesTable->hasElement(['URL' => $path, 'Type' => $type]); } From 079f05cd4574fee40eadaa58538da1845badd035 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Mon, 6 Oct 2025 14:44:53 +0200 Subject: [PATCH 14/18] Fixes after fix-cs --- src/lib/Behat/Page/ContentViewPage.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index 8850314534..8632d020b5 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -313,7 +313,6 @@ public function createNewUrlAlias(string $path, string $languageName, bool $redi public function isUrlAliasOnTheList(string $path, string $type): bool { - /** @var \Ibexa\Behat\Browser\Locator\CSSLocator $locator */ $locator = $this->getLocator('customUrlAliasesTable'); $customUrlAliasesTable = $this->tableBuilder->newTable()->withParentLocator($locator)->build(); From c2dede2ddb891813c640986bd7cab5c6cde7d0d9 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Tue, 7 Oct 2025 13:13:40 +0200 Subject: [PATCH 15/18] Fixes after review --- features/standard/UrlAliases.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/features/standard/UrlAliases.feature b/features/standard/UrlAliases.feature index 2f397647cc..35ffde0553 100644 --- a/features/standard/UrlAliases.feature +++ b/features/standard/UrlAliases.feature @@ -8,16 +8,16 @@ Feature: UrlAliases Given a "folder" Content item named "UrlAliases" exists in root | name | short_name | | UrlAliases | UrlAliases | - Given I'm on Content view Page for "UrlAliases" - When I switch to "URL" tab in Content structure - And I create a new Url Alias called "RedirectUrlAlias" in "English (United Kingdom)" language with redirect "true" + And I'm on Content view Page for "UrlAliases" + And I switch to "URL" tab in Content structure + When I create a new Url Alias called "RedirectUrlAlias" in "English (United Kingdom)" language with redirect "true" Then there should be a "/redirecturlalias" Url Alias on the list with "Redirect" type Scenario: Create a direct Url Alias Given a "folder" Content item named "UrlAliases" exists in root | name | short_name | | UrlAliases | UrlAliases | - Given I'm on Content view Page for "UrlAliases" - When I switch to "URL" tab in Content structure - And I create a new Url Alias called "DirectUrlAlias" in "English (United Kingdom)" language with redirect "false" + And I'm on Content view Page for "UrlAliases" + And I switch to "URL" tab in Content structure + When I create a new Url Alias called "DirectUrlAlias" in "English (United Kingdom)" language with redirect "false" Then there should be a "/directurlalias" Url Alias on the list with "Direct" type From 2b65cb03871702a7dff93471cbaef103ac1d896e Mon Sep 17 00:00:00 2001 From: barbaragr Date: Tue, 7 Oct 2025 13:19:05 +0200 Subject: [PATCH 16/18] Added Timeout after review --- src/lib/Behat/Component/CreateUrlAliasModal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Behat/Component/CreateUrlAliasModal.php b/src/lib/Behat/Component/CreateUrlAliasModal.php index 5258eb99b3..e5117fc2fe 100644 --- a/src/lib/Behat/Component/CreateUrlAliasModal.php +++ b/src/lib/Behat/Component/CreateUrlAliasModal.php @@ -23,7 +23,7 @@ public function __construct(Session $session, IbexaDropdown $ibexaDropdown) public function verifyIsLoaded(): void { - $this->getHTMLPage()->find($this->getLocator('title'))->assert()->textEquals('Create a new URL alias'); + $this->getHTMLPage()->setTimeout(3)->find($this->getLocator('title'))->assert()->textEquals('Create a new URL alias'); } public function createNewUrlAlias(string $path, string $languageName, bool $redirect): void From 39031905e8b391b43a42e19f9f901274ee3e61c7 Mon Sep 17 00:00:00 2001 From: barbaragr Date: Wed, 8 Oct 2025 16:14:22 +0200 Subject: [PATCH 17/18] Fix after review --- features/standard/UrlAliases.feature | 4 ++-- src/lib/Behat/BrowserContext/ContentViewContext.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/standard/UrlAliases.feature b/features/standard/UrlAliases.feature index 35ffde0553..97b61e4234 100644 --- a/features/standard/UrlAliases.feature +++ b/features/standard/UrlAliases.feature @@ -10,7 +10,7 @@ Feature: UrlAliases | UrlAliases | UrlAliases | And I'm on Content view Page for "UrlAliases" And I switch to "URL" tab in Content structure - When I create a new Url Alias called "RedirectUrlAlias" in "English (United Kingdom)" language with redirect "true" + When I create a new Url Alias called "RedirectUrlAlias" in "English (United Kingdom)" language with redirect value set to "true" Then there should be a "/redirecturlalias" Url Alias on the list with "Redirect" type Scenario: Create a direct Url Alias @@ -19,5 +19,5 @@ Feature: UrlAliases | UrlAliases | UrlAliases | And I'm on Content view Page for "UrlAliases" And I switch to "URL" tab in Content structure - When I create a new Url Alias called "DirectUrlAlias" in "English (United Kingdom)" language with redirect "false" + When I create a new Url Alias called "DirectUrlAlias" in "English (United Kingdom)" language with redirect value set to "false" Then there should be a "/directurlalias" Url Alias on the list with "Direct" type diff --git a/src/lib/Behat/BrowserContext/ContentViewContext.php b/src/lib/Behat/BrowserContext/ContentViewContext.php index 3fe58e1b2c..df5d09b9ea 100644 --- a/src/lib/Behat/BrowserContext/ContentViewContext.php +++ b/src/lib/Behat/BrowserContext/ContentViewContext.php @@ -179,7 +179,7 @@ public function iShouldSeeAlertAppears(string $alertMessage): void } /** - * @When I create a new Url Alias called :path in :languageName language with redirect :redirect + * @When I create a new Url Alias called :path in :languageName language with redirect value set to :redirect */ public function iCreateNewUrlAlias(string $path, string $languageName, string $redirect_string): void { From d30f587a710f2c3a951f15a8bd9e60ed1d8ddc35 Mon Sep 17 00:00:00 2001 From: Barbara Grajczyk <32538832+barbaragr@users.noreply.github.com> Date: Wed, 8 Oct 2025 20:30:45 +0200 Subject: [PATCH 18/18] Delete dependencies.json --- dependencies.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 dependencies.json diff --git a/dependencies.json b/dependencies.json deleted file mode 100644 index af7b31012b..0000000000 --- a/dependencies.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "recipesEndpoint": "", - "packages": [ - { - "requirement": "dev-ibx-9747-add-behat-tests-coverage-for-URL-aliases as 4.6.x-dev", - "repositoryUrl": "https://github.com/ibexa/product-catalog", - "package": "ibexa/product-catalog", - "shouldBeAddedAsVCS": true - } - ] -} \ No newline at end of file