‪TYPO3CMS  11.5
AbstractFileCest.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 
20 use Facebook\WebDriver\Remote\RemoteWebDriver;
21 use Facebook\WebDriver\Remote\RemoteWebElement;
24 
28 abstract class ‪AbstractFileCest
29 {
33  public function ‪_before(‪ApplicationTester $I, ‪FileTree $tree): void
34  {
35  $I->useExistingSession('admin');
36  $I->amOnPage('/typo3/module/file/FilelistList');
37  $I->switchToContentFrame();
38  }
39 
45  protected function ‪uploadFile(‪ApplicationTester $I, string $name): void
46  {
47  $I->attachFile('input.upload-file-picker', 'Acceptance/Fixtures/Images/' . $name);
48  $I->waitForElementNotVisible('.upload-queue-item .upload-queue-progress');
49  }
50 
56  protected function ‪openActionDropdown(‪ApplicationTester $I, string $title): RemoteWebElement
57  {
58  $I->comment('Get open action dropdown "' . $title . '"');
59  return $I->executeInSelenium(
60  static function (RemoteWebDriver $webDriver) use ($title) {
61  return $webDriver->findElement(
62  \Facebook\WebDriver\WebDriverBy::xpath(
63  '//a[contains(text(),"' . $title . '")]/parent::node()/parent::node()//a[contains(@href, "#actions_") and contains(@data-bs-toggle, "dropdown")]'
64  )
65  );
66  }
67  );
68  }
69 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\AbstractFileCest\openActionDropdown
‪RemoteWebElement openActionDropdown(ApplicationTester $I, string $title)
Definition: AbstractFileCest.php:56
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList
Definition: AbstractFileCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\AbstractFileCest\uploadFile
‪uploadFile(ApplicationTester $I, string $name)
Definition: AbstractFileCest.php:45
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\FileTree
Definition: FileTree.php:24
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\AbstractFileCest\_before
‪_before(ApplicationTester $I, FileTree $tree)
Definition: AbstractFileCest.php:33
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\AbstractFileCest
Definition: AbstractFileCest.php:29