-
Notifications
You must be signed in to change notification settings - Fork 17
IBX-10333 Added scenario for hide later coverage #1731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.6
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,3 +133,38 @@ Scenario: Content can be copied | |
| When I perform the "Reveal" action | ||
| And I should be on Content view Page for "ContentManagement/TestArticleToHide" | ||
| Then success notification that "Content item 'TestArticleToHide' revealed." appears | ||
|
|
||
| @IbexaHeadless @IbexaExperience @IbexaCommerce | ||
| Scenario: Content can be hidden later | ||
| Given a "folder" Content item named "ContentManagement" exists in root | ||
| | name | short_name | | ||
| | ContentManagement | ContentManagement | | ||
| And a "article" Content item named "TestArticleToHideLater" exists in "ContentManagement" | ||
| | title | short_title | intro | | ||
| | TestArticleToHideLater | TestArticleToHideLater | TestArticleIntro | | ||
| And I'm on Content view Page for "ContentManagement/TestArticleToHideLater" | ||
| When I perform the "Hide" action | ||
| And I select hide "later" for field options | ||
| And I perform the "Confirm" action | ||
| And I should be on Content view Page for "ContentManagement/TestArticleToHideLater" | ||
| Then I should see the alert contains "This Content item will be hidden and won't be publicly available after" appear | ||
| When I run the scheduled jobs | ||
| And I clear the behat cache directory | ||
| Then I should see the alert "This Content item or its Location is hidden." appear | ||
|
|
||
| @IbexaHeadless @IbexaExperience @IbexaCommerce | ||
| Scenario: Content hide later can be cancelled | ||
| Given a "folder" Content item named "ContentManagement" exists in root | ||
| | name | short_name | | ||
| | ContentManagement | ContentManagement | | ||
| And a "article" Content item named "TestArticleToHideLater" exists in "ContentManagement" | ||
| | title | short_title | intro | | ||
| | TestArticleToCancelHideLater | TestArticleToCancelHideLater | TestArticleIntro | | ||
| And I'm on Content view Page for "ContentManagement/TestArticleToCancelHideLater" | ||
| When I perform the "Hide" action | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
| And I select hide "later" for field options | ||
| And I perform the "Confirm" action | ||
| And I should be on Content view Page for "ContentManagement/TestArticleToCancelHideLater" | ||
| Then I should see the alert contains "This Content item will be hidden and won't be publicly available after" appear | ||
| When I cancel scheduled hiding of the content item | ||
| Then I should see the alert "Canceled scheduled hiding of Content item 'TestArticleToCancelHideLater'." appear | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
| * @license For full copyright and license information view LICENSE file distributed with this source code. | ||
| */ | ||
| declare(strict_types=1); | ||
|
|
||
| namespace Ibexa\AdminUi\Behat\Component; | ||
|
|
||
| use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion; | ||
| use Ibexa\Behat\Browser\Locator\VisibleCSSLocator; | ||
|
|
||
| class CancelContentDialog extends Dialog | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that Dialog component should be enough here. |
||
| { | ||
| public function confirmCanceling(string $cancelScheduledHidingButton): void | ||
| { | ||
| $this->getHTMLPage() | ||
| ->findAll($this->getLocator('confirmCancelButton')) | ||
| ->getByCriterion(new ElementTextCriterion($cancelScheduledHidingButton)) | ||
| ->click(); | ||
| } | ||
|
|
||
| public function specifyLocators(): array | ||
| { | ||
| return array_merge(parent::specifyLocators(), [ | ||
| new VisibleCSSLocator('confirmCancelButton', '#review-content-modal .ibexa-btn'), | ||
| ]); | ||
| } | ||
| } | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets only use When/Then once per scenario. Focus of this scenario should a be a scheduler run.