ModuleMenuButtonCest.php 3.21 KB
Newer Older
1
<?php
2

3
declare(strict_types=1);
4
5
6
7
8
9
10
11
12
13
14
15
16
17

/*
 * This file is part of the TYPO3 CMS project.
 *
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 * The TYPO3 project - inspiring people to share!
 */

18
namespace TYPO3\CMS\Core\Tests\Acceptance\Application\Topbar;
19

20
use TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester;
21
22
23
24
25
26

/**
 * Acceptance test for the menu button in the topbar
 */
class ModuleMenuButtonCest
{
27
    public function _before(ApplicationTester $I): void
28
    {
Davert's avatar
Davert committed
29
        $I->useExistingSession('admin');
30
31
    }

32
    public function checkModelMenuButtonFromBigToSmallScreen(ApplicationTester $I): void
33
34
35
36
    {
        $I->wantTo('see the module menu button behavior when shrinking the window');

        $I->seeElement('.scaffold-modulemenu-expanded');
37
        $I->seeElement('.modulemenu-indicator');
38
        $I->seeElement('.modulemenu-icon');
39
40

        $I->amGoingTo('collapse the module menu');
41
        $I->click('button.t3js-topbar-button-modulemenu span[data-identifier="actions-menu"]');
42
43
44

        $I->expectTo('see only the module menu icon');
        $I->cantSeeElement('.scaffold-modulemenu-expanded');
45
        $I->cantSeeElement('.modulemenu-indicator');
46
        $I->seeElement('.modulemenu-icon');
47
48
49
50

        $I->amGoingTo('shrink the window');
        $I->resizeWindow(680, 420);
        $I->expectTo('see no module menu');
51
        $I->cantSeeElement('.modulemenu-icon');
52
53

        $I->amGoingTo('expand the module menu');
54
        $I->click('button.t3js-topbar-button-modulemenu span[data-identifier="actions-menu"]');
55
        $I->expectTo('see the expanded module menu');
56
        $I->seeElement('.modulemenu-indicator');
57
        $I->seeElement('.modulemenu-icon');
58
59
    }

60
    public function checkModelMenuButtonFromSmallToBigScreen(ApplicationTester $I): void
61
62
63
64
65
66
67
    {
        $I->wantTo('see the module menu button behavior when enlarging the window');

        $I->amGoingTo('shrink the window');
        $I->resizeWindow(320, 400);
        $I->expectTo('see the module menu');
        $I->seeElement('.scaffold-modulemenu-expanded');
68
        $I->seeElement('.modulemenu-indicator');
69
        $I->seeElement('.modulemenu-icon');
70
71

        $I->amGoingTo('collapse the module menu');
72
        $I->click('button.t3js-topbar-button-modulemenu span[data-identifier="actions-menu"]');
73
74
75

        $I->expectTo('see no module menu');
        $I->cantSeeElement('.scaffold-modulemenu-expanded');
76
        $I->cantSeeElement('.modulemenu-indicator');
77
        $I->cantSeeElement('.modulemenu-icon');
78
79
80
81

        $I->amGoingTo('enlarge the window');
        $I->resizeWindow(1280, 960);
        $I->expectTo('see the module menu icon');
82
        $I->seeElement('.modulemenu-icon');
83
84

        $I->amGoingTo('expand the module menu');
85
        $I->click('button.t3js-topbar-button-modulemenu span[data-identifier="actions-menu"]');
86
87
88

        $I->expectTo('see the full module menu');
        $I->seeElement('.scaffold-modulemenu-expanded');
89
90
        $I->seeElement('.modulemenu-indicator');
        $I->seeElement('.modulemenu-icon');
91
92
    }
}