‪TYPO3CMS  ‪main
RecordDownloadCest.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 
23 
28 {
29  public function ‪_before(‪ApplicationTester $I): void
30  {
31  $I->useExistingSession('admin');
32  }
33 
34  public function ‪recordsCanBeExported(‪ApplicationTester $I, ‪PageTree $pageTree, ‪ModalDialog $modalDialog): void
35  {
36  $I->wantToTest('whether records can be downloaded in the recordlist');
37 
38  $I->amGoingTo('download a record');
39  $I->click('List');
40  $I->waitForElementNotVisible('#nprogress');
41  $pageTree->‪openPath(['styleguide TCA demo']);
42  $I->wait(0.2);
43  $I->switchToContentFrame();
44  $I->canSee('Download');
45  $I->click('typo3-recordlist-record-download-button');
46  $modalDialog->‪canSeeDialog();
47  $I->canSee('Download Page:', ‪ModalDialog::$openedModalSelector . ' .modal-title');
48  $I->fillField(‪ModalDialog::$openedModalSelector . ' input[name="filename"]', 'test-download');
49  $I->canSee('CSV options', ‪ModalDialog::$openedModalSelector . ' .modal-body h2');
50  $I->selectOption(‪ModalDialog::$openedModalSelector . ' select[name="format"]', 'json');
51  $I->dontSee('CSV options', ‪ModalDialog::$openedModalSelector . ' .modal-body h2');
52  $I->see('JSON options', ‪ModalDialog::$openedModalSelector . ' .modal-body h2');
53  $I->selectOption(‪ModalDialog::$openedModalSelector . ' select[name="json[meta]"]', 'full');
54  $I->click('button[name="download"]', ‪ModalDialog::$openedModalButtonContainerSelector);
55  $I->waitForElementNotVisible(‪ModalDialog::$openedModalSelector, 30);
56  }
57 }
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\$openedModalSelector
‪static string $openedModalSelector
Definition: ModalDialog.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Application\RecordList\RecordDownloadCest\_before
‪_before(ApplicationTester $I)
Definition: RecordDownloadCest.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Application\RecordList\RecordDownloadCest\recordsCanBeExported
‪recordsCanBeExported(ApplicationTester $I, PageTree $pageTree, ModalDialog $modalDialog)
Definition: RecordDownloadCest.php:34
‪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\Application\RecordList
Definition: RecordDownloadCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\AbstractTree\openPath
‪openPath(array $path)
Definition: AbstractTree.php:55
‪TYPO3\CMS\Core\Tests\Acceptance\Application\RecordList\RecordDownloadCest
Definition: RecordDownloadCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:68
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:24