Updated Expand CMS Panel to find first visible panel and added new test file

This commit is contained in:
Sriram Venkatesh 2014-02-18 10:21:07 +13:00
parent 30e3904e4c
commit 80997171cc
2 changed files with 8 additions and 8 deletions

View File

@ -184,14 +184,14 @@ class CmsUiContext extends BehatContext {
* @When /^I expand the "([^"]*)" CMS Panel$/
*/
public function iExpandTheCmsPanel() {
// TODO Make dynamic, currently hardcoded to first panel
//Tries to find the first visiable toggle in the page
$page = $this->getSession()->getPage();
$panel_toggle_element = $page->find('css', '.cms-content > .cms-panel > .cms-panel-toggle > .toggle-expand');
assertNotNull($panel_toggle_element, 'Panel toggle not found');
if ($panel_toggle_element->isVisible()) {
$panel_toggle_element->click();
$toggle_elements = $page->findAll('css', '.toggle-expand');
assertNotNull($toggle_elements, 'Panel toggle not found');
foreach($toggle_elements as $toggle){
if($toggle->isVisible()){
$toggle->click();
}
}
}

Binary file not shown.