Closed patrickdreyer closed 10 years ago
@stof I removed the mink_driver parameter and only left the wunit one. As we don't wanna force the usage of wunit, it shall remain disabled by default.
Additionally, I added the support for redirects using wunit. For this to work, we need to intercept any calls to CApplication.end() to properly handle it. This is all taken care of by the MinkWUnitDriver extension. However, for YiiExtension creating the correct application, we need to tweak it a little.
@patrickdreyer I think the parmaeter should stay named mink_driver
(for consistency with the Symfony extension and because it is clearer IMO). If you don't enable the MinkWUnitDriver in the extension, you will not need to use WUnit as it is used only by the driver.
@stof I assume the pull request is now fine with the changes on the wunit
node definition.
I still think this setting should be named mink_driver
(or mink_session
as it technically registers a session). It is a better description of what this node is doing
By using canBeUnset()
we satisfy both expectations, either one uses wunit: true
or wunit: ~
for activating the WUnit driver.
Please have a look at http://docs.behat.org/cookbook/behat_and_mink.html#installing-mink about how to activate the Mink drivers Goutte and Selenium2.
An extension providing additional Mink drivers is expected to behave just the same as the Mink extension itself, thus to activate a driver one simply uses the syntax <driver name>: ~
.
Let's make an example for activating goutte, selenium2, symfony2 and wunit, making wunit the default session:
# behat.yml
default:
extensions:
Behat\MinkExtension\Extension:
goutte: ~
selenium2: ~
default_session: wunit
Behat\Symfony2Extension\Extension:
mink_driver: true
Behat\YiiExtension\Extension:
wunit: ~
another_mink_driver_tailored_for_Yii: ~
@stof, this is why I do not agree in renaming wunit
to mink_driver
.
Please accept the pull request #8, so that waiting developers #10 can finally get advantage of the WUnit support.
Many thanks.
@patrickdreyer what could be another driver tailored for Yii ? And wunit: ~
does not tell anything about being related to Mink
@stof please stop playing ping-pong and provide your solution you have in mind. This salami tactic gets one crazy. For now I assume you have the following in mind:
Behat\YiiExtension\Extension:
mink_driver: true
wunit: ~
Whereas we can even skip the wunit line altogether, as wunit is the only existing Yii mink driver. Right?
Now, just to make my curiosity happy, what do you have in mind if we get a second Yii mink driver? Please provide an example yml configuration.
I always said to name the config key mink_driver
instead of naming it wunit
.
and what sort of second Yii Mink driver would you get ? anyway, if we ever get such a second driver in the future, its support will be provided for Behat 3/MinkExtension 2, not for Behat 2.5/MinkExtension 1.x, so enabling it would not be done in the config of the YiiExtension anyway.
Done: wunit -> mink_driver I also added the changed README.md. Let me know if this would screw up this pull request. If so, I will remove it and add it later on.
Thanks for the explanation about additional drivers and that we would treat it different in Behat 3.
@stof please note, the whole README.md is a copy&paste from the latest version. I don't wanna change any content except the wunit -> mink_driver stuff right now. Nevertheless, your points are all valid and I happily addressed them immediately afterwards. If you don't agree, I simply remove README.md, but then the latest README.md will stay wrong. Did you get the point?
if the whole readme is a copy-paste, why does it appear as a new file ?
I was an absolute newbie regarding github when I started working on all this. Thus, I added the README independent of my separate fork branch for adding the wunit support :-( If this is confusing, let's get the README file out for know and I change it right after.
@everzet I don't have access to this repo (probably the only one of the organization in this case). Can you add it the repo I can write to ?
OK, I understood why this happens: your branch was created before the readme was added in the repo. I have rebased the branch locally to have a clean commit in the history of the readme instead of a conflicting copy-paste. Thanks for this.
I updated the extension to rely on Behat 2.5 rather than 2.4.
I'm not a Yii user. Tell me if it works fine for you. If it does, I suggest tagging the extension as 1.0.
Looks like you can read my mind. Will do and update whatever required (e.g. readme), but most probably not before next week.
Rely on Behat 2.5 looks good, go may ahead for tagging 1.0.
Added the wunit session and have it loaded by the extension if mink_driver is set to true. Adapted the yii extension to look like the mink extension.
@stof: Considered your comment about class checking in my pull request #7.