‪TYPO3CMS  11.5
FileClipboardCest.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 
22 
27 {
28  protected string ‪$copyModeCopy = '#clipboard-copymode-copy';
29  protected string ‪$copyModeMove = '#clipboard-copymode-move';
30 
34  public function ‪_before(‪ApplicationTester $I, ‪FileTree $tree): void
35  {
36  parent::_before($I, $tree);
37  $I->click('#checkClipBoard');
38  $I->waitForElement($this->copyModeMove);
39  $I->waitForElementVisible($this->copyModeMove);
40  $I->waitForElementVisible($this->copyModeCopy);
41  }
42 
46  public function ‪_after(‪ApplicationTester $I): void
47  {
48  $I->click('#checkClipBoard');
49  }
50 
54  public function ‪seeSwitchModes(‪ApplicationTester $I): void
55  {
56  $I->seeCheckboxIsChecked($this->copyModeMove);
57  $I->dontSeeCheckboxIsChecked($this->copyModeCopy);
58  $I->click('//*/label[@for="clipboard-copymode-copy"]');
59  $I->waitForElementVisible($this->copyModeMove);
60  $I->dontSeeCheckboxIsChecked($this->copyModeMove);
61  $I->waitForElementVisible($this->copyModeCopy);
62  $I->seeCheckboxIsChecked($this->copyModeCopy);
63  $I->click('//*/label[@for="clipboard-copymode-move"]');
64  $I->waitForElementVisible($this->copyModeMove);
65  $I->seeCheckboxIsChecked($this->copyModeMove);
66  $I->waitForElementVisible($this->copyModeCopy);
67  $I->dontSeeCheckboxIsChecked($this->copyModeCopy);
68  }
69 
74  {
75  $I->seeCheckboxIsChecked($this->copyModeMove);
76  $fileName = 'bus_lane.jpg';
77  $I->switchToMainFrame();
78  $I->click('//*[text()="styleguide"]');
79  $I->click('.scaffold-content-navigation-switcher-close');
80  $I->switchToContentFrame();
81  $this->‪openActionDropdown($I, $fileName)->click();
82  $I->click('Cut');
83  $I->see($fileName, '.clipboard-panel a');
84  $I->click('Remove item', '.clipboard-panel');
85  $I->dontSee($fileName, '.clipboard-panel a');
86  }
87 
92  {
93  $expectedFiles = ['bus_lane.jpg', 'telephone_box.jpg', 'underground.jpg'];
94 
95  $I->switchToMainFrame();
96  $I->click('//*[text()="styleguide"]');
97  $I->click('.scaffold-content-navigation-switcher-close');
98  $I->switchToContentFrame();
99 
100  $I->amGoingTo('add multiple elements to clipboard');
101  $I->wait(1);
102  $I->click('Clipboard #1 (multi-selection mode)');
103  $I->click('.dropdown-toggle');
104  $I->click('button[data-multi-record-selection-check-action="check-all"]');
105  $I->click('button[data-multi-record-selection-action="copyMarked"]');
106 
107  foreach ($expectedFiles as $file) {
108  $I->see($file, '.clipboard-panel');
109  }
110 
111  $I->amGoingTo('remove all elements from clipboard');
112  $I->click('Remove all', '.clipboard-panel');
113 
114  foreach ($expectedFiles as $file) {
115  $I->dontSee($file, '.clipboard-panel');
116  }
117  }
118 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\FileClipboardCest\_after
‪_after(ApplicationTester $I)
Definition: FileClipboardCest.php:46
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\FileClipboardCest\seeAddRemoveSingleRecord
‪seeAddRemoveSingleRecord(ApplicationTester $I)
Definition: FileClipboardCest.php:73
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\FileClipboardCest\$copyModeCopy
‪string $copyModeCopy
Definition: FileClipboardCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\FileClipboardCest\seeSwitchModes
‪seeSwitchModes(ApplicationTester $I)
Definition: FileClipboardCest.php:54
‪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\FileClipboardCest
Definition: FileClipboardCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\FileClipboardCest\$copyModeMove
‪string $copyModeMove
Definition: FileClipboardCest.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\FileTree
Definition: FileTree.php:24
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\FileClipboardCest\_before
‪_before(ApplicationTester $I, FileTree $tree)
Definition: FileClipboardCest.php:34
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\FileClipboardCest\seeAddRemoveMultipleRecords
‪seeAddRemoveMultipleRecords(ApplicationTester $I)
Definition: FileClipboardCest.php:91
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FileList\AbstractFileCest
Definition: AbstractFileCest.php:29