‪TYPO3CMS  ‪main
ElementsBasicPasswordCest.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 Codeception\Attribute\DataProvider;
21 use Codeception\Example;
24 
29 {
33  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
34  {
35  $I->useExistingSession('admin');
36  $I->click('List');
37  $pageTree->‪openPath(['styleguide TCA demo', 'elements basic']);
38  $I->switchToContentFrame();
39 
40  // Open record and wait until form is ready
41  $I->waitForText('elements basic', 20);
42  $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_basic a[aria-label="Edit record"]';
43  $I->click($editRecordLinkCssPath);
44  $I->waitForElementNotVisible('#t3js-ui-block');
45  $I->waitForText('Edit Form', 3, 'h1');
46  $I->click('password');
47  }
48 
52  private function ‪passwordInputFieldsDataProvider(): array
53  {
54  // @todo
55  // + server-side password obfuscation value is `*********` (9 chars)
56  // + client-side password obfuscation value is `********` (8 chars)
57  return [
58  // @todo add other password field variants
59  [
60  'label' => 'password_2',
61  'inputValue' => 'Kasper',
62  'expectedValue' => '********',
63  'expectedInternalValue' => 'Kasper',
64  // even if `password_2` is not hashed, it never should expose the value
65  'expectedValueAfterSave' => '*********',
66  'comment' => '',
67  ],
68  ];
69  }
70 
71  #[DataProvider('passwordInputFieldsDataProvider')]
72  public function ‪passwordInputFields(‪ApplicationTester $I, Example $testData): void
73  {
74  $this->‪runInputFieldTest($I, $testData);
75  }
76 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine
Definition: AbstractElementsBasicCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicPasswordCest\passwordInputFieldsDataProvider
‪passwordInputFieldsDataProvider()
Definition: ElementsBasicPasswordCest.php:52
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicPasswordCest\passwordInputFields
‪passwordInputFields(ApplicationTester $I, Example $testData)
Definition: ElementsBasicPasswordCest.php:72
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicPasswordCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: ElementsBasicPasswordCest.php:33
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicPasswordCest
Definition: ElementsBasicPasswordCest.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\AbstractTree\openPath
‪openPath(array $path)
Definition: AbstractTree.php:55
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\AbstractElementsBasicCest\runInputFieldTest
‪runInputFieldTest(ApplicationTester $I, Example $testData)
Definition: AbstractElementsBasicCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\AbstractElementsBasicCest
Definition: AbstractElementsBasicCest.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:26