@@ -95,18 +95,19 @@ public function waitUntilMissingText($text, $seconds = null)
95
95
*
96
96
* @param array|string $text
97
97
* @param int|null $seconds
98
+ * @param bool $ignoreCase
98
99
* @return $this
99
100
*
100
101
* @throws \Facebook\WebDriver\Exception\TimeoutException
101
102
*/
102
- public function waitForText ($ text , $ seconds = null )
103
+ public function waitForText ($ text , $ seconds = null , $ ignoreCase = false )
103
104
{
104
105
$ text = Arr::wrap ($ text );
105
106
106
107
$ message = $ this ->formatTimeOutMessage ('Waited %s seconds for text ' , implode ("', ' " , $ text ));
107
108
108
- return $ this ->waitUsing ($ seconds , 100 , function () use ($ text ) {
109
- return Str::contains ($ this ->resolver ->findOrFail ('' )->getText (), $ text );
109
+ return $ this ->waitUsing ($ seconds , 100 , function () use ($ text, $ ignoreCase ) {
110
+ return Str::contains ($ this ->resolver ->findOrFail ('' )->getText (), $ text, $ ignoreCase );
110
111
}, $ message );
111
112
}
112
113
@@ -116,16 +117,17 @@ public function waitForText($text, $seconds = null)
116
117
* @param string $selector
117
118
* @param array|string $text
118
119
* @param int|null $seconds
120
+ * @param bool $ignoreCase
119
121
* @return $this
120
122
*
121
123
* @throws \Facebook\WebDriver\Exception\TimeoutException
122
124
*/
123
- public function waitForTextIn ($ selector , $ text , $ seconds = null )
125
+ public function waitForTextIn ($ selector , $ text , $ seconds = null , $ ignoreCase = false )
124
126
{
125
127
$ message = 'Waited %s seconds for text " ' .$ this ->escapePercentCharacters ($ text ).'" in selector ' .$ selector ;
126
128
127
- return $ this ->waitUsing ($ seconds , 100 , function () use ($ selector , $ text ) {
128
- return $ this ->assertSeeIn ($ selector , $ text );
129
+ return $ this ->waitUsing ($ seconds , 100 , function () use ($ selector , $ text, $ ignoreCase ) {
130
+ return $ this ->assertSeeIn ($ selector , $ text, $ ignoreCase );
129
131
}, $ message );
130
132
}
131
133
0 commit comments