-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDialog.php
More file actions
39 lines (32 loc) · 1.2 KB
/
Dialog.php
File metadata and controls
39 lines (32 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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\Component\Component;
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;
class Dialog extends Component
{
public function confirm(): void
{
$this->getHTMLPage()->find($this->getLocator('confirm'))->click();
}
public function decline(): void
{
$this->getHTMLPage()->find($this->getLocator('decline'))->click();
}
public function verifyIsLoaded(): void
{
$this->getHTMLPage()->setTimeout(3)->find($this->getLocator('confirm'))->assert()->isVisible();
$this->getHTMLPage()->find($this->getLocator('decline'))->assert()->isVisible();
}
protected function specifyLocators(): array
{
return [
new VisibleCSSLocator('confirm', '.modal.show button[type="submit"],.modal.show button[data-click], .modal.show .ibexa-btn--confirm, .modal.show .ibexa-btn--primary'),
new VisibleCSSLocator('decline', '.modal.show .ibexa-btn--secondary'),
];
}
}