Selene

Latest version: v1.0.2

Safety actively analyzes 685670 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 10 of 16

2.0.0a15

- fixed len(collection) to wait if collection can't be found
- made query.size to work with both element and collection
- element.get(query.size) will return the size of the element (as a Dict)
- collection.get(query.size) will return the size of collection (as int)
- added shared config.save_screenshot_on_failure (True by default)
- added shared config.save_page_source_on_failure (True by default)
- refactored and hardened behaviour of shared config
- refactored waiting (moved base wait impl for entities to config.wait(entity)

2.0.0a14

- removed deprecation from shared.browser.save_screenshot, save_page_source, latest_screenshot, latest_page_source
- since they nevertheless are used internally by selene
- and methods looks like better named than original selenium ones, like `get_screenshot_as_png` :)
- refactored hooks to the style: `config.hook_wait_failure = lambda e: e`
- the hook should be a function that receives failure as argument,
- process it, and return back potentially new failure object
- by default it's just an "identity" function, returning itself
- for shared config the default is overwritten by hook adding screenshot and page_source to the failure message
- to disable default screenshot and page_source on failure
- just do `config.hook_wait_failure = None`
- yet, we may add in future explicit things like `config.screenshot_on_failure = False True by default`
- no other hooks avaialbe so far... somewhen in future we will add more hooks,
- like `config.hook_wait_command`, etc.
- fixed original `collection.all` and `collection.map` implementations (were broken in previous versions)
- marked `collection.all` with FutureWarning (yet unclear what naming would be best)
- renamed `collection.map` to `collection.all_first`, marked it as FutureWarning (yet unclear what naming would be best)
- added collection.collected(finder)
- as a more low level, and more universal approach over collection.all and collection.all_first/map
- given books = browser.all('.books')
- then
- `books.all('.author) == books.collected(lambda book: book.all('.author'))`
- reflects all authors of all books
- `books.all_first('.author) == books.collected(lambda book: book.element('.author'))`
- reflects only first authors of all books
- pay attention... all_first is not same as all(...).first:
- `books.all('.author).first != books.all_first('.author)`
- `books.all('.author).first == books.collected(lambda book: book.all('.author')).first`
- `books.all('.author).first == books.first.element('.author')`
- i.e. reflecting only the first author of the first book
- switched in wait from webdriver TimeoutException to selene.core.exceptions.TimeoutException
- actually no need to reuse webdriver one
- and this might help with reporting selene failure in allure reports, let's see...
- tried to implement something special for configuring remote driver management in shared config...
- but... just left some comments for future...
- it's too complicated to be implemennted in a consistent way in selene.
- so far the main strategy is just to create an instance on your own
- and then set it in config by `config.driver = webdriver.Remote(...)`, KISS ;)

2.0.0a13

- added temporary Collectionfilter_by as deprecated
- added temporary Collectionfind_by as deprecated
- fixed shared browser.latest_screenshot (and added browser.latest_page_source)
- made it as property (as method it will still work as deprecated)
- actually if you `from selene import browser`
- you will get deprecated browser module with latest_screenshot as method
- the warning then will tell you to use import `from selene.support.shared import browser`
- which will have it as a property

2.0.0a12

- fixed [195](https://github.com/yashaka/selene/issues/195): added len(collection)

2.0.0a11

- added logging screenshot and page source hooks for failures of any waiting in shared browser behaviour
- this is enabled by default, no option in config.* to disable such behaviour
- yet you can turn it off by `config.hooks = Hooks(wait=WaitHooks(failure=lambda e: e)`
- but the style/syntax of setting hooks is not completely defined, it may change in future...
- removed SyntaxWarning for element.s and element.ss

2.0.0a10

- enhanced migratability
- added syntax warning to collection.first with a hint
- to use .first as a property over .first() as a method
- added selene.wait.py with wait_for alias (deprecated)
- moved all new modules from selene to selene.core
- old deprecated modules will be removed in beta
- tuned imports to be cleaner
- try to import everything `from selene import ...`
- the main things you might need are: browser, config, by, be, have, Browser, Config
- yet browser here, is old deprecated selene.browser module...
- so temporary import browser from selene.support.shared
- later once selene.browser.py is removed, you can import new browser object from selene too
- only s and ss you will not find there,
- but you can import them from selene.support.jquery_style_selectors as in 1.*
- changed DeprecationWarning to SyntaxWarning for element.s and element.ss

Page 10 of 16

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.