InstalledExtensionsCest.php 3.4 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
19
namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Extensionmanager;

Davert's avatar
Davert committed
20
use TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester;
21
22
23
24
25
26
27

/**
 * Tests for the "Install list view" of the extension manager
 */
class InstalledExtensionsCest
{
    /**
Davert's avatar
Davert committed
28
     * @param BackendTester $I
29
     */
Davert's avatar
Davert committed
30
    public function _before(BackendTester $I)
31
    {
Davert's avatar
Davert committed
32
        $I->useExistingSession('admin');
33

34
        $I->click('Extensions', '#modulemenu');
35
        $I->switchToContentFrame();
36
37
38
39
        $I->waitForElementVisible('#typo3-extension-list');
    }

    /**
Davert's avatar
Davert committed
40
     * @param BackendTester $I
41
     */
Davert's avatar
Davert committed
42
    public function checkSearchFiltersList(BackendTester $I)
43
    {
44
        $I->seeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', [10, 100]);
45
46

        // Fill extension search field
47
        $I->fillField('Tx_Extensionmanager_extensionkey', 'backend');
48
        $I->waitForElementNotVisible('tr#core');
49
50

        // see 2 rows. 1 for the header and one for the result
51
        $I->seeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', 3);
52
53

        // Look for extension key
54
        $I->see('backend', '#typo3-extension-list tbody tr[role="row"] td');
55
56

        // unset the filter
57
        $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 10);
58
        $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
59
60
        $I->wait(1);
        $I->seeNumberOfElements('#typo3-extension-list tbody tr[role="row"]', [10, 100]);
61
62
63
    }

    /**
Davert's avatar
Davert committed
64
     * @param BackendTester $I
65
     */
Davert's avatar
Davert committed
66
    public function checkIfUploadFormAppears(BackendTester $I)
67
    {
68
        $I->cantSeeElement('.module-body .extension-upload-form');
69
        $I->click('a[title="Upload Extension .t3x/.zip"]', '.module-docheader');
70
        $I->seeElement('.module-body .extension-upload-form');
71
72
73
    }

    /**
Davert's avatar
Davert committed
74
     * @param BackendTester $I
75
     */
Davert's avatar
Davert committed
76
    public function checkUninstallingAndInstallingAnExtension(BackendTester $I)
77
    {
78
79
        $I->wantTo('Check if uninstalling and installing an extension with backend module removes and adds the module from the module menu.');
        $I->amGoingTo('uninstall extension belog');
80
81
        $I->switchToMainFrame();
        $I->seeElement('#system_BelogLog');
82

83
        $I->switchToContentFrame();
84
        $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
85
        $I->click('a[data-bs-original-title="Deactivate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
86

87
        $I->switchToMainFrame();
88
        $I->cantSeeElement('#system_BelogLog');
89

90
        $I->amGoingTo('install extension belog');
91
        $I->switchToMainFrame();
92
        $I->seeElement('.modulemenu-action');
93
        $I->cantSeeElement('#system_BelogLog');
94

95
        $I->switchToContentFrame();
96
        $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
97
        $I->click('a[data-bs-original-title="Activate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="belog"]');
98

99
100
        $I->switchToMainFrame();
        $I->seeElement('#system_BelogLog');
101
102
    }
}