webdriver_manager and pylenium.json defaults
1.4.1 - 2020-04-17
Added
webdriver_manager
This is the biggest change made in this release. Pylenium now uses webdriver_manager
to install the necessary driver binaries to the user's machine automatically!
This means that the user does NOT need to worry about installing them anymore!
Of course, they will still need the actual browser installed, but that's much easier than installing the driver binaries and adding them to the PATH.
This is a great step in making UI Automation with Pylenium a pleasant experience for everyone :)
pylenium.json defaults
Prior to this release, we would install a pylenium.json
file at the Project Root alongside our conftest.py. The issue is that this JSON file was meant to be an easy way to control Pylenium's settings (which it was), but is overriden every time they would update to a new version of Pylenium...
This also caused issues in CI/CD pipelines because they could not rely on this file to configure Pylenium since installing it fresh in the pipeline would give you a fresh pylenium.json...
This is now taken care of! We are using our BaseModel classes to use defaults that can be overriden two different ways:
- They can still override them using the CLI options. For example:
pytest tests --browser='opera'
- They can create a
pylenium.json
at the Project Root (same dir as conftest.py) with the values they want to override. They can also include any other key/value pairs in thecustom
object:
// pylenium.json
{
driver: {
"wait_time": 5
}
custom = {
"foo": "bar"
}
}
# use it in code
py.config.custom.get('foo') # => yields "bar"
---or---
py.config.custom['foo'] # => yields "bar"