mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6219 from open-sausages/pulls/4.0/fix-behat-search-chosen
BUG Prevent intermittent "Element is not currently visible and so may not be interacted with"
This commit is contained in:
commit
a4a895ff43
@ -239,7 +239,7 @@ class CmsUiContext extends BehatContext {
|
||||
|
||||
$filterButtonCssClass = $filterButton->getAttribute('class');
|
||||
|
||||
if($action == 'expand') {
|
||||
if($action === 'expand') {
|
||||
if(strpos($filterButtonCssClass, 'active') === false) {
|
||||
$filterButton->click();
|
||||
}
|
||||
@ -250,6 +250,17 @@ class CmsUiContext extends BehatContext {
|
||||
}
|
||||
|
||||
$this->getSession()->wait(2000, 'window.jQuery(".cms-content-filters:animated").length === 0');
|
||||
|
||||
// If activating, wait until chosen is activated
|
||||
if ($action === 'expand') {
|
||||
$this->getSession()->wait(
|
||||
2000,
|
||||
<<<'SCRIPT'
|
||||
(window.jQuery(".cms-content-filters select").length === 0) ||
|
||||
(window.jQuery(".cms-content-filters select:visible.has-chosen").length > 0)
|
||||
SCRIPT
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user