‪TYPO3CMS  ‪main
ViewModuleCest.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 
23 final class ‪ViewModuleCest
24 {
25  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
26  {
27  $I->useExistingSession('admin');
28  $I->switchToMainFrame();
29  $I->click('View');
30  $pageTree->‪openPath(['styleguide frontend demo']);
31  $I->switchToContentFrame();
32  }
33 
35  {
36  $I->wait(1);
37  $I->waitForElementVisible('#tx_viewpage_iframe');
38  $I->wait(1);
39  $I->switchToIFrame('#tx_viewpage_iframe');
40  $I->wait(1);
41  $I->waitForText('TYPO3 Styleguide Frontend', 20);
42  $I->see('TYPO3 Styleguide Frontend');
43  $I->see('This is the generated frontend for the Styleguide Extension.');
44  }
45 
47  {
48  $I->waitForElementVisible('#viewpage-topbar-preset-button');
49  $I->waitForElementNotVisible('#nprogress', 120);
50  $I->click('#viewpage-topbar-preset-button');
51  $I->waitForText('Nexus 7');
52  $I->click('Nexus 7');
53  $width = $I->grabValueFrom('input[name="width"]');
54  $height = $I->grabValueFrom('input[name="height"]');
55  $I->assertEquals($width, 600);
56  $I->assertEquals($height, 960);
57 
58  $I->waitForElementVisible('#viewpage-topbar-preset-button');
59  $I->click('#viewpage-topbar-preset-button');
60  $I->waitForText('iPhone 4');
61  $I->click('iPhone 4');
62  $width = $I->grabValueFrom('input[name="width"]');
63  $height = $I->grabValueFrom('input[name="height"]');
64  $I->assertEquals($width, 320);
65  $I->assertEquals($height, 480);
66  }
67 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\View\ViewModuleCest\CheckChangingPreviewWindowSize
‪CheckChangingPreviewWindowSize(ApplicationTester $I)
Definition: ViewModuleCest.php:46
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\View
Definition: ViewModuleCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\AbstractTree\openPath
‪openPath(array $path)
Definition: AbstractTree.php:55
‪TYPO3\CMS\Core\Tests\Acceptance\Application\View\ViewModuleCest
Definition: ViewModuleCest.php:24
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:26
‪TYPO3\CMS\Core\Tests\Acceptance\Application\View\ViewModuleCest\CheckPagePreviewInBackend
‪CheckPagePreviewInBackend(ApplicationTester $I)
Definition: ViewModuleCest.php:34
‪TYPO3\CMS\Core\Tests\Acceptance\Application\View\ViewModuleCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: ViewModuleCest.php:25