mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
NEW Add Behat CMS header tab context methods
This commit is contained in:
parent
7fd316d405
commit
2dd5bb4d19
@ -155,6 +155,15 @@ class CmsUiContext implements Context
|
|||||||
assertNull($element, sprintf('%s found', $text));
|
assertNull($element, sprintf('%s found', $text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @When /^I should see a "([^"]*)" tab in the CMS content header tabs$/
|
||||||
|
*/
|
||||||
|
public function stepIShouldSeeInCMSContentTabs($text)
|
||||||
|
{
|
||||||
|
// Wait until visible
|
||||||
|
assertNotNull($this->getCmsTabElement($text), sprintf('%s content tab not found', $text));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies a specific action to an element
|
* Applies a specific action to an element
|
||||||
*
|
*
|
||||||
@ -219,6 +228,40 @@ class CmsUiContext implements Context
|
|||||||
$this->interactWithElement($treeNode, $method);
|
$this->interactWithElement($treeNode, $method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @When /^I (?P<method>(?:(?:double |right |left |)click)|hover) on "(?P<text>[^"]*)" in the header tabs$/
|
||||||
|
*/
|
||||||
|
public function stepIClickOnElementInTheHeaderTabs($method, $text)
|
||||||
|
{
|
||||||
|
$tabsNode = $this->getCmsTabElement($text);
|
||||||
|
assertNotNull($tabsNode, sprintf('%s not found', $text));
|
||||||
|
$this->interactWithElement($tabsNode, $method);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Then the :text header tab should be active
|
||||||
|
*/
|
||||||
|
public function theHeaderTabShouldBeActive($text)
|
||||||
|
{
|
||||||
|
assertTrue($this->getCmsTabElement($text)->hasClass('active'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Then the :text header tab should not be active
|
||||||
|
*/
|
||||||
|
public function theHeaderTabShouldNotBeActive($text)
|
||||||
|
{
|
||||||
|
assertFalse($this->getCmsTabElement($text)->hasClass('active'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return NodeElement
|
||||||
|
*/
|
||||||
|
protected function getCmsTabElement($text)
|
||||||
|
{
|
||||||
|
return $this->getCmsTabsElement()->findLink($text);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @When /^I expand the "([^"]*)" CMS Panel$/
|
* @When /^I expand the "([^"]*)" CMS Panel$/
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user