-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace Ibexa\AdminUi\Behat\Page; | ||
|
||
use Behat\Mink\Session; | ||
use Ibexa\AdminUi\Behat\Component\ContentActionsMenu; | ||
use Ibexa\AdminUi\Behat\Component\TableNavigationTab; | ||
use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion; | ||
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator; | ||
use Ibexa\Behat\Browser\Page\Page; | ||
use Ibexa\Behat\Browser\Routing\Router; | ||
|
||
class UserSettingsPage extends Page | ||
{ | ||
private ContentActionsMenu $contentActionsMenu; | ||
|
||
private TableNavigationTab $tableNavigationTab; | ||
|
||
public function __construct(Session $session, Router $router, ContentActionsMenu $contentActionsMenu, TableNavigationTab $tableNavigationTab) | ||
{ | ||
parent::__construct($session, $router); | ||
$this->contentActionsMenu = $contentActionsMenu; | ||
$this->tableNavigationTab = $tableNavigationTab; | ||
} | ||
|
||
public function verifyIsLoaded(): void | ||
{ | ||
$this->contentActionsMenu->verifyIsLoaded(); | ||
$this->getHTMLPage()->find($this->getLocator('title'))->assert()->textEquals('User Settings'); | ||
} | ||
|
||
public function switchTab(string $tabName): void | ||
{ | ||
$this->tableNavigationTab->goToTab($tabName); | ||
} | ||
|
||
public function changePassword(): void | ||
{ | ||
$this->getHTMLPage() | ||
->findAll($this->getLocator('button')) | ||
->getByCriterion(new ElementTextCriterion('Change password')) | ||
->click(); | ||
} | ||
|
||
protected function specifyLocators(): array | ||
{ | ||
return [ | ||
new VisibleCSSLocator('button', '.ibexa-btn'), | ||
]; | ||
} | ||
|
||
protected function getRoute(): string | ||
{ | ||
return '/user/settings/list'; | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return 'User Settings'; | ||
} | ||
} |