Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lib/Behat/BrowserContext/UserPreferencesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,14 @@ public function iSetAutosaveDraftValue(): void
$this->userSettingsPage->verifyIsLoaded();
$this->userSettingsPage->disableAutosave();
}

/**
* @Given I disable Help center
*/
public function iDisableHelpCenter(): void
{
$this->userSettingsPage->openBrowsingEditionPage();
$this->userSettingsPage->verifyIsLoaded();
$this->userSettingsPage->disableHelpCenter();
}
}
20 changes: 19 additions & 1 deletion src/lib/Behat/Page/UserSettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(Session $session, Router $router, ContentActionsMenu
public function verifyIsLoaded(): void
{
$pageHeaderText = $this->getHTMLPage()->find($this->getLocator('title'))->getText();
Assert::AssertContains($pageHeaderText, ['User settings', 'Content authoring']);
Assert::AssertContains($pageHeaderText, ['User settings', 'Content authoring', 'Browsing']);
}

public function switchTab(string $tabName): void
Expand All @@ -60,6 +60,7 @@ protected function specifyLocators(): array
new VisibleCSSLocator('title', '.ibexa-edit-header__title,.ibexa-page-title__content'),
new VisibleCSSLocator('autosaveDraftValueDropdown', '#user_setting_update_autosave div.ibexa-dropdown__wrapper > ul'),
new VisibleCSSLocator('autosaveIntervalEdit', '#user_setting_update_autosave_interval_value'),
new VisibleCSSLocator('helpCenterValueDropdown', '#user_setting_update_help_center div.ibexa-dropdown__wrapper > ul'),
];
}

Expand Down Expand Up @@ -94,4 +95,21 @@ public function getName(): string
{
return 'User settings';
}

public function openBrowsingEditionPage(): void
{
$this->getHTMLPage()
->findAll(new VisibleCSSLocator('settingsSection', '#ibexa-tab-my-preferences .ibexa-details'))
->getByCriterion(new ChildElementTextCriterion(new VisibleCSSLocator('settingHeader', '.ibexa-table-header__headline'), 'Browsing'))
->find(new VisibleCSSLocator('editButton', ' .ibexa-btn__label'))
->assert()->textEquals('Edit')
->click();
}

public function disableHelpCenter(): void
{
$this->contentActionsMenu->verifyIsLoaded();
$this->getHTMLPage()->find($this->getLocator('helpCenterValueDropdown'))->click();
$this->ibexaDropdown->selectOption('Disabled');
}
}
Loading