Fix Behat window switching in chrome

Workaround only, see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI
This commit is contained in:
Ingo Schommer 2013-08-22 12:48:11 +02:00
parent 0c859b8587
commit 54edc0ddac

View File

@ -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);
}
/**