Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/JoomlaBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public function installExtensionFromFolder($path, $type = 'Extension')
$I->fillField(['id' => 'install_directory'], $path);
// @todo: we need to find a better locator for the following Install button
$I->click(['xpath' => "//button[contains(@onclick,'Joomla.submitbutton3()')]"]); // Install button
$I->waitForText('was successful','30', ['id' => 'system-message-container']);
$I->waitForText('was successful','60', ['id' => 'system-message-container']);
$this->debug("$type successfully installed from $path");
}

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

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

$I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('item.add')\"]"]);
$I->click("New");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked, as you said, it works:

screen shot 2015-10-01 at 11 58 50

Without issues, it uses the Codeception heuristics witch could be slow but seems pretty fast. What it fails is the Save & Close for some unknown reason.

screen shot 2015-10-01 at 11 58 14

But since we are not using it here I'm merging:

$I->waitForText('Menus: New Item', '30', ['css' => 'h1']);
$this->checkForPhpNoticesOrWarnings();
$I->fillField(['id' => 'jform_title'], $menuTitle);

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

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

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