Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Only works on first scenario #196

Closed
jazerix opened this issue Feb 26, 2015 · 9 comments
Closed

Only works on first scenario #196

jazerix opened this issue Feb 26, 2015 · 9 comments

Comments

@jazerix
Copy link

jazerix commented Feb 26, 2015

I'm currently trying to run behat on windows. I'm running into a problem where only the first scenario works, even though the next one is identical to the first one.

I'm dumping the response headers when printing the current url, and it's totally different.

/**
 * Prints current URL to console.
 *
 * @Then /^print current URL$/
 */
public function printCurrentUrl()
{
    $sess = $this->getSession();
    var_dump($sess->getStatusCode(), $sess->getResponseHeaders());
    echo $this->getSession()->getCurrentUrl();
}

enter image description here

The output is also completely different.

First result gives me this:
enter image description here

The the second one (which is identical to the previous one).
enter image description here

I'm using MinkContext with Laravel

@aik099
Copy link

aik099 commented Feb 27, 2015

No same problem on Linux? Does it work when you swap 2 scenarios?

@jazerix
Copy link
Author

jazerix commented Feb 27, 2015

It doesn't. However I found it to be working when I removed the base_url from my behat.yml file. Even though that doesn't make sense (to me at least), as it prints out the same url :-/

@stof
Copy link
Member

stof commented Feb 27, 2015

@jazerix which Mink driver are you using ?

@jazerix
Copy link
Author

jazerix commented Feb 27, 2015

I'm unsure. This is my behat.yml file :)

default:
    extensions:
        Laracasts\Behat: ~
        Behat\MinkExtension:
            default_session: laravel
            laravel: ~
            show_cmd: %s

@stof
Copy link
Member

stof commented Feb 27, 2015

Can you give me the link to this Laracasts extension ? It is probably the one giving a laravel driver type for MinkExtension

@jazerix
Copy link
Author

jazerix commented Feb 27, 2015

Certainly :) This is the repo https://github.com/laracasts/Behat-Laravel-Extension

@stof
Copy link
Member

stof commented Feb 28, 2015

the issue is the way they are implementing their Mink driver: https://github.com/laracasts/Behat-Laravel-Extension/blob/205a3d217d33d4315d20d0f3497edd65a8b5443e/src/Driver/KernelDriver.php#L23 Here, they are calling the constructor again but without the second argument. this is why subsequent scenarios are broken.

@jazerix
Copy link
Author

jazerix commented Feb 28, 2015

In that case I'm sorry for the inconvenience. I've opened an issue there :) thanks for the help ^^

@stof
Copy link
Member

stof commented Mar 2, 2015

Closing this issue because it is not in MinkExtension itself and the discussion should continue on laracasts

@stof stof closed this as completed Mar 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants