‪TYPO3CMS  ‪main
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 
23 final class ‪ModalDialog extends AbstractModalDialog
24 {
31  public static ‪$openedModalSelector = '.modal.show';
32 
39  public static ‪$openedModalButtonContainerSelector = '.modal.show .modal-footer';
40 
44  protected ‪$tester;
45 
49  public function ‪__construct(‪ApplicationTester $I)
50  {
51  $this->tester = $I;
52  }
53 
60  public function ‪clickButtonInDialog(string $buttonLinkLocator): void
61  {
62  $I = ‪$this->tester;
63  $this->‪canSeeDialog();
64  $I->click($buttonLinkLocator, self::$openedModalButtonContainerSelector);
65  $I->waitForElementNotVisible(self::$openedModalSelector);
66  }
67 
71  public function ‪canSeeDialog(): void
72  {
73  $I = ‪$this->tester;
74  $I->switchToIFrame();
75  $I->waitForElement(self::$openedModalSelector);
76  // I will wait two seconds to prevent failing tests
77  $I->wait(2);
78  }
79 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalSelector
‪static string $openedModalSelector
Definition: ModalDialog.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalButtonContainerSelector
‪static string $openedModalButtonContainerSelector
Definition: ModalDialog.php:37
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$tester
‪ApplicationTester $tester
Definition: ModalDialog.php:41
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\__construct
‪__construct(ApplicationTester $I)
Definition: ModalDialog.php:46
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:68
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper
Definition: AbstractTree.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\clickButtonInDialog
‪clickButtonInDialog(string $buttonLinkLocator)
Definition: ModalDialog.php:57
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:24