mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
NEW Add easy way to dismiss all toasts in behat (#10661)
This commit is contained in:
parent
0fee1aa584
commit
0f4014650c
@ -76,6 +76,21 @@ class CmsUiContext implements Context
|
|||||||
Assert::assertNotNull($cms_element, 'CMS not found');
|
Assert::assertNotNull($cms_element, 'CMS not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Then /^I dismiss all toasts$/
|
||||||
|
*/
|
||||||
|
public function iDismissAllToasts()
|
||||||
|
{
|
||||||
|
$page = $this->getSession()->getPage();
|
||||||
|
$container = $page->find('css', '.toasts');
|
||||||
|
if (!$container) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
foreach ($container->findAll('css', 'button.toast__close') as $button) {
|
||||||
|
$button->click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Then /^I should see a "(.+)" (\w+) toast$/
|
* @Then /^I should see a "(.+)" (\w+) toast$/
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user