-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Behat] [Travis] Made Behat waiting for resources to appear #3344
[Behat] [Travis] Made Behat waiting for resources to appear #3344
Conversation
e4fa3d6
to
84e1241
Compare
@pamil Could you just quickly explain what is the point of this change? :) |
for ($i = 0; $i < $limit; ++$i) { | ||
$payload = $callback($emergencyExit); | ||
|
||
if ($forceBreak) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could simply use null !== $payload
and get rid of this emergencyExit
. It will make code more readable and less 'magic' 😉 `
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I made it a little bit overcomplicated. Wanted to add ability to wait for null
values, but it seems like there's no real use case for this :)
@pjedrzejewski our test suites are likely to fail if there's no resource they're looking for. I can't find the real example on Travis (because we rerun these failed jobs), but it seems like we want to do something with resource we created earlier, but there is no the resource yet. Like we have just created shipping method "Foo" and the next step is to check whether we are on the page of shipping method "Foo" - it tries to find "Foo" in database but there's none. I may be wrong, but it may fix some issues, if not - there are no real drawbacks. |
@pjedrzejewski found one - https://travis-ci.org/Sylius/Sylius/jobs/82529613 IMHO it's more likely to happen in Javascript suite, but I've also seen it in some non-JS suites. The JS-related issue may have something in common with the way Selenium2 and its driver works, it may not wait for the whole page to load. Anyway, it would be great if you rerun that job :) |
84e1241
to
e928253
Compare
e928253
to
8a683da
Compare
[Behat] [Travis] Made Behat waiting for resources to appear
Much better now 😄 Thanks! |
[Behat] [Travis] Made Behat waiting for resources to appear
Added controlled timeouts to "I am on specific page" and "resource should be created" steps.