mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add step definition for cms list
This commit is contained in:
parent
4af84a2f61
commit
98e77ec1c4
@ -122,6 +122,20 @@ class CmsUiContext implements Context
|
||||
return $cms_tree_element;
|
||||
}
|
||||
|
||||
protected function getCmsListElement()
|
||||
{
|
||||
$this->getSession()->wait(
|
||||
5000,
|
||||
"document.querySelector('.cms-lists') !== null"
|
||||
);
|
||||
|
||||
$page = $this->getSession()->getPage();
|
||||
$cms_list_element = $page->find('css', '.cms-list');
|
||||
assertNotNull($cms_list_element, 'CMS list not found');
|
||||
|
||||
return $cms_list_element;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^I should see a "([^"]*)" button in CMS Content Toolbar$/
|
||||
*/
|
||||
@ -155,6 +169,28 @@ class CmsUiContext implements Context
|
||||
assertNull($element, sprintf('%s found', $text));
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^I should see "([^"]*)" in the list$/
|
||||
*/
|
||||
public function stepIShouldSeeInCmsList($text)
|
||||
{
|
||||
// Wait until visible
|
||||
$cmsListElement = $this->getCmsListElement();
|
||||
$element = $cmsListElement->find('named', array('content', "'$text'"));
|
||||
assertNotNull($element, sprintf('%s not found', $text));
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^I should not see "([^"]*)" in the list$/
|
||||
*/
|
||||
public function stepIShouldNotSeeInCmsList($text)
|
||||
{
|
||||
// Wait until visible
|
||||
$cmsListElement = $this->getCmsListElement();
|
||||
$element = $cmsListElement->find('named', array('content', "'$text'"));
|
||||
assertNull($element, sprintf('%s not found', $text));
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^I should see a "([^"]*)" tab in the CMS content header tabs$/
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user