1010
1111use Behat \Mink \Session ;
1212use Ibexa \AdminUi \Behat \Component \Breadcrumb ;
13+ use Ibexa \AdminUi \Behat \Component \CancelContentDialog ;
1314use Ibexa \AdminUi \Behat \Component \ContentActionsMenu ;
1415use Ibexa \AdminUi \Behat \Component \ContentItemAdminPreview ;
1516use Ibexa \AdminUi \Behat \Component \ContentTypePicker ;
@@ -88,6 +89,8 @@ class ContentViewPage extends Page
8889
8990 private DeleteContentDialog $ deleteContentDialog ;
9091
92+ private ?CancelContentDialog $ cancelContentDialog ;
93+
9194 public function __construct (
9295 Session $ session ,
9396 Router $ router ,
@@ -104,7 +107,8 @@ public function __construct(
104107 UniversalDiscoveryWidget $ universalDiscoveryWidget ,
105108 IbexaDropdown $ ibexaDropdown ,
106109 UpperMenu $ upperMenu ,
107- DeleteContentDialog $ deleteContentDialog
110+ DeleteContentDialog $ deleteContentDialog ,
111+ ?CancelContentDialog $ cancelContentDialog = null
108112 ) {
109113 parent ::__construct ($ session , $ router );
110114 $ this ->contentActionsMenu = $ contentActionsMenu ;
@@ -121,6 +125,7 @@ public function __construct(
121125 $ this ->ibexaDropdown = $ ibexaDropdown ;
122126 $ this ->upperMenu = $ upperMenu ;
123127 $ this ->deleteContentDialog = $ deleteContentDialog ;
128+ $ this ->cancelContentDialog = $ cancelContentDialog ;
124129 }
125130
126131 public function startCreatingContent (string $ contentTypeName , ?string $ language = null )
@@ -313,6 +318,7 @@ protected function specifyLocators(): array
313318 new VisibleCSSLocator ('popupMenuItem ' , '.ibexa-popup-menu__item .ibexa-popup-menu__item-content ' ),
314319 new VisibleCSSLocator ('alertTitle ' , '.ibexa-alert__title ' ),
315320 new VisibleCSSLocator ('selectHideMode ' , '.form-check .ibexa-input--radio ' ),
321+ new VisibleCSSLocator ('cancelScheduleButton ' , '.ibexa-btn--schedule-hide-cancel ' ),
316322 ];
317323 }
318324
@@ -391,4 +397,13 @@ public function clearBehatCacheDirectory(): void
391397 throw new \Exception ('Error while clearing cache: ' . $ exception ->getMessage ());
392398 }
393399 }
400+
401+ public function cancelScheduledHiding (): void
402+ {
403+ $ this ->getHTMLPage ()->find ($ this ->getLocator ('cancelScheduleButton ' ))->click ();
404+ $ this ->dialog ->verifyIsLoaded ();
405+ if ($ this ->cancelContentDialog !== null ) {
406+ $ this ->cancelContentDialog ->confirmCanceling ('Cancel scheduled hiding ' );
407+ }
408+ }
394409}
0 commit comments