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

fix: switch cleanly between driver types per-file #23

Merged
merged 1 commit into from
May 4, 2016

Conversation

dbushong
Copy link
Member

@dbushong dbushong commented May 3, 2016

Currently if you use { driver: 'wd' } in the beforeHook()
options of one file and { driver: 'sync' } in another, the
browser will still point at the previous driver's browser
object - this fixes that.

  • wait for promise resolution after createDriver()
  • save the browser from the result - the rest is just the same testium obj
  • when using cached factory.instance, reset testium.browser

@jkrems
Copy link
Member

jkrems commented May 3, 2016

Did we test this when combined with testium-mocha's browser.__proto__ magic?

The change itself: LGTM

Currently if you use `{ driver: 'wd' }` in the beforeHook()
options of one file and `{ driver: 'sync' }` in another, the
`browser` will still point at the previous driver's browser
object - this fixes that.

* wait for promise resolution after createDriver()
* save the browser from the result - the rest is just the same `testium` obj
* when using cached `factory.instance`, reset `testium.browser`
@dbushong dbushong force-pushed the dpb-safe-driver-switching branch from 4bf0c90 to 5087c11 Compare May 4, 2016 20:45
@dbushong
Copy link
Member Author

dbushong commented May 4, 2016

ok, added a test which fails with the old behavior and succeeds with the new, testing successive calls to getTestium()

@jkrems
Copy link
Member

jkrems commented May 4, 2016

:shipit:

@dbushong dbushong merged commit 3d909fc into master May 4, 2016
@dbushong dbushong deleted the dpb-safe-driver-switching branch May 4, 2016 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants