browser
browser copied to clipboard
A fluent interface for your Symfony functional tests.
Currently, `console.log('message')` is not captured by `PantherBrowser::dumpConsoleLog()`. @weaverryan found [this resource](https://stackoverflow.com/questions/40538392/get-console-log-from-selenium-using-php-webdriver#answers), but I couldn't get it to work.
When using `throw 'message'` in your javascript, `PantherBrowser::dumpConsoleLog()` has an entry but it doesn't include "message", just "Uncaught".
Currently, uploading files is a bit verbose: ```php $browser->post('/endpoint', ['files' => [new UploadedFile($realpath, $name, test: true)]); ``` It would be better if you could do: ```php $browser->post('/endpoint', ['files' => [$realpath]);...
Per conversation with @nikophil. Use `justinrainbow/json-schema` to validate schema. I don't have any experience with json schema but is it common the include the schema files in some kind of...
The idea is to click a form submit and ensure there are no validation errors. If there are, fail. ```php public function clickAndValidate(string $locator): self { return $this->clickAndIntercept($locator) ->use(function (ValidatorDataCollector...
Fixes #15, Fixes #12. Fixes #37. The idea is any method that accepts a `$selector` would allow `string|Selector`. Example: ```php $browser ->assertSeeElement(Selector::css('value')) ->assertSeeElement(Selector::id('value')) ->assertSeeElement(Selector::xpath('value')) ->assertSeeElement(Selector::link('value')) ->assertSeeElement(Selector::button('value')) ->assertSeeElement(Selector::field('value')) // form field...
Closes #12.
- cannot access fields not in a `` - cannot access fields without `name` attribute
```php $browser ->assertSeeIn('title', 'Post Title') ->assertSeeIn('h1', 'Post Title') ; ``` Could become: ```php $browser ->assertSeeIn(['title', 'h1'], 'Post Title') ; ```
The method parameter `$selector` is used in several methods and means different things depending on the context: - *css selector*: `->assertSeeIn('h1', 'some text')` or `->dump('h1')` - *link selector (link id/title/text/image...