Skip to content

Releases: yashaka/selene

2.0.0b8

05 Sep 17:45
Compare
Choose a tag to compare

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

02 Sep 16:28
Compare
Choose a tag to compare

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:

2.0.0b6

31 Aug 20:03
Compare
Choose a tag to compare

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;)
    • 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
  • 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

24 Jun 16:44
Compare
Choose a tag to compare

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

15 Jun 16:24
Compare
Choose a tag to compare

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
        
  • FIX: set_window_size in shared.browser.open
  • FIX: provide correct chrome type for wdm

2.0.0b3

29 May 19:43
Compare
Choose a tag to compare

Python 3.10.* Support

  • added support of python 3.10.* #393
  • upgraded webdriver-manager to 3.5.4 #408

2.0.0b2

29 Mar 16:30
Compare
Choose a tag to compare

Allow lambda at config.driver

  • first steps on simplifying the current browser management,
    yet making it more powerful
    • now you can pass a lambda to browser.config.driver = HERE
      providing more smart logic of driver management
      see a dummy example at this test

2.0.0b1

22 Feb 09:57
Compare
Choose a tag to compare

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;)
    • fixed #398
  • 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...
      • 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...

2.0.0a40

09 Oct 12:56
296f266
Compare
Choose a tag to compare

Bump webdriver_manager 3.4.2 -> 3.5.0

webdriver_manager 3.5.0 release notes that can be useful for selene

(see full changelist)

2.0.0a39

26 Jul 14:05
Compare
Choose a tag to compare

Upgrade webdriver-manager 3.4.1 -> 3.4.2