diff --git a/src/lib/Behat/BrowserContext/ContentTypeContext.php b/src/lib/Behat/BrowserContext/ContentTypeContext.php index 9fa01f9dc5..4855c919bf 100644 --- a/src/lib/Behat/BrowserContext/ContentTypeContext.php +++ b/src/lib/Behat/BrowserContext/ContentTypeContext.php @@ -239,4 +239,14 @@ public function iCheckBlockInField($blockName) $this->contentTypeUpdatePage->expandDefaultBlocksOption(); $this->contentTypeUpdatePage->selectBlock($blockName); } + + /** + * @Given I select :viewMode editor launch mode in ezlandingpage field options + */ + public function iCheckEditorLaunchModeOption(string $viewMode): void + { + $this->contentTypeUpdatePage->verifyIsLoaded(); + $this->contentTypeUpdatePage->expandLastFieldDefinition(); + $this->contentTypeUpdatePage->selectEditorLaunchMode($viewMode); + } } diff --git a/src/lib/Behat/Page/ContentTypeUpdatePage.php b/src/lib/Behat/Page/ContentTypeUpdatePage.php index 045c4de73d..5a4f5accd4 100644 --- a/src/lib/Behat/Page/ContentTypeUpdatePage.php +++ b/src/lib/Behat/Page/ContentTypeUpdatePage.php @@ -10,6 +10,7 @@ use Ibexa\Behat\Browser\Element\Condition\ElementExistsCondition; use Ibexa\Behat\Browser\Element\Condition\ElementTransitionHasEndedCondition; +use Ibexa\Behat\Browser\Element\Criterion\ElementAttributeCriterion; use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion; use Ibexa\Behat\Browser\Element\Mapper\ElementTextMapper; use Ibexa\Behat\Browser\Locator\VisibleCSSLocator; @@ -47,6 +48,7 @@ public function specifyLocators(): array new VisibleCSSLocator('availableFieldLabelList', '.ibexa-available-field-types__list > li'), new VisibleCSSLocator('workspace', '#content_collapse > div.ibexa-collapse__body-content > div'), new VisibleCSSLocator('fieldDefinitionToggle', '.ibexa-collapse:nth-last-child(2) > div.ibexa-collapse__header > button:last-child:not([data-bs-target="#content_collapse"])'), + new VisibleCSSLocator('selectLaunchEditorMode', '.form-check .ibexa-input--radio'), new VisibleCSSLocator('fieldDefinitionOpenContainer', '[data-collapsed="false"] .ibexa-content-type-edit__field-definition-content'), new VisibleCSSLocator('selectBlocksDropdown', '.ibexa-page-select-items__toggler'), ]); @@ -123,4 +125,11 @@ public function verifyIsLoaded(): void parent::verifyIsLoaded(); $this->getHTMLPage()->find($this->getLocator('contentTypeAddButton'))->assert()->isVisible(); } + + public function selectEditorLaunchMode(string $viewMode): void + { + $this->getHTMLPage() + ->findAll($this->getLocator('selectLaunchEditorMode')) + ->getByCriterion(new ElementAttributeCriterion('value', $viewMode))->click(); + } }