I'd love an answer to this as well!
Sep 5, 2015
3
Level 16
LogicException: The selected node does not have a form ancestor.
I'm working on fleshing out my functional tests with the integrated PHPUnit functionality added in Laravel 5. I have a form, but its "submit" button is a regular button outside of the form, which onclick event triggers the form to submit. (This is necessary because of layout constraints.)
The error I'm getting is:
LogicException: The selected node does not have a form ancestor.
Here's the relevant unit test:
$response = $this->actingAs($this->myUser)
->visit('testpage')
->click('random-link-id')
->press('Update Role'); // this is just a regular <button> with an onclick event
Any ideas how to trigger a form submit without pressing a button that has to be within the form tags?
Please or to participate in this conversation.