File tree 2 files changed +5
-5
lines changed
Filter options
2 files changed +5
-5
lines changed
Original file line number Diff line number Diff line change 16
16
use Facebook \WebDriver \Exception \NoSuchElementException ;
17
17
use Facebook \WebDriver \Exception \TimeOutException ;
18
18
use Facebook \WebDriver \JavaScriptExecutor ;
19
- use Facebook \WebDriver \Remote \RemoteWebElement ;
20
19
use Facebook \WebDriver \WebDriver ;
21
20
use Facebook \WebDriver \WebDriverBy ;
22
21
use Facebook \WebDriver \WebDriverCapabilities ;
@@ -251,13 +250,15 @@ public function getCookieJar()
251
250
* @throws NoSuchElementException
252
251
* @throws TimeOutException
253
252
*
254
- * @return RemoteWebElement
253
+ * @return Crawler
255
254
*/
256
255
public function waitFor (string $ cssSelector , int $ timeoutInSecond = 30 , int $ intervalInMillisecond = 250 )
257
256
{
258
- return $ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
257
+ $ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
259
258
WebDriverExpectedCondition::visibilityOfElementLocated (WebDriverBy::cssSelector ($ cssSelector ))
260
259
);
260
+
261
+ return $ this ->crawler = $ this ->createCrawler ();
261
262
}
262
263
263
264
public function getWebDriver (): WebDriver
Original file line number Diff line number Diff line change 14
14
namespace Symfony \Component \Panther \Tests ;
15
15
16
16
use Facebook \WebDriver \JavaScriptExecutor ;
17
- use Facebook \WebDriver \Remote \RemoteWebElement ;
18
17
use Facebook \WebDriver \WebDriver ;
19
18
use Facebook \WebDriver \WebDriverExpectedCondition ;
20
19
use Symfony \Component \BrowserKit \Client as BrowserKitClient ;
@@ -45,7 +44,7 @@ public function testWaitFor()
45
44
$ client = self ::createPantherClient ();
46
45
$ crawler = $ client ->request ('GET ' , '/waitfor.html ' );
47
46
$ c = $ client ->waitFor ('#hello ' );
48
- $ this ->assertInstanceOf (RemoteWebElement ::class, $ c );
47
+ $ this ->assertInstanceOf (Crawler ::class, $ c );
49
48
$ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text ());
50
49
}
51
50
You can’t perform that action at this time.
0 commit comments