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

[Behat] [Travis] Made Behat waiting for resources to appear #3344

Merged
merged 1 commit into from
Sep 30, 2015

Conversation

pamil
Copy link
Contributor

@pamil pamil commented Sep 23, 2015

Q A
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
License MIT

Added controlled timeouts to "I am on specific page" and "resource should be created" steps.

@pjedrzejewski
Copy link
Member

@pamil Could you just quickly explain what is the point of this change? :)

for ($i = 0; $i < $limit; ++$i) {
$payload = $callback($emergencyExit);

if ($forceBreak) {
Copy link
Contributor

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' 😉 `

Copy link
Contributor Author

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 :)

@pamil
Copy link
Contributor Author

pamil commented Sep 29, 2015

@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.

@pamil
Copy link
Contributor Author

pamil commented Sep 29, 2015

@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 :)

michalmarcinkowski added a commit that referenced this pull request Sep 30, 2015
[Behat] [Travis] Made Behat waiting for resources to appear
@michalmarcinkowski michalmarcinkowski merged commit e50405f into Sylius:master Sep 30, 2015
@michalmarcinkowski
Copy link
Contributor

Much better now 😄 Thanks!

@pamil pamil deleted the travis-wait-for-resources branch October 26, 2015 15:48
pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
[Behat] [Travis] Made Behat waiting for resources to appear
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.

None yet

3 participants