From eb311691be7c12602778358f4748c15fa2ab2b65 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 22 Aug 2013 14:10:54 +0200 Subject: [PATCH] Fixed 3.1-specific switchToWindow() behat feature --- .../Framework/Test/Behaviour/CmsUiContext.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php index bbc50048a..7516cd41c 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php @@ -272,14 +272,16 @@ class CmsUiContext extends BehatContext public function iWaitForThePreviewToLoad() { $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->getSession()->wait( 5000, "!jQuery('iframe[name=cms-preview-iframe]').hasClass('loading')" ); - - $driver->switchToWindow(); + $driver->switchToWindow($origWindowName); } /**