Skip to content

Commit eb19940

Browse files
committed
Merge pull request #63 from puneet0191/FixWaitForTime
Fixing Issue and Improving the Code Readability on Joomla! Browser
2 parents 650962e + 6d2c95e commit eb19940

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/JoomlaBrowser.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public function installExtensionFromFolder($path, $type = 'Extension')
332332
$I->fillField(['id' => 'install_directory'], $path);
333333
// @todo: we need to find a better locator for the following Install button
334334
$I->click(['xpath' => "//button[contains(@onclick,'Joomla.submitbutton3()')]"]); // Install button
335-
$I->waitForText('was successful','30', ['id' => 'system-message-container']);
335+
$I->waitForText('was successful','60', ['id' => 'system-message-container']);
336336
$this->debug("$type successfully installed from $path");
337337
}
338338

@@ -684,13 +684,16 @@ public function createMenuItem($menuTitle, $menuCategory, $menuItem, $menu = "Ma
684684
$I = $this;
685685
$I->amOnPage('administrator/index.php?option=com_menus&view=menus');
686686
$I->waitForText('Menus', '30', ['css' => 'H1']);
687+
$this->checkForPhpNoticesOrWarnings();
687688

688689
// Choose the right menu
689690
$I->click(['xpath' => "//*[@id=\"menuList\"]/tbody/tr/td[2]/a[contains(text(), '" . $menu . "')]"]);;
690691
$I->waitForText('Menus: Items', '30', ['css' => 'H1']);
692+
$this->checkForPhpNoticesOrWarnings();
691693

692-
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('item.add')\"]"]);
694+
$I->click("New");
693695
$I->waitForText('Menus: New Item', '30', ['css' => 'h1']);
696+
$this->checkForPhpNoticesOrWarnings();
694697
$I->fillField(['id' => 'jform_title'], $menuTitle);
695698

696699
// Menu type (modal)
@@ -707,7 +710,7 @@ public function createMenuItem($menuTitle, $menuCategory, $menuItem, $menu = "Ma
707710
$I->click(['xpath' => "//a[contains(text(), '" . $menuItem . "')]"]);
708711

709712
$I->waitForText('Menus: New Item','30', ['css' => 'h1']);
710-
$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('item.apply')\"]"]);
713+
$I->click("Save");
711714

712715
$I->waitForText('Menu item successfully saved', 30, ['id' => 'system-message-container']);
713716
}

0 commit comments

Comments
 (0)