symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.91k stars 213 forks source link

Provide a higher level API for asserting against browser console log #591

Open dkarlovi opened 1 year ago

dkarlovi commented 1 year ago

See https://github.com/symfony/panther/issues/339#issuecomment-757772947

  1. works only on Chrome currently (not sure if that's state of the art)
  2. needs a nice way to request the capabilities when creating the client (maybe can be auto-requested?)
  3. needs an API to assert against the console content, which is list<array{level: "INFO"|"WARNING"|"SEVERE", message: string, source: "console-api", timestamp: int}>

Initial API proposal

$this->assertBrowserConsoleSevereLogIsEmpty();
$this->assertBrowserConsoleInfoLogContains('hello world');