Skip to content

Commit

Permalink
Fix for special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Jul 21, 2023
1 parent 331b660 commit 808553e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/Browser/Locator/CSSLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ public function __construct(string $identifier, string $selector)
{
parent::__construct($identifier, $selector);
$validator = new CssLocatorValidator();
$validator->validate($this);
if (str_contains($selector, '%d') || str_contains($selector, '%s')) {
$validator->validate(new self($identifier, str_replace(['%d', '%s'], '1', $selector)));
}
else {
$validator->validate($this);
}
}

public function getType(): string
Expand Down

0 comments on commit 808553e

Please sign in to comment.