Skip to content
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

[5.7] Assert that response contains strings in a specific order #22853

Closed
wants to merge 19 commits into from
Closed

[5.7] Assert that response contains strings in a specific order #22853

wants to merge 19 commits into from

Conversation

helmut
Copy link
Contributor

@helmut helmut commented Jan 19, 2018

As discussed in the internals message board here is a proposed implementation for some additional assertions that can check the response for strings ensuring they appear in a particular order. This is especially important when testing sorting functionality.

For example:

$response->assertSeeInOrder(['foo', 'bar', 'baz']);

No stress if you guys don't want to include this in the core or have a better way to implement.

@helmut helmut changed the title Assertions that response contains strings in a specific order. Assert that response contains strings in a specific order Jan 19, 2018
@helmut
Copy link
Contributor Author

helmut commented Jan 19, 2018

Looks like the build failed due to commits unrelated to this pull request in the master branch.

@GrahamCampbell GrahamCampbell changed the title Assert that response contains strings in a specific order [5.7] Assert that response contains strings in a specific order Jan 19, 2018
@GuidoHendriks
Copy link
Contributor

Wouldn't a assertSeeTextInOrder make sense as well?

@sisve
Copy link
Contributor

sisve commented Jan 19, 2018

Could someone enlighten me about these test methods and their difference for the old system that was moved out to https://github.com/laravel/browser-kit-testing with the introduction of Dusk. Aren't we just introducing the architecture extracted away back into the framework one method at a time?

@helmut
Copy link
Contributor Author

helmut commented Jan 19, 2018

@GuidoHendriks That's in there... take a look at the files changed.
@sisve Correct me if I'm wrong but I don't believe you could ever actually do this with the browser kit testing. I'm not suggesting we bring back all of the browserkit stuff - just a bit more support on top of the basic assertSeeto check for items in a specific order.

@GuidoHendriks
Copy link
Contributor

@helmut Sorry about that. Not sure how I missed that, I specifically looked for that.

@deleugpn
Copy link
Contributor

@sisve in a way,I believe browser-kit-testing was the friendly deprecation that sometimes you miss. With Dusk, it was moved to a package in order to be removed from the framework and make room for tests focused only in the application itself without the mentality that we're trying to cover the lack of a real browser. A lot of stuff was just renamed, which would be breaking. At least that's how I look at it: a rework with a different mindset.

@taylorotwell
Copy link
Member

@sisve Browser Kit was unusable basically for all modern applications that rely on JavaScript.

@sisve
Copy link
Contributor

sisve commented Jan 21, 2018

@taylorotwell I understand that, but these new methods that are slowly merged back in has the exact same problem. And this new test code has assertSee/assertDontSee/assertSeeText/assertDontSeeText, and the extracted browserkit package has see/dontSee/seeText/dontSeeText. I guess I am wondering why the previous code was extracted out, if the functionality should be kept.

@taylorotwell
Copy link
Member

@sisve sorry... wasn't thinking clearly on my last response and was commenting as if this was a PR to the Dusk repository 🤕

@taylorotwell taylorotwell changed the base branch from master to 5.6 January 23, 2018 13:56
@taylorotwell
Copy link
Member

This would go to 5.6 branch.

@helmut
Copy link
Contributor Author

helmut commented Jan 24, 2018

Just to be clear, are you asking me to submit this again to the 5.6 branch?

@deleugpn
Copy link
Contributor

Yes, that's what he said.

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

Successfully merging this pull request may close these issues.

6 participants