Releases: yashaka/selene
2.0.0b8
Report to Allure in one shot
NEW: selene.support._logging.wait_with(context, translations)
Added selene.support._logging experimental module with «predefined recipe» of wait_decorator for easier logging of Selene waiting commands (yet riskier, cause everything marked as experimental is a subject to change).
Now, given added allure dependency to your project, you can configure logging Selene commands to Allure report as simply as:
from selene.support.shared import browser
from selene import support
import allure_commons
browser.config._wait_decorator = support._logging.wait_with(
context=allure_commons._allure.StepContext
)
... or implement your own version of StepContext – feel free to use Alure's context manager as example or the one from Selene's browser__config__wait_decorator_with_decorator_from_support_logging_test.py test.
You also can pass a list of translations to be applied to final message to log, something like:
from selene.support.shared import browser
from selene import support
import allure_commons
browser.config._wait_decorator = support._logging.wait_with(
context=allure_commons._allure.StepContext,
translations=(
('browser.element', '$'),
('browser.all', '$$'),
)
)
But check the default value for this parameter, maybe you'll be fine with it;)
And remember, the majority of selene extensions from the support.* package, including its _logging
module – are things you'd better implement on your side to be less dependent to 3rd party helpers;) Feel free to Copy&Paste it into your code and adjust to your needs.
2.0.0b7
Better version of config._wait_decorator
- BREAKING_CHANGE: change type of config._wait_decorator to access entities, not just commands on them
- from
Callable[[F], F]
- to
Callable[[Wait[E]], Callable[[F], F]]
- i.e. now it should be not a simple decorator
that maps function F to a new F with for example added logging,
but it should be «decorator with parameter»
or in other words – a «decorator factory» function
that based on passed parameter of Wait type will return an actual decorator
to be applied to the main logic of waiting inside Wait#for_ method. - This change will allow inside the decorator
to access entities (browser, element, element-collection),
for example, to log them too;) - see examples at:
- simpler one: examples/log_all_selene_commands_with_wait.py
- more «frameworkish» one: examples/log_all_selene_commands_with_wait__framework
- from
2.0.0b6
Opera & Edge for shared.browser, click_by_js and decorating hook for all waits to log commands
-
NEW: added "opera" and "edge" support for shared browser
-
example:
from selene.support.shared import browser # browser.config.browser_name = 'opera' browser.config.browser_name = 'edge'
-
-
NEW: added config._wait_decorator
- decorating Wait#for_ method
- that is used when performing any element command
and assertion (i.e. should) - hence, can be used to log corresponding commands with waits
and integrate with something like allure reporting;)
- that is used when performing any element command
- prefixed with underscore, indicating that method is experimental,
and can be e.g. renamed, etc. - see example at examples/log_all_selene_commands_with_wait.py
- decorating Wait#for_ method
-
NEW: added config.click_by_js #420
-
for usage like in:
from selene.support.shared import browser # browser.config.click_by_js = True # ''' # if we would want to make all selene clicks to work via JS # as part of some CRAZY workaround, or maybe to make tester faster o_O :p # (it was a joke, nothing will be much faster :D with click via js) # ''' button = browser.element('#btn').with_(click_by_js=True) ''' to make all clicks for element('#btn') to work via js as part of some workaround ;) ''' button.click() ... button.click()
-
2.0.0b5
browser.all('[id^=google_ads]').perform(command.js.remove)
- NEW: added command.js.*:
- remove
- set_style_display_to_none
- set_style_display_to_block
- set_style_visibility_to_hidden
- set_style_visibility_to_visible
Example:
browser.all('[id^=google_ads]').perform(command.js.remove)
2.0.0b4
Upgrade Selenium to 4.2.0 and Webdriver-manager to 3.7.0 + FIXES
- NEW: upgrade selenium to 4.2.0
- NEW: upgrade webdriver-manager to 3.7.0
- IMPORTANT:
- if you used
webdriver_manager.utils
in imports, like in:from webdriver_manager.utils import ChromeType
- then you have to upgrade them to
webdriver_manager.core.utils
, like in:from webdriver_manager.core.utils import ChromeType
- if you used
- IMPORTANT:
- FIX: set_window_size in shared.browser.open
- FIX: provide correct chrome type for wdm
2.0.0b3
2.0.0b2
2.0.0b1
Support Selenium 4
- added support selenium 4.1 #375
- the =4.1 version is frozen/hardcoded as dependency
- without backwards compatibility to selenium 3
- the newly added service arg have been added to automatic driver management on the selene side
- yet, if anyone needs backwards compatibility, we can consider implementing it in following patches, feel free to file an issue;)
- the newly added service arg have been added to automatic driver management on the selene side
- without backwards compatibility to selenium 3
- fixed #398
- the =4.1 version is frozen/hardcoded as dependency
- Upgrade webdriver-manager 3.5.0 -> 3.5.3 (see changes)
- removed deprecation
- from:
- collection.should_each(element_condition)
- reason:
- making collection.should(condition) so smart that it can accept both collection_condition and element_condition might be not a good idea – it violates KISS
- maybe keeping things simpler with extra method like should_each is better...
- let's see...
- reason:
- element.send_keys(keys)
- reason:
- yes, send_keys is low level, but sometimes somebody needs this low level style, because of the nature and context of send_keys usage, like sending keys to hidden fields
- yet not sure about this decision... let's see...
- reason:
- collection.should_each(element_condition)
- from:
2.0.0a40
Bump webdriver_manager 3.4.2 -> 3.5.0
webdriver_manager 3.5.0 release notes that can be useful for selene
- Download IEDriverServer from GitHub (SergeyPirogov/webdriver_manager#227)