mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #7196 from open-sausages/pulls/4.0/search-default-listview
Add step definition for cms list
This commit is contained in:
commit
a8187a3203
@ -155,6 +155,29 @@ class CmsUiContext implements Context
|
|||||||
assertNull($element, sprintf('%s found', $text));
|
assertNull($element, sprintf('%s found', $text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @When /^I should (|not )see "([^"]*)" in the cms list$/
|
||||||
|
*/
|
||||||
|
public function stepIShouldSeeInCmsList($negate, $text)
|
||||||
|
{
|
||||||
|
// Wait until visible
|
||||||
|
$this->getSession()->wait(
|
||||||
|
5000,
|
||||||
|
"document.querySelector('.cms-lists') !== null"
|
||||||
|
);
|
||||||
|
$page = $this->getSession()->getPage();
|
||||||
|
$cmsListElement = $page->find('css', '.cms-list');
|
||||||
|
assertNotNull($cmsListElement, 'CMS list not found');
|
||||||
|
|
||||||
|
// Check text within this element
|
||||||
|
$element = $cmsListElement->find('named', array('content', "'$text'"));
|
||||||
|
if (strstr($negate, 'not')) {
|
||||||
|
assertNull($element, sprintf('Unexpected %s found in cms list', $text));
|
||||||
|
} else {
|
||||||
|
assertNotNull($element, sprintf('Expected %s not found in cms list', $text));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @When /^I should see a "([^"]*)" tab in the CMS content header tabs$/
|
* @When /^I should see a "([^"]*)" tab in the CMS content header tabs$/
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user