semperos/clj-webdriver — Issue #23: Change parameters for new-driver
Author: semperos
Created: 2011-12-19 23:09:37+00:00
State: open
Labels: new-feature

One of the growing pains of introducing the Driver record and including cache support was changing how to start up a new WebDriver instance. This becomes more complex with each driver (Firefox, Chrome, etc.) supporting advanced functionality specific to that browser (e.g., Firefox profiles which can enable extensions during test runs).

With that in mind, the specification for the `new-driver` function needs to be re-thought. The more I think about it, the more the Driver starts to feel like a configuration mechanism which clj-webdriver should use under the hood to start up the WebDriver instance in whatever way it needs to, with driver-specific private functions that handle the actual instantiation of the appropriate WebDriver classes and just send `init-driver` (which is the function clj-webdriver uses to "construct" the Driver record) a WebDriver instance once its "ready."

In this way, the `new-driver` function should just accept a map of options, much like database-handling code does with functions like `with-connection` which take a map of options for connecting to a data store.