Skip to content

Commit 57da50d

Browse files
committed
Improve locators in setErrorReportingToDevelopment
1 parent cf4d9df commit 57da50d

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/JoomlaBrowser.php

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,27 @@ public function installJoomla()
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
/**

0 commit comments

Comments
 (0)