chenglou / node-huxley

Codeless front-end testing.
MIT License
361 stars 29 forks source link

Take control of instances of injected driver. #55

Closed mCzolko closed 10 years ago

mCzolko commented 10 years ago

I forgot a little thing. When you run f.e.: record, recoding creates an instance of webdriver and after calls method quit() after recoding is complete. Then starts playback which creates a new instance of webdriver. Injected driver must be pass as anonymous function to get control of instances (as you can see in commit diff).

chenglou commented 10 years ago

lol damn, so it didn't work before? Since huxley would be trying to access stuff like driver.takeScreenshot() of a function rather than the returned driver.

mCzolko commented 10 years ago

it didnt work before, sorry, my bad. I cannot continue quited driver any more (quit() method called on browser driver)

chenglou commented 10 years ago

Ok. So this PR will fix everything? Also, might wanna write a test that injects a mock driver to see if everything goes alright.

mCzolko commented 10 years ago

yeah, it fix everything. And I wrote a test that injects driver before. But you are the only one who can run the test, just because I dont have the same environment as you. (All these commits are about testing with huxley in team :) )

chenglou commented 10 years ago

Oh wait, yeah... Alright, pulling this in.

mCzolko commented 10 years ago

thank you