-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Unexpected behaviour for assertSeeIn() #112
Comments
Yes, I've been burned by this before as well. I agree with your conclusion on how it should work. |
Is this just how |
Yes
That's my concern. Maybe a new method? |
|
I was also thinking of |
I don't recall mink having such a method but we should be able to add this behaviour manually (find all the elements via the dom crawler, get their text, then assert if the expected text is contained within) |
I keep getting annoyed when using
assertSeeIn()
as the CSS selection often does not do what I expect.Say I have a table in my page:
If I want to check that
Bar
is present, I would expect to be able to use:$this->assertSeeIn('td', 'Bar')
.This will work for
Foo
as it's the firsttd
that the crawler will encounter, but to matchBar
I have to use:$this->assertSeeIn('tr td:last-child', 'Bar')
I expect
assertSeeIn
to find a string in ANY element that matches the$selector
.Is this the expected/desired behaviour? If so then something in the docs about it would be good, but personally I don't think it's the right behaviour - I don't want to couple my tests so tightly to the exact HTML - in this case I just want to check the
Bar
is shown somewhere in the table, I don't care about its exact position.Any thoughts?
Cheers
The text was updated successfully, but these errors were encountered: