-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed #51: Merge branch 'SergeyPirogov-feature/env-config-variables'
- Loading branch information
Showing
4 changed files
with
39 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
# todo: make the properties also "object oriented" to support different configs per different SeleneDriver instances | ||
# todo: make the properties also 'object oriented' to support different configs per different SeleneDriver instances | ||
import itertools | ||
import os | ||
import time | ||
|
||
from selene.browsers import Browser | ||
from selene.helpers import env | ||
|
||
timeout = 4 | ||
poll_during_waits = 0.1 | ||
app_host = '' | ||
|
||
timeout = env('selene_timeout') or 4 | ||
poll_during_waits = env('selene_poll_during_waits') or 0.1 | ||
|
||
base_url = env('selene_base_url') or '' | ||
app_host = None | ||
# todo: we may probably refactor selene.config to selene.browser.config where config - is an object, not a module | ||
# todo: then it would be better to add warnings.warn("use base_url instead", DeprecationWarning) | ||
|
||
# todo: make cashing work (currently will not work...) | ||
cash_elements = False | ||
"""To cash all elements after first successful find | ||
config.cash_elements = True""" | ||
cash_elements = env('selene_cache_elements') == 'True' or False | ||
'''To cash all elements after first successful find | ||
config.cash_elements = True''' | ||
|
||
browser_name = env('selene_browser_name') or Browser.FIREFOX | ||
|
||
maximize_window = False if env('selene_maximize_window') == 'False' else True | ||
|
||
hold_browser_open = env('selene_hold_browser_open') == 'True' or False | ||
|
||
browser_name = Browser.FIREFOX | ||
maximize_window = True | ||
hold_browser_open = False | ||
counter = itertools.count(start=int(round(time.time() * 1000))) | ||
|
||
screenshot_folder = os.path.join(os.path.expanduser("~"), | ||
".selene", | ||
"screenshots", | ||
str(next(counter))) | ||
screenshot_folder = env('selene_screenshot_folder') or os.path.join(os.path.expanduser('~'), | ||
'.selene', | ||
'screenshots', | ||
str(next(counter))) | ||
|
||
desired_capabilities = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters