-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Fix flushVisibleEntries Acceptance Test (#1044)
- Loading branch information
1 parent
f515e8b
commit c2c702c
Showing
7 changed files
with
1,072 additions
and
1,423 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,86 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* (c) 2024- Tomas Norre Mikkelsen <[email protected]> | ||
* | ||
* This file is part of the TYPO3 Crawler Extension. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
/** | ||
* This is copied from | ||
* https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Tests/Acceptance/Support/Helper/ModalDialog.php | ||
*/ | ||
|
||
namespace AOE\Crawler\Tests\Acceptance\Support\Helper; | ||
|
||
use AcceptanceTester; | ||
use TYPO3\TestingFramework\Core\Acceptance\Helper\AbstractModalDialog; | ||
|
||
final class ModalDialog extends AbstractModalDialog | ||
{ | ||
/** | ||
* Selector for a visible modal window | ||
* Adapted for Boostrap 5 | ||
* | ||
* @var string | ||
*/ | ||
public static $openedModalSelector = '.modal.show'; | ||
|
||
/** | ||
* Selector for the container in the modal where the buttons are located | ||
* Adapted for Boostrap 5 | ||
* | ||
* @var string | ||
*/ | ||
public static $openedModalButtonContainerSelector = '.modal.show .modal-footer'; | ||
|
||
/** | ||
* @var AcceptanceTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Inject our core AcceptanceTester actor into ModalDialog | ||
*/ | ||
public function __construct(AcceptanceTester $I) | ||
{ | ||
$this->tester = $I; | ||
} | ||
|
||
/** | ||
* Perform a click on a link or a button, given by a locator. | ||
* | ||
* @param string $buttonLinkLocator the button title | ||
* @see \Codeception\Module\WebDriver::click() | ||
*/ | ||
public function clickButtonInDialog(string $buttonLinkLocator): void | ||
{ | ||
$I = $this->tester; | ||
$this->canSeeDialog(); | ||
$I->click($buttonLinkLocator, self::$openedModalButtonContainerSelector); | ||
$I->waitForElementNotVisible(self::$openedModalSelector); | ||
} | ||
|
||
/** | ||
* Check if modal dialog is visible in top frame | ||
*/ | ||
public function canSeeDialog(): void | ||
{ | ||
$I = $this->tester; | ||
$I->switchToIFrame(); | ||
$I->waitForElement(self::$openedModalSelector); | ||
// I will wait two seconds to prevent failing tests | ||
$I->wait(2); | ||
} | ||
} |
Oops, something went wrong.