Skip to content

Commit 40fc107

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/IBX-10529-disable-help-for-regression' into IBX-10533
2 parents 79280d5 + 7a7f005 commit 40fc107

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/lib/Behat/BrowserContext/UserPreferencesContext.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,14 @@ public function iSetAutosaveDraftValue(): void
5959
$this->userSettingsPage->verifyIsLoaded();
6060
$this->userSettingsPage->disableAutosave();
6161
}
62+
63+
/**
64+
* @Given I disable Help center
65+
*/
66+
public function iDisableHelpCenter(): void
67+
{
68+
$this->userSettingsPage->openBrowsingEditionPage();
69+
$this->userSettingsPage->verifyIsLoaded();
70+
$this->userSettingsPage->disableHelpCenter();
71+
}
6272
}

src/lib/Behat/Page/UserSettingsPage.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(Session $session, Router $router, ContentActionsMenu
3737
public function verifyIsLoaded(): void
3838
{
3939
$pageHeaderText = $this->getHTMLPage()->find($this->getLocator('title'))->getText();
40-
Assert::AssertContains($pageHeaderText, ['User settings', 'Content authoring']);
40+
Assert::AssertContains($pageHeaderText, ['User settings', 'Content authoring', 'Browsing']);
4141
}
4242

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

@@ -94,4 +95,21 @@ public function getName(): string
9495
{
9596
return 'User settings';
9697
}
98+
99+
public function openBrowsingEditionPage(): void
100+
{
101+
$this->getHTMLPage()
102+
->findAll(new VisibleCSSLocator('settingsSection', '#ibexa-tab-my-preferences .ibexa-details'))
103+
->getByCriterion(new ChildElementTextCriterion(new VisibleCSSLocator('settingHeader', '.ibexa-table-header__headline'), 'Browsing'))
104+
->find(new VisibleCSSLocator('editButton', ' .ibexa-btn__label'))
105+
->assert()->textEquals('Edit')
106+
->click();
107+
}
108+
109+
public function disableHelpCenter(): void
110+
{
111+
$this->contentActionsMenu->verifyIsLoaded();
112+
$this->getHTMLPage()->find($this->getLocator('helpCenterValueDropdown'))->click();
113+
$this->ibexaDropdown->selectOption('Disabled');
114+
}
97115
}

0 commit comments

Comments
 (0)