Skip to content

Commit b8aee2c

Browse files
committed
Merge branch 'develop' into locators
2 parents 07b1b46 + 1d97d45 commit b8aee2c

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

src/JoomlaBrowser.php

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public function doAdministratorLogin()
3737
$this->debug('I open Joomla Administrator Login Page');
3838
$I->amOnPage('/administrator/index.php');
3939
$this->debug('Fill Username Text Field');
40-
$I->fillField('#mod-login-username', $this->config['username']);
40+
$I->fillField(['id' => 'mod-login-username'], $this->config['username']);
4141
$this->debug('Fill Password Text Field');
42-
$I->fillField('#mod-login-password', $this->config['password']);
42+
$I->fillField(['id' => 'mod-login-password'], $this->config['password']);
4343
// @todo: update login button in joomla login screen to make this xPath more friendly
4444
$this->debug('I click Login button');
45-
$I->click("//form[@id='form-login']/fieldset/div[3]/div/div/button");
45+
$I->click(['xpath' => "//form[@id='form-login']/fieldset/div[3]/div/div/button"]);
4646
$this->debug('I wait to see Administrator Control Panel');
47-
$I->waitForText('Control Panel', 10, 'H1');
47+
$I->waitForText('Control Panel', 4, ['css' => 'h1.page-title']);
4848
}
4949

5050
/**
@@ -64,7 +64,7 @@ public function installJoomla()
6464

6565
// I Wait for the text Main Configuration, meaning that the page is loaded
6666
$this->debug('I wait for Main Configuration');
67-
$I->waitForText('Main Configuration', 10, 'h3');
67+
$I->waitForText('Main Configuration', 10,['xpath' => '//h3']);
6868

6969
$this->debug('I click Language Selector');
7070
$I->click("//div[@id='jform_language_chzn']/a"); // Language Selector
@@ -91,7 +91,7 @@ public function installJoomla()
9191
$I->click('Next');
9292

9393
$this->debug('I Fill the form for creating the Joomla site Database');
94-
$I->waitForText('Database Configuration', 10, 'h3');
94+
$I->waitForText('Database Configuration', 10,['css' => 'h3']);
9595

9696
$this->debug('I select MySQLi');
9797
$I->selectOption('#jform_db_type', $this->config['database type']);
@@ -125,28 +125,37 @@ public function installJoomla()
125125

126126
// Wait while Joomla gets installed
127127
$this->debug('I wait for Joomla being installed');
128-
$I->waitForText('Congratulations! Joomla! is now installed.', 10, '//h3');
128+
$I->waitForText('Congratulations! Joomla! is now installed.', 10, ['xpath' => '//h3']);
129129
$this->debug('Joomla is now installed');
130-
$I->see('Congratulations! Joomla! is now installed.','//h3');
130+
$I->see('Congratulations! Joomla! is now installed.',['xpath' => '//h3']);
131131
}
132132

133133
/**
134134
* Sets in Adminitrator->Global Configuration the Error reporting to Development
135135
*
136136
* @note: doAdminLogin() before
137137
*/
138-
public function setErrorReportingtoDevelopment()
138+
public function setErrorReportingToDevelopment()
139139
{
140140
$I = $this;
141+
$this->debug('I open Joomla Global Configuration Page');
141142
$I->amOnPage('/administrator/index.php?option=com_config');
142-
$I->waitForText('Global Configuration',10,'.page-title');
143-
$I->click('Server');
144-
$I->waitForElementVisible("//div[@id='jform_error_reporting_chzn']/a"); // Error reporting Dropdown
145-
$I->click("//div[@id='jform_error_reporting_chzn']/a");
146-
$I->click("//div[@id='jform_error_reporting_chzn']/div/ul/li[contains(text(), 'Development')]"); // Development
147-
$I->click('Save');
148-
$I->waitForText('Global Configuration',10,'.page-title');
149-
$I->see('Configuration successfully saved.','#system-message-container');
143+
$this->debug('I wait for Global Configuration title');
144+
$I->waitForText('Global Configuration',10,['css' => '.page-title']);
145+
$this->debug('I open the Server Tab');
146+
$I->click(['link' => 'Server']);
147+
$this->debug('I wait for error reporting dropdown');
148+
$I->waitForElementVisible(['xpath' => "//div[@id='jform_error_reporting_chzn']/a"]); // Error reporting Dropdown
149+
$this->debug('I click on error reporting dropdown');
150+
$I->click(['xpath' => "//div[@id='jform_error_reporting_chzn']/a"]);
151+
$this->debug('I click on development option');
152+
$I->click(['xpath' => "//div[@id='jform_error_reporting_chzn']/div/ul/li[contains(text(), 'Development')]"]); // Development
153+
$I->wait(1);
154+
$this->debug('I click on save');
155+
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('config.save.application.apply')\"]"]);
156+
$this->debug('I wait for global configuration being saved');
157+
$I->waitForText('Global Configuration',10,['css' => '.page-title']);
158+
$I->see('Configuration successfully saved.',['id' => 'system-message-container']);
150159
}
151160

152161
/**
@@ -160,11 +169,11 @@ public function installExtensionFromDirectory($path)
160169
{
161170
$I = $this;
162171
$I->amOnPage('/administrator/index.php?option=com_installer');
163-
$I->click('Install from Directory');
164-
$I->fillField('#install_directory', $path);
172+
$I->click(['link' => 'Install from Directory']);
173+
$I->fillField(['id' => 'Install from Directory'], $path);
165174
// @todo: we need to find a better locator for the following Install button
166-
$I->click("//input[contains(@onclick,'Joomla.submitbutton3()')]"); // Install button
167-
$I->waitForText('was successful', 10, '#system-message-container');
175+
$I->click(['xpath' => "//input[contains(@onclick,'Joomla.submitbutton3()')]"]); // Install button
176+
$I->waitForText('was successful', 10, ['id' => 'system-message-container']);
168177
}
169178

170179
/**

0 commit comments

Comments
 (0)