13
13
use Ibexa \AdminUi \Behat \Component \ContentActionsMenu ;
14
14
use Ibexa \AdminUi \Behat \Component \ContentItemAdminPreview ;
15
15
use Ibexa \AdminUi \Behat \Component \ContentTypePicker ;
16
+ use Ibexa \AdminUi \Behat \Component \CreateUrlAliasForm ;
16
17
use Ibexa \AdminUi \Behat \Component \DeleteContentDialog ;
17
18
use Ibexa \AdminUi \Behat \Component \Dialog ;
18
19
use Ibexa \AdminUi \Behat \Component \IbexaDropdown ;
19
20
use Ibexa \AdminUi \Behat \Component \LanguagePicker ;
20
21
use Ibexa \AdminUi \Behat \Component \SubItemsList ;
22
+ use Ibexa \AdminUi \Behat \Component \Table \TableBuilder ;
21
23
use Ibexa \AdminUi \Behat \Component \TranslationDialog ;
22
24
use Ibexa \AdminUi \Behat \Component \UniversalDiscoveryWidget ;
23
25
use Ibexa \AdminUi \Behat \Component \UpperMenu ;
@@ -85,6 +87,10 @@ class ContentViewPage extends Page
85
87
86
88
private DeleteContentDialog $ deleteContentDialog ;
87
89
90
+ private CreateUrlAliasForm $ createUrlAliasForm ;
91
+
92
+ private TableBuilder $ tableBuilder ;
93
+
88
94
public function __construct (
89
95
Session $ session ,
90
96
Router $ router ,
@@ -101,7 +107,9 @@ public function __construct(
101
107
UniversalDiscoveryWidget $ universalDiscoveryWidget ,
102
108
IbexaDropdown $ ibexaDropdown ,
103
109
UpperMenu $ upperMenu ,
104
- DeleteContentDialog $ deleteContentDialog
110
+ DeleteContentDialog $ deleteContentDialog ,
111
+ CreateUrlAliasForm $ createUrlAliasForm ,
112
+ TableBuilder $ tableBuilder
105
113
) {
106
114
parent ::__construct ($ session , $ router );
107
115
$ this ->contentActionsMenu = $ contentActionsMenu ;
@@ -118,6 +126,8 @@ public function __construct(
118
126
$ this ->ibexaDropdown = $ ibexaDropdown ;
119
127
$ this ->upperMenu = $ upperMenu ;
120
128
$ this ->deleteContentDialog = $ deleteContentDialog ;
129
+ $ this ->createUrlAliasForm = $ createUrlAliasForm ;
130
+ $ this ->tableBuilder = $ tableBuilder ;
121
131
}
122
132
123
133
public function startCreatingContent (string $ contentTypeName , ?string $ language = null )
@@ -294,6 +304,19 @@ public function isBookmarked(): bool
294
304
return $ this ->getHTMLPage ()->find ($ this ->getLocator ('isBookmarked ' ))->isVisible ();
295
305
}
296
306
307
+ public function createNewDirectUrlAlias (string $ path , string $ languageName , bool $ isRedirecting ): void
308
+ {
309
+ $ this ->getHTMLPage ()->find ($ this ->getLocator ('addUrlAliasButton ' ))->click ();
310
+ $ this ->createUrlAliasForm ->createNewUrlAlias ($ path , $ languageName , $ isRedirecting );
311
+ }
312
+
313
+ public function isUrlAliasOnTheList (string $ path , string $ type ): bool
314
+ {
315
+ $ customUrlAliasesTable = $ this ->tableBuilder ->newTable ()->withParentLocator ($ this ->getLocator ('customUrlAliasesTable ' ))->build ();
316
+
317
+ return $ customUrlAliasesTable ->hasElement (['URL ' => $ path , 'Type ' => $ type ]);
318
+ }
319
+
297
320
protected function specifyLocators (): array
298
321
{
299
322
return [
@@ -308,6 +331,8 @@ protected function specifyLocators(): array
308
331
new VisibleCSSLocator ('ibexaDropdownPreview ' , '.ibexa-raw-content-title__language-form .ibexa-dropdown__selection-info ' ),
309
332
new VisibleCSSLocator ('moreTab ' , '.ibexa-tabs__tab--more ' ),
310
333
new VisibleCSSLocator ('popupMenuItem ' , '.ibexa-popup-menu__item .ibexa-popup-menu__item-content ' ),
334
+ new VisibleCSSLocator ('addUrlAliasButton ' , '#ibexa-tab-location-view-urls [data-bs-target="#ibexa-modal--custom-url-alias"] ' ),
335
+ new VisibleCSSLocator ('customUrlAliasesTable ' , '#ibexa-tab-location-view-urls .ibexa-table ' ),
311
336
];
312
337
}
313
338
0 commit comments