Skip to content

Commit

Permalink
add case insensitive option for waitForText
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryce Stabenow authored and Bryce Stabenow committed Jan 2, 2024
1 parent 0c02087 commit 4722376
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Concerns/WaitsForElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,19 @@ public function waitUntilMissingText($text, $seconds = null)
*
* @param array|string $text
* @param int|null $seconds
* @param bool $ignoreCase
* @return $this
*
* @throws \Facebook\WebDriver\Exception\TimeoutException
*/
public function waitForText($text, $seconds = null)
public function waitForText($text, $seconds = null, $ignoreCase = false)
{
$text = Arr::wrap($text);

$message = $this->formatTimeOutMessage('Waited %s seconds for text', implode("', '", $text));

return $this->waitUsing($seconds, 100, function () use ($text) {
return Str::contains($this->resolver->findOrFail('')->getText(), $text);
return Str::contains($this->resolver->findOrFail('')->getText(), $text, $ignoreCase);
}, $message);
}

Expand Down

0 comments on commit 4722376

Please sign in to comment.