selene

User-oriented Web UI browser tests in Python

MIT License

Downloads
27.5K
Stars
666
Committers
45

Bot releases are visible (Hide)

selene - 2.0.0b8

Published by yashaka about 2 years ago

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.

selene - 2.0.0b7

Published by yashaka about 2 years ago

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:
selene - 2.0.0b6

Published by yashaka about 2 years ago

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()
      
selene - 2.0.0b5

Published by yashaka over 2 years ago

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)
    
selene - 2.0.0b4

Published by yashaka over 2 years ago

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
selene - 2.0.0b3

Published by yashaka over 2 years ago

Python 3.10.* Support

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

Published by yashaka over 2 years ago

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
selene - 2.0.0b1

Published by yashaka over 2 years ago

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...
selene - 2.0.0a40

Published by aleksandr-kotlyar about 3 years ago

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)

selene - 2.0.0a39

Published by yashaka about 3 years ago

Upgrade webdriver-manager 3.4.1 -> 3.4.2

selene - 1.0.2

Published by aleksandr-kotlyar over 3 years ago

fixes broken 1.0.1

selene - 2.0.0a38

Published by aleksandr-kotlyar over 3 years ago

selene - 2.0.0a37

Published by aleksandr-kotlyar over 3 years ago

selene - 2.0.0a36

Published by aleksandr-kotlyar over 3 years ago

Release notes in one word: poetry!

We moved to poetry for better dependency resolving.
But don't worry! It affects only selene development lifecycle and selene contributors.

  • Moved from Pipenv to Poetry as a greater python dependency resolver of 2021 (see #302).
  • Moved to a new release process with Poetry: added bash aliases (see #304).
  • Moved from setup.py and setup.cfg to Poetry's pyproject.toml config-file.
  • Updated README.md Release process with new poetry aliases.
  • Updated CONTRIBUTING.md with black and pylint information.
selene - 2.0.0a6

Published by yashaka almost 5 years ago

fixed entity.with_(...)

Complete reincarnation of Selene for python version >= 3.7 :)

Current limitations

  • no test coverage;

  • do updated docs

    • you can check the only one working test at tests/acceptance/shared_browser/straightforward_style_test.py
    • and use it as a fast intro
    • keep in mind that it describes old style + new style;
    • so you will not see there some guides for newer style; wait for that;)
  • no hooks (and so no screenshots in error messages);

  • no temporal support for 1.0.0 aliases for some methods

    • will be added as deprecated and kept for some time to allow smoother migration
  • old implementation of everything still exists in selene.support.past.*

selene - 1.0.1

Published by yashaka almost 5 years ago

Marking latest master version as stable:)

selene - releasing 1.0.0a9 with upcoming breaking changes and new api entry point

Published by yashaka almost 7 years ago

releasing 1.0.0a9 with selene.browser.* over deprecated selene.tools.*; config.base_url over deprecated config.app_host; and new selene api entry point as 'from selene.api import *'

selene - v1.0.0a13 Alpha release

Published by SergeyPirogov almost 7 years ago

  • PhantomJS deleted
  • W3C actions fix
Package Rankings
Top 3.45% on Pypi.org
Badges
Extracted from project README
tests codecov MIT License Downloads Project Template Code style: black Join telegram chat https://t.me/selene_py Присоединяйся к чату https://t.me/selene_py_ru Sign up for a course https://autotest.how/sdet-start Запишись на курс https://autotest.how/sdet-start-ru Реєструйся на курс https://autotest.how/sdet-start-uk
Related Projects