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 ;
@@ -94,6 +95,8 @@ class ContentViewPage extends Page
9495
9596 private TableBuilder $ tableBuilder ;
9697
98+ private ?CancelContentDialog $ cancelContentDialog ;
99+
97100 public function __construct (
98101 Session $ session ,
99102 Router $ router ,
@@ -112,7 +115,8 @@ public function __construct(
112115 UpperMenu $ upperMenu ,
113116 DeleteContentDialog $ deleteContentDialog ,
114117 CreateUrlAliasModal $ createUrlAliasModal ,
115- TableBuilder $ tableBuilder
118+ TableBuilder $ tableBuilder ,
119+ ?CancelContentDialog $ cancelContentDialog = null
116120 ) {
117121 parent ::__construct ($ session , $ router );
118122
@@ -132,6 +136,7 @@ public function __construct(
132136 $ this ->deleteContentDialog = $ deleteContentDialog ;
133137 $ this ->createUrlAliasModal = $ createUrlAliasModal ;
134138 $ this ->tableBuilder = $ tableBuilder ;
139+ $ this ->cancelContentDialog = $ cancelContentDialog ;
135140 }
136141
137142 public function startCreatingContent (string $ contentTypeName , ?string $ language = null )
@@ -341,6 +346,7 @@ protected function specifyLocators(): array
341346 new VisibleCSSLocator ('customUrlAliasesTable ' , '#ibexa-tab-location-view-urls .ibexa-table ' ),
342347 new VisibleCSSLocator ('alertTitle ' , '.ibexa-alert__title ' ),
343348 new VisibleCSSLocator ('selectHideMode ' , '.form-check .ibexa-input--radio ' ),
349+ new VisibleCSSLocator ('cancelScheduleButton ' , '.ibexa-btn--schedule-hide-cancel ' ),
344350 ];
345351 }
346352
@@ -419,4 +425,13 @@ public function clearBehatCacheDirectory(): void
419425 throw new \Exception ('Error while clearing cache: ' . $ exception ->getMessage ());
420426 }
421427 }
428+
429+ public function cancelScheduledHiding (): void
430+ {
431+ $ this ->getHTMLPage ()->find ($ this ->getLocator ('cancelScheduleButton ' ))->click ();
432+ $ this ->dialog ->verifyIsLoaded ();
433+ if ($ this ->cancelContentDialog !== null ) {
434+ $ this ->cancelContentDialog ->confirmCanceling ('Cancel scheduled hiding ' );
435+ }
436+ }
422437}
0 commit comments