‪TYPO3CMS  ‪main
NullPlaceholderCest.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 {
31  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
32  {
33  $I->useExistingSession('admin');
34  $this->‪goToListModule($I, $pageTree);
35  }
36 
41  {
42  $I->amGoingTo('Check if deactivating null checkboxes marks as "changed"');
43 
44  $editRecordLinkCssPath = '#recordlist-tx_styleguide_file a[aria-label="Edit record"]';
45  $I->click($editRecordLinkCssPath);
46 
47  $I->waitForElementNotVisible('#t3js-ui-block');
48  $I->waitForText('Edit Form engine - file "1" on page "file"');
49  $I->click('typical fal');
50  $I->click('.form-irre-header');
51  $I->waitForElementNotVisible('.nprogress-custom-parent');
52 
53  $I->amGoingTo('enable checkboxes and see whether the fields get marked as changed');
54  foreach (['title', 'alternative', 'description'] as $fieldName) {
55  $currentCheckboxSelector = '//input[contains(@name, "[' . $fieldName . ']") and @type="checkbox" and contains(@name, "control[active][sys_file_reference]")]';
56  $I->checkOption($currentCheckboxSelector);
57  $I->seeElement($currentCheckboxSelector . '/./ancestor::div[contains(concat(\' \', @class, \' \'), \'has-change\')]');
58 
59  // Remove focus from field, otherwise codeception can't find other checkboxes
60  $I->click('.form-irre-object .form-section');
61  }
62  }
63 
67  private function ‪goToListModule(‪ApplicationTester $I, ‪PageTree $pageTree): void
68  {
69  $I->switchToMainFrame();
70  $I->click('List');
71  $pageTree->‪openPath(['styleguide TCA demo', 'file']);
72  $I->switchToContentFrame();
73  $I->waitForText('file');
74  }
75 }
‪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\Application\FormEngine\NullPlaceholderCest\goToListModule
‪goToListModule(ApplicationTester $I, PageTree $pageTree)
Definition: NullPlaceholderCest.php:67
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\AbstractTree\openPath
‪openPath(array $path)
Definition: AbstractTree.php:55
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\NullPlaceholderCest\checkIfDeactivatingNullCheckboxesMarksAsChanged
‪checkIfDeactivatingNullCheckboxesMarksAsChanged(ApplicationTester $I)
Definition: NullPlaceholderCest.php:40
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\NullPlaceholderCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: NullPlaceholderCest.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\NullPlaceholderCest
Definition: NullPlaceholderCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:26