Skip to content

Commit

Permalink
NEW: clean from more Collection.* deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaka committed Sep 14, 2022
1 parent 94be143 commit 7c65994
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 40 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,20 @@

- "merge" element.execute_script with element._execute_script

## 2.0.0b10 (to be released on xx.09.2022)
## 2.0.0b11 (to be released on 14.09.2022)
- TODO: trim text in have.exact_text

## 2.0.0b9 (to be released on 14.09.2022)
## 2.0.0b10 (to be released on 14.09.2022)

### NEW: BREAKING CHANGE: removed deprecated selene.core.entity.Collection.:

- `caching(self)` in favor of `cashed(self)`
- `all_by(self, condition) -> Collection` in favor of `by(conditioin)`
- `filter_by(self, condition) -> Collection` in favor of `by(condition)`
- `find_by(self, condition) -> Element`
- `size(self) -> int` in favor of `__len__(self)`

## 2.0.0b9 (released on 14.09.2022)

### NEW: `browser.all(selector).by(condition)` to filter collection

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Tests with Selene can be built either in a simple straightforward "selenide' sty

## Versions

* Latest recommended version to use is >= [2.0.0b6](https://pypi.org/project/selene/2.0.0b6/)
* Latest recommended version to use is >= [2.0.0b10](https://pypi.org/project/selene/2.0.0b10/)
* it's a completely new version of selene, with improved API and speed
* supports 3.7 <= python <= 3.10,
* bundled with Selenium = 4.1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "selene"
version = "2.0.0b9"
version = "2.0.0b10"
description = "User-oriented browser tests in Python (Selenide port)"
authors = ["Iakiv Kramarenko <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion selene/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@
# """
# todo: add here some type imports like Element, Collection, etc.

__version__ = '2.0.0b9'
__version__ = '2.0.0b10'
35 changes: 0 additions & 35 deletions selene/core/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,41 +1020,6 @@ def get_actual_webelements(self) -> List[WebElement]:
)
return self()

def caching(self) -> Collection:
warnings.warn(
"deprecated; use `cached` property instead: browser.all('#foo').cached",
DeprecationWarning,
)
return self.cached

def all_by(self, condition: Condition[Element]) -> Collection:
warnings.warn(
"deprecated; use `filtered_by` instead: browser.all('.foo').filtered_by(be.enabled)",
DeprecationWarning,
)
return self.filtered_by(condition)

def filter_by(self, condition: Condition[Element]) -> Collection:
warnings.warn(
"deprecated; use `filtered_by` instead: browser.all('.foo').filtered_by(be.enabled)",
DeprecationWarning,
)
return self.filtered_by(condition)

def find_by(self, condition: Condition[Element]) -> Element:
warnings.warn(
"deprecated; use `element_by` instead: browser.all('.foo').element_by(be.enabled)",
DeprecationWarning,
)
return self.element_by(condition)

def size(self):
warnings.warn(
"deprecated; use `len` standard function instead: len(browser.all('.foo'))",
DeprecationWarning,
)
return len(self)

def should_each(self, condition: ElementCondition) -> Collection:
# warnings.warn(
# "deprecated; use `should` method instead: browser.all('.foo').should(have.css_class('bar'))",
Expand Down

0 comments on commit 7c65994

Please sign in to comment.