mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fix Behat window switching in chrome
Workaround only, see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI
This commit is contained in:
parent
0c859b8587
commit
54edc0ddac
@ -245,10 +245,13 @@ class CmsUiContext extends BehatContext
|
||||
public function thePreviewContains($content)
|
||||
{
|
||||
$driver = $this->getSession()->getDriver();
|
||||
$driver->switchToIFrame('cms-preview-iframe');
|
||||
// TODO Remove once we have native support in Mink and php-webdriver,
|
||||
// see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI
|
||||
$origWindowName = $driver->getWebDriverSession()->window_handle();
|
||||
|
||||
$driver->switchToIFrame('cms-preview-iframe');
|
||||
$this->getMainContext()->assertPageContainsText($content);
|
||||
$driver->switchToWindow();
|
||||
$driver->switchToWindow($origWindowName);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -257,10 +260,13 @@ class CmsUiContext extends BehatContext
|
||||
public function thePreviewDoesNotContain($content)
|
||||
{
|
||||
$driver = $this->getSession()->getDriver();
|
||||
// TODO Remove once we have native support in Mink and php-webdriver,
|
||||
// see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI
|
||||
$origWindowName = $driver->getWebDriverSession()->window_handle();
|
||||
|
||||
$driver->switchToIFrame('cms-preview-iframe');
|
||||
|
||||
$this->getMainContext()->assertPageNotContainsText($content);
|
||||
$driver->switchToWindow();
|
||||
$driver->switchToWindow($origWindowName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user