@@ -659,7 +659,7 @@ public function _failed(TestInterface $test, $fail)
659
659
/**
660
660
* Print out latest Selenium Logs in debug mode
661
661
*/
662
- public function debugWebDriverLogs (TestInterface $ test = null ): void
662
+ public function debugWebDriverLogs (? TestInterface $ test = null ): void
663
663
{
664
664
if ($ this ->webDriver === null ) {
665
665
$ this ->debug ('WebDriver::debugWebDriverLogs method has been called when webDriver is not set ' );
@@ -903,7 +903,7 @@ public function _savePageSource(string $filename): void
903
903
* // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.png
904
904
* ```
905
905
*/
906
- public function makeScreenshot (string $ name = null ): void
906
+ public function makeScreenshot (? string $ name = null ): void
907
907
{
908
908
if (empty ($ name )) {
909
909
$ name = uniqid (date ("Y-m-d_H-i-s_ " ));
@@ -933,7 +933,7 @@ public function makeScreenshot(string $name = null): void
933
933
*
934
934
* @param WebDriverBy|array $selector
935
935
*/
936
- public function makeElementScreenshot ($ selector , string $ name = null ): void
936
+ public function makeElementScreenshot ($ selector , ? string $ name = null ): void
937
937
{
938
938
if (empty ($ name )) {
939
939
$ name = uniqid (date ("Y-m-d_H-i-s_ " ));
@@ -949,7 +949,7 @@ public function makeElementScreenshot($selector, string $name = null): void
949
949
$ this ->debugSection ('Screenshot Saved ' , "file:// {$ screenName }" );
950
950
}
951
951
952
- public function makeHtmlSnapshot (string $ name = null ): void
952
+ public function makeHtmlSnapshot (? string $ name = null ): void
953
953
{
954
954
if (empty ($ name )) {
955
955
$ name = uniqid (date ("Y-m-d_H-i-s_ " ));
@@ -1327,7 +1327,7 @@ protected function findField($selector): WebDriverElement
1327
1327
return reset ($ arr );
1328
1328
}
1329
1329
1330
- public function seeLink (string $ text , string $ url = null ): void
1330
+ public function seeLink (string $ text , ? string $ url = null ): void
1331
1331
{
1332
1332
$ this ->enableImplicitWait ();
1333
1333
$ nodes = $ this ->getBaseElement ()->findElements (WebDriverBy::partialLinkText ($ text ));
@@ -2768,7 +2768,7 @@ public function executeInSelenium(Closure $function)
2768
2768
* });
2769
2769
* ```
2770
2770
*/
2771
- public function switchToWindow (string $ name = null ): void
2771
+ public function switchToWindow (? string $ name = null ): void
2772
2772
{
2773
2773
$ this ->webDriver ->switchTo ()->window ($ name );
2774
2774
}
@@ -2795,7 +2795,7 @@ public function switchToWindow(string $name = null): void
2795
2795
*
2796
2796
* @param string|null $locator (name, CSS or XPath)
2797
2797
*/
2798
- public function switchToIFrame (string $ locator = null ): void
2798
+ public function switchToIFrame (? string $ locator = null ): void
2799
2799
{
2800
2800
$ this ->findAndSwitchToFrame ($ locator , 'iframe ' );
2801
2801
}
@@ -2822,12 +2822,12 @@ public function switchToIFrame(string $locator = null): void
2822
2822
*
2823
2823
* @param string|null $locator (name, CSS or XPath)
2824
2824
*/
2825
- public function switchToFrame (string $ locator = null ): void
2825
+ public function switchToFrame (? string $ locator = null ): void
2826
2826
{
2827
2827
$ this ->findAndSwitchToFrame ($ locator );
2828
2828
}
2829
2829
2830
- private function findAndSwitchToFrame (string $ locator = null , string $ tag = 'frame ' ): void
2830
+ private function findAndSwitchToFrame (? string $ locator = null , string $ tag = 'frame ' ): void
2831
2831
{
2832
2832
if ($ locator === null ) {
2833
2833
$ this ->webDriver ->switchTo ()->defaultContent ();
@@ -2962,7 +2962,7 @@ public function dragAndDrop($source, $target): void
2962
2962
* @param null|string|array|WebDriverBy $cssOrXPath css or xpath of the web element
2963
2963
* @throws ElementNotFound
2964
2964
*/
2965
- public function moveMouseOver ($ cssOrXPath = null , int $ offsetX = null , int $ offsetY = null ): void
2965
+ public function moveMouseOver ($ cssOrXPath = null , ? int $ offsetX = null , ? int $ offsetY = null ): void
2966
2966
{
2967
2967
$ where = null ;
2968
2968
if (null !== $ cssOrXPath ) {
@@ -2991,7 +2991,7 @@ public function moveMouseOver($cssOrXPath = null, int $offsetX = null, int $offs
2991
2991
*
2992
2992
* @throws ElementNotFound
2993
2993
*/
2994
- public function clickWithLeftButton ($ cssOrXPath = null , int $ offsetX = null , int $ offsetY = null ): void
2994
+ public function clickWithLeftButton ($ cssOrXPath = null , ? int $ offsetX = null , ? int $ offsetY = null ): void
2995
2995
{
2996
2996
$ this ->moveMouseOver ($ cssOrXPath , $ offsetX , $ offsetY );
2997
2997
$ this ->webDriver ->getMouse ()->click ();
@@ -3014,7 +3014,7 @@ public function clickWithLeftButton($cssOrXPath = null, int $offsetX = null, int
3014
3014
* @param null|string|array|WebDriverBy $cssOrXPath css or xpath of the web element (body by default).
3015
3015
* @throws ElementNotFound
3016
3016
*/
3017
- public function clickWithRightButton ($ cssOrXPath = null , int $ offsetX = null , int $ offsetY = null ): void
3017
+ public function clickWithRightButton ($ cssOrXPath = null , ? int $ offsetX = null , ? int $ offsetY = null ): void
3018
3018
{
3019
3019
$ this ->moveMouseOver ($ cssOrXPath , $ offsetX , $ offsetY );
3020
3020
$ this ->webDriver ->getMouse ()->contextClick ();
@@ -3487,7 +3487,7 @@ protected function isPhantom(): bool
3487
3487
*
3488
3488
* @param string|array|WebDriverBy $selector
3489
3489
*/
3490
- public function scrollTo ($ selector , int $ offsetX = null , int $ offsetY = null ): void
3490
+ public function scrollTo ($ selector , ? int $ offsetX = null , ? int $ offsetY = null ): void
3491
3491
{
3492
3492
$ el = $ this ->matchFirstOrFail ($ this ->getBaseElement (), $ selector );
3493
3493
$ x = $ el ->getLocation ()->getX () + $ offsetX ;
0 commit comments