‪TYPO3CMS  ‪main
WorkspaceModuleCest.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 use TYPO3\TestingFramework\Core\Acceptance\Helper\Topbar;
24 
26 {
27  private static string ‪$topBarModuleSelector = '#typo3-cms-workspaces-backend-toolbaritems-workspaceselectortoolbaritem';
28  private static string ‪$currentPageTitle = 'styleguide TCA demo';
29  private static string ‪$newPageTitle = 'styleguide TCA demo workspace';
30 
31  public function ‪_before(‪ApplicationTester $I): void
32  {
33  $I->useExistingSession('admin');
34  }
35 
36  public function ‪switchToWorkspace(‪ApplicationTester $I): void
37  {
38  $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
39  $I->waitForText('Test Workspace', 5, self::$topBarModuleSelector);
40  $I->click('Test Workspace', self::$topBarModuleSelector);
41  $I->waitForElement('.topbar-header.typo3-in-workspace');
42  $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
43  $I->waitForText('Test Workspace', 5, '#typo3-cms-workspaces-backend-toolbaritems-workspaceselectortoolbaritem .active');
44  }
45 
50  {
51  $I->click('Page');
52  $pageTree->‪openPath([self::$currentPageTitle]);
53 
54  $I->comment('Rename page');
55  $I->switchToContentFrame();
56 
57  $I->waitForElementVisible('typo3-backend-editable-page-title');
58  $I->wait(1);
59  $I->executeJS("document.querySelector('typo3-backend-editable-page-title').shadowRoot.querySelector('[data-action=\"edit\"]').click()");
60  $I->wait(1);
61  $I->executeJS("document.querySelector('typo3-backend-editable-page-title').shadowRoot.querySelector('input').value = '" . self::$newPageTitle . "'");
62  $I->wait(1);
63  $I->executeJS("document.querySelector('typo3-backend-editable-page-title').shadowRoot.querySelector('[data-action=\"save\"]').click()");
64  $I->wait(1);
65 
66  $I->switchToMainFrame();
67  $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
68  $I->canSee('Go to Workspace Module', self::$topBarModuleSelector);
69  $I->click('Go to Workspace Module', self::$topBarModuleSelector);
70 
71  $I->comment('See the new page title in Workspace module');
72  $I->switchToContentFrame();
73  $I->see(self::$newPageTitle, '#workspace-panel');
74  }
75 
79  public function ‪chooseMassActionPublish(‪ApplicationTester $I, ‪ModalDialog $modalDialog): void
80  {
81  $I->click('Workspaces');
82  $I->switchToContentFrame();
83  $I->waitForElementVisible('select[name=mass-action]');
84  $I->selectOption('select[name=mass-action]', 'Publish');
85 
86  $modalDialog->‪canSeeDialog();
87  $modalDialog->‪clickButtonInDialog('Publish');
88 
89  $I->dontSee(self::$newPageTitle, '#workspace-panel');
90  }
91 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace\WorkspaceModuleCest\$topBarModuleSelector
‪static string $topBarModuleSelector
Definition: WorkspaceModuleCest.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace\WorkspaceModuleCest\switchToWorkspace
‪switchToWorkspace(ApplicationTester $I)
Definition: WorkspaceModuleCest.php:36
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace\WorkspaceModuleCest\$currentPageTitle
‪static string $currentPageTitle
Definition: WorkspaceModuleCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\AbstractTree\openPath
‪openPath(array $path)
Definition: AbstractTree.php:55
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace\WorkspaceModuleCest\editPageTitleAndSeeChangeInWorkspaceModule
‪editPageTitleAndSeeChangeInWorkspaceModule(ApplicationTester $I, PageTree $pageTree)
Definition: WorkspaceModuleCest.php:49
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace
Definition: WorkspaceModuleCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace\WorkspaceModuleCest\chooseMassActionPublish
‪chooseMassActionPublish(ApplicationTester $I, ModalDialog $modalDialog)
Definition: WorkspaceModuleCest.php:79
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace\WorkspaceModuleCest\$newPageTitle
‪static string $newPageTitle
Definition: WorkspaceModuleCest.php:29
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\canSeeDialog
‪canSeeDialog()
Definition: ModalDialog.php:68
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace\WorkspaceModuleCest\_before
‪_before(ApplicationTester $I)
Definition: WorkspaceModuleCest.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog\clickButtonInDialog
‪clickButtonInDialog(string $buttonLinkLocator)
Definition: ModalDialog.php:57
‪TYPO3\CMS\Core\Tests\Acceptance\Application\Workspace\WorkspaceModuleCest
Definition: WorkspaceModuleCest.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\ModalDialog
Definition: ModalDialog.php:24