[TASK] Stabilize acceptance tests
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / Extensionmanager / GetExtensionsCest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Extensionmanager;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use Facebook\WebDriver\WebDriverKeys;
18 use TYPO3\TestingFramework\Core\Acceptance\Step\Backend\Admin;
19
20 /**
21 * Tests for the "Get Extensions view" of the extension manager
22 */
23 class GetExtensionsCest
24 {
25 /**
26 * @param Admin $I
27 */
28 public function _before(Admin $I)
29 {
30 $I->useExistingSession();
31
32 $I->click('Extensions', '#menu');
33 $I->switchToContentFrame();
34 $I->waitForElementVisible('#typo3-extension-list');
35
36 $I->selectOption('[name="ExtensionManagerModuleMenu"]', 'Get Extensions');
37 $I->waitForElementVisible('#terTable_wrapper');
38
39 // We expect exact two extensions created from the Fixtures
40 $I->seeNumberOfElements('#terTable tbody tr', 2);
41 }
42
43 /**
44 * @param Admin $I
45 */
46 public function checkRetrievedExtensionsFromTerAreDisplayed(Admin $I)
47 {
48 $I->see('superext');
49 $I->see('neededext');
50 }
51
52 /**
53 * @param Admin $I
54 */
55 public function checkPageBrowserDisplaysTwoRecords(Admin $I)
56 {
57 $I->seeElement('.pagination-wrap');
58 $I->see('Records 1 - 2');
59 }
60
61 /**
62 * @param Admin $I
63 */
64 public function checkSearchFilterListFindsExtensionKey(Admin $I)
65 {
66 $I->fillField('input[name="tx_extensionmanager_tools_extensionmanagerextensionmanager[search]"]', 'superext');
67 $I->click('Go');
68 // @todo do something about the double loading of the table, it is rendered twice (not double, but once, then retrieve extension list loader, then second time)
69 $I->waitForElementVisible('#terSearchTable');
70 $I->wait(3);
71 $I->waitForElementNotVisible('#nprogess');
72 $I->seeNumberOfElements('#terSearchTable tbody tr', 1);
73 $I->see('Super Extension');
74
75 $I->amGoingTo('search extension neededext and submit with enter');
76
77 $I->fillField('input[name="tx_extensionmanager_tools_extensionmanagerextensionmanager[search]"]', 'neededext');
78 $I->pressKey('input[name="tx_extensionmanager_tools_extensionmanagerextensionmanager[search]"]', WebDriverKeys::ENTER);
79 $I->waitForElementVisible('#terSearchTable');
80 $I->wait(3);
81 $I->waitForElementNotVisible('div#nprogess');
82 $I->seeNumberOfElements('#terSearchTable tbody tr', 1);
83 $I->see('Needed Extension');
84 }
85
86 /**
87 * @param Admin $I
88 */
89 public function checkSearchFilterListFindsPartOfExtensionKey(Admin $I)
90 {
91 $I->fillField('input[name="tx_extensionmanager_tools_extensionmanagerextensionmanager[search]"]', 'ext');
92 $I->click('Go');
93 $I->waitForElementVisible('#terSearchTable');
94 $I->seeNumberOfElements('#terSearchTable tbody tr', 2);
95 $I->wait(3);
96 $I->waitForElementNotVisible('div#nprogess');
97 $I->see('Super Extension');
98 $I->see('Needed Extension');
99 }
100 }