Skip to content

alternative method of testing forms with collections #10527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

lordelph
Copy link

@alexislefebvre
Copy link
Contributor

That looks good, I think that you should move the text of this PR before You can remove an existing field, e.g. a tag: since the code is used to add field, not remove it.

@@ -789,6 +789,25 @@ You can remove an existing field, e.g. a tag::
// the tag has been removed
$this->assertEquals(0, $crawler->filter('ul.tags > li')->count());

You can also manipulate the DOM before obtaining the form - this can be useful for simulating collections. For example,
if you had a form which could include dynamic upload fields, you can add the extra fields to the DOM before obtaining
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOM and obtaining is named twice, the sentence is a bit confusing

@javiereguiluz javiereguiluz added this to the 3.4 milestone Dec 3, 2018
@javiereguiluz
Copy link
Member

@xabbuh what's your opinion about this trick? Thank you.

@xabbuh
Copy link
Member

xabbuh commented Oct 7, 2019

This sounds like quite a fragile approach to me. IMO when your functional test requires JavaScript to be executed you should use a real browser in the background (for example using Panther) instead.

@alexislefebvre
Copy link
Contributor

@xabbuh You're right but in the same time, this PR uses an approach that is easy to write and maintain. Maybe we should add an info message like this:

It is recommended to use a real browser but you can use this method that doesn't require a browser.

@xabbuh
Copy link
Member

xabbuh commented Oct 15, 2019

Maybe we should add a more generic block hinting that you can modify the DOM if you want to simulate client-side modifications and then mention that this does work but is not recommended and one should use a tool like Panther instead.

@wouterj
Copy link
Member

wouterj commented Oct 3, 2020

Hi @lordelph! Thanks for starting this PR.

As it seems like the current changes of this PR will not be merged and there hasn't been any update in a year, I'll close this PR. Feel free to comment or update the PR, we can always hit the reopen button again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants