Simplify some parts of the functional tests #27627
Labels
BrowserKit
DX
DX = Developer eXperience (anything that improves the experience of using Symfony)
Feature
Uh oh!
There was an error while loading. Please reload this page.
Description
The code needed to click links or submit forms in functional tests looks a bit verbose.
The steps used to get the
Link
object may be OK when using this inside the DomCrawler component ... because you can do advanced things like calling thegetUri()
on theLink
object. However, when using this inside a Symfony app, it looks unnecessary.Example
Links
Before:
After:
Forms
Before:
After:
We could also change how things work and take the forms via their names (if they don't have a name, then use the traditional way). The above example would look like this:
The text was updated successfully, but these errors were encountered: