Closed bjo3rnf closed 2 years ago
Hi @bjo3rnf, yes that is sort of expected behaviour. This library uses Mink under the hood and it doesn't let you use fillField()
/assertField()
with hidden fields.
Using assertElementAttributeContains
as you show above is the best way to assert the value.
Do you need to manipulate the hidden field? Currently, the only way would be to create a custom browser class and use some internal stuff.
If you do need to change a hidden field, here's a little method I use in a project:
class AppBrowser extends KernelBrowser
{
public function fillHiddenField(string $name, string $value): self
{
$selector = "input[name=\"{$name}\"]";
$this->assertSeeElement($selector);
$this->session()->page()->find('css', $selector)->setValue($value); // note: ->session() is @internal
return $this;
}
}
Hi @kbond,
I don't have to manipulate the fields, but use the assertion to determine the current state. I thought I could simplify/shorten it that way, but that's ok for me.
Thanks again.
Hi @kbond,
thank you for this great library, it's a real timesaver.
I'm not sure if this is the expected behavior but I stumbled across the following:
Thanks again.
Cheers Björn