[TASK] Make failing acceptance tests after image update run again
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Acceptance / Backend / Install / InstallModuleCest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Language;
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 TYPO3\TestingFramework\Core\Acceptance\Step\Backend\Admin;
18
19 /**
20 * Install Module tests
21 */
22 class InstallModuleCest
23 {
24 /**
25 * @var string
26 */
27 protected $password = '';
28
29 /**
30 * @param Admin $I
31 */
32 public function _before(Admin $I)
33 {
34 $this->password = getenv('typo3InstallToolPassword');
35
36 $I->useExistingSession();
37 // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
38 $I->switchToIFrame('list_frame');
39 $I->waitForText('Web Content Management System');
40 $I->switchToIFrame();
41
42 $I->see('Install');
43 $I->click('Install');
44
45 // switch to content iframe
46 $I->switchToIFrame('list_frame');
47 }
48
49 /**
50 * @param Admin $I
51 */
52 public function unlockAndLockInstallTool(Admin $I)
53 {
54 $I->wantTo('Check the Install Tool unlock and lock functions.');
55
56 // @todo probably there is a better solution skipping the test
57 if (empty($this->password)) {
58 $I->comment('Skip this test.');
59 } else {
60 $I->amGoingTo('unlock the install tool');
61 $I->waitForElement('#t3-install-form-unlock');
62 $I->see('The Install Tool is locked');
63 $I->see('Unlock the Install Tool');
64 $I->click('//button[@value="enableInstallTool"]');
65 $I->waitForElement('#t3-install-outer');
66 $I->see('Password');
67 $I->see('Login');
68
69 $I->amGoingTo('lock the install tool');
70 $I->see('Lock Install Tool again');
71 $I->click('Lock Install Tool again');
72 $I->see('The Install Tool is locked');
73 }
74 }
75
76 /**
77 * @param Admin $I
78 */
79 public function loginToInstallTool(Admin $I)
80 {
81 $I->wantTo('Check the Install Tool Login with wrong and right passwords.');
82
83 // @todo probably there is a better solution skipping the test
84 if (empty($this->password)) {
85 $I->comment('Skip this test.');
86 } else {
87 $I->amGoingTo('unlock the install tool');
88 $I->waitForElement('#t3-install-form-unlock');
89 $I->see('The Install Tool is locked');
90 $I->see('Unlock the Install Tool');
91 $I->click('//button[@value="enableInstallTool"]');
92 $I->waitForElement('#t3-install-outer');
93
94 $I->amGoingTo('login to install tool with wrong password');
95 $I->fillField('#t3-install-form-password', 'wrong_' . $this->password);
96 $I->click('//button[@type="submit"]');
97 $I->waitForElement('//div[@class="t3js-message typo3-message alert alert-danger"]');
98 $I->see('Login failed');
99 $I->see('Given password does not match the install tool login password.');
100 $I->see('Calculated hash:');
101
102 $I->amGoingTo('login to install tool with right password');
103 $I->fillField('#t3-install-form-password', $this->password);
104 $I->click('//button[@type="submit"]');
105 $I->wait(2);
106 $I->waitForElement('//body[@class="backend"]');
107 $I->see('Important actions');
108 $I->waitForElement('.t3js-list-group-wrapper');
109 $I->see('Logout from Install Tool');
110 // can't click the link text
111 $I->seeElement('//*[@id="menuWrapper"]/div/div/a');
112 $I->click('//*[@id="menuWrapper"]/div/div/a[text()="Logout from Install Tool"]');
113 $I->see('The Install Tool is locked');
114 }
115 }
116 }