‪TYPO3CMS  ‪main
FileCest.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 
27 final class ‪FileCest
28 {
29  private static string ‪$filenameSelector = '.form-irre-header-body > span > dl.row:first-child > dd.col';
30  private static string ‪$saveButtonLink = '//*/button[@name="_savedok"][1]';
31 
35  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
36  {
37  $I->useExistingSession('admin');
38 
39  $I->click('List');
40  $pageTree->‪openPath(['styleguide TCA demo', 'file']);
41  $I->switchToContentFrame();
42 
43  $I->waitForText('file', 20);
44  $editRecordLinkCssPath = '#recordlist-tx_styleguide_file a[aria-label="Edit record"]';
45  $I->click($editRecordLinkCssPath);
46  $I->waitForText('Edit Form', 3, 'h1');
47  }
48 
49  public function ‪seeFalRelationInfo(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
50  {
51  $infoButtonSelector = '.tab-content button[data-action="infowindow"]';
52 
53  $filename = $I->grabTextFrom(self::$filenameSelector);
54  $I->click($infoButtonSelector);
55  $modalDialog->‪canSeeDialog();
56  $I->switchToIFrame('.modal-iframe');
57  $modalTitle = $I->grabTextFrom('.card-title');
58  $I->assertStringContainsString($filename, $modalTitle);
59  }
60 
61  public function ‪hideFalRelation(‪ApplicationTester $I): void
62  {
63  $hideButtonSelector = '.tab-content .t3js-toggle-visibility-button';
64 
65  $I->click($hideButtonSelector);
66  $I->click(self::$saveButtonLink);
67  $I->seeElement('.tab-content .t3-form-field-container-inline-hidden');
68  }
69 
70  public function ‪deleteFalRelation(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
71  {
72  $deleteButtonSelector = '.tab-content .t3js-editform-delete-file-reference';
73  $filename = $I->grabTextFrom(self::$filenameSelector);
74 
75  $I->click($deleteButtonSelector);
76  $modalDialog->‪canSeeDialog();
77  $I->click('button[name="yes"]', ‪ModalDialog::$openedModalButtonContainerSelector);
78  $I->switchToContentFrame();
79  $I->click(self::$saveButtonLink);
80  $I->dontSee($filename, '.tab-content .form-section:first-child');
81  }
82 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\FileCest\hideFalRelation
‪hideFalRelation(ApplicationTester $I)
Definition: FileCest.php:61
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\FileCest
Definition: FileCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine
Definition: AbstractElementsBasicCest.php:18
‪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\FormEngine\FileCest\seeFalRelationInfo
‪seeFalRelationInfo(ApplicationTester $I, ModalDialog $modalDialog)
Definition: FileCest.php:49
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\AbstractTree\openPath
‪openPath(array $path)
Definition: AbstractTree.php:55
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\FileCest\$filenameSelector
‪static string $filenameSelector
Definition: FileCest.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\FileCest\deleteFalRelation
‪deleteFalRelation(ApplicationTester $I, ModalDialog $modalDialog)
Definition: FileCest.php:70
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:68
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\FileCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: FileCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\FileCest\$saveButtonLink
‪static string $saveButtonLink
Definition: FileCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:24