File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -299,15 +299,13 @@ public function start()
299299 {
300300 try {
301301 $ this ->wdSession = $ this ->webDriver ->session ($ this ->browserName , $ this ->desiredCapabilities );
302- $ this ->applyTimeouts ();
303302 } catch (\Exception $ e ) {
304303 throw new DriverException ('Could not open connection: ' .$ e ->getMessage (), 0 , $ e );
305304 }
306305
307- if (!$ this ->wdSession ) {
308- throw new DriverException ('Could not connect to a Selenium 2 / WebDriver server ' );
309- }
310306 $ this ->started = true ;
307+
308+ $ this ->applyTimeouts ();
311309 }
312310
313311 /**
Original file line number Diff line number Diff line change @@ -9,6 +9,24 @@ class TimeoutTest extends TestCase
99{
1010 use ExpectException;
1111
12+ /**
13+ * @after
14+ */
15+ protected function resetSessions ()
16+ {
17+ $ session = $ this ->getSession ();
18+
19+ // Stop the session instead of only resetting it, as timeouts are not reset (they are configuring the session itself)
20+ if ($ session ->isStarted ()) {
21+ $ session ->stop ();
22+ }
23+
24+ // Reset the array of timeouts to avoid impacting other tests
25+ $ session ->getDriver ()->setTimeouts (array ());
26+
27+ parent ::resetSessions ();
28+ }
29+
1230 public function testInvalidTimeoutSettingThrowsException ()
1331 {
1432 $ this ->expectException ('\Behat\Mink\Exception\DriverException ' );
You can’t perform that action at this time.
0 commit comments