How can a link be tested if its body has special characters like "@"?
<a href="foo.php">foo@foo.com</a>
public function foo()
{
$this->visit('/foo')
->click('foo@foo.com');
}
Symfony\Component\CssSelector\Exception\SyntaxErrorException: Expected selector, but <delimiter "@" at 7> found.
I also tried to escape the "@" sign:
public function foo()
{
$this->visit('/foo')
->click('foo\@foo.com');
}
InvalidArgumentException: Could not find a link with a body, name, or ID attribute of [foo\@foo.com].
What version of Laravel 5 are you using, as this doesn't happen if Laravel 5.2.x.
However, you can try escaping the @
sign as follows:
public function foo()
{
$this->visit('/foo')
->click('foo\@foo.com');
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.