Fixed 3.1-specific switchToWindow() behat feature

This commit is contained in:
Ingo Schommer 2013-08-22 14:10:54 +02:00
parent 4a3a88710f
commit eb311691be

View File

@ -272,14 +272,16 @@ class CmsUiContext extends BehatContext
public function iWaitForThePreviewToLoad()
{
$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->getSession()->wait(
5000,
"!jQuery('iframe[name=cms-preview-iframe]').hasClass('loading')"
);
$driver->switchToWindow();
$driver->switchToWindow($origWindowName);
}
/**