‪TYPO3CMS  11.5
ModalDialog.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 use TYPO3\TestingFramework\Core\Acceptance\Helper\AbstractModalDialog;
22 
26 class ‪ModalDialog extends AbstractModalDialog
27 {
34  public static ‪$openedModalSelector = '.modal.show';
35 
42  public static ‪$openedModalButtonContainerSelector = '.modal.show .modal-footer';
43 
47  protected ‪$tester;
48 
54  public function ‪__construct(‪ApplicationTester $I)
55  {
56  $this->tester = $I;
57  }
58 
65  public function ‪clickButtonInDialog(string $buttonLinkLocator): void
66  {
67  $I = ‪$this->tester;
68  $this->‪canSeeDialog();
69  $I->click($buttonLinkLocator, self::$openedModalButtonContainerSelector);
70  $I->waitForElementNotVisible(self::$openedModalSelector);
71  }
72 
76  public function ‪canSeeDialog(): void
77  {
78  $I = ‪$this->tester;
79  $I->switchToIFrame();
80  $I->waitForElement(self::$openedModalSelector);
81  // I will wait two seconds to prevent failing tests
82  $I->wait(2);
83  }
84 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalSelector
‪static string $openedModalSelector
Definition: ModalDialog.php:33
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalButtonContainerSelector
‪static string $openedModalButtonContainerSelector
Definition: ModalDialog.php:40
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\__construct
‪__construct(ApplicationTester $I)
Definition: ModalDialog.php:51
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:73
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper
Definition: Config.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\clickButtonInDialog
‪clickButtonInDialog(string $buttonLinkLocator)
Definition: ModalDialog.php:62
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$tester
‪AcceptanceTester $tester
Definition: ModalDialog.php:44
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:27