Skip to content

Commit

Permalink
DOCS: review TODOS and mention important in changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaka committed Jul 10, 2024
1 parent 381a1c5 commit 4e0bd58
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
21 changes: 11 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ TODOs:

seems like currently we do raise, but cover with tests

### TODO: conditions can read options from config? commands/queries can read them?

especially relevant for have.texts to turn on/off ignoring invisible elements

### TODO: add `<` before driver.switch_to.* tab in iframe faq doc

### TODO: All and AllElements aliases to Collection (maybe even deprecate Collection)
Expand Down Expand Up @@ -189,21 +185,26 @@ Then we have to consider rething condition.__call__ aliases... And corresponding

`Test` might be also a good candidate over `Match` ... But `Test` does not correlate in `entity.should(Test(actual=..., by=...))

### TODO: consider removing Callable[[], str] as supported type for description in Condition
### TODO: Ensure type errors on element.should(collection_condition), etc.
### TODO: check if there are no type errors on passing be._empty to should

### TODO: decide on ... vs (...,) as one_or_more

### TODO: ensure no warnings

### TODO: rename all conditions inside match.py so match can be fully used instead be + have #530
### TODO: Consider passing Condition instance as by in Match

### TODO: check if there are no type errors on passing be._empty to should
like in `clickable = Match('clickable', by=be.visible.and_(be.enabled))`

### TODO: Consider privatizing Condition actual and by params

should we even refactor out them from Condition and move to Match only?

### Consider making configurable the "filtering collection for visibility" in size condition
### TODO: rename all conditions inside match.py so match can be fully used instead be + have #530

### Consider changing name type from str | Callable[[], str] to str | Callable[[E], str],
### TODO: Consider making configurable the "filtering collection for visibility" in size condition

### Ensure type errors on element.should(collection_condition), etc.
### TODO: Consider changing name type from str | Callable[[], str] to str | Callable[[E], str],

### Deprecated conditions

Expand Down
14 changes: 7 additions & 7 deletions selene/core/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ def each(self) -> Condition[Iterable[E]]:
# as, finally, the test param is more unhandy in straightforward inline usage
# – So far, YES, it seemed like a good idea to get rid of test param in Match
# narrowing the usage for the end user to the most convenient one...
# Hm... but what about redefining conditions based on existing ones?
# TODO: Hm... but what about redefining conditions based on existing ones?
# Imagine:
# $('#save').should(Match('«Save document» is shown', test=be.visible))
# Such case is rare, and looks like not optimal, because there are better
Expand Down Expand Up @@ -1572,7 +1572,7 @@ def __init__(
name = name or (
((str(actual_name) + ' ') if actual_name else '') + str(by_name) # noqa
)
# TODO: fix "cannot infer type of argument 1 of __init__" or ignore
# todo: fix "cannot infer type of argument 1 of __init__" or ignore
super().__init__( # type: ignore
name,
actual=actual, # type: ignore
Expand All @@ -1595,11 +1595,11 @@ def __init__(
# Match(lambda x: x > 0)
# Match(lambda actual: actual - 1, lambda res: res > 0)
# Match('has positive decrement', lambda actual: actual - 1, lambda res: res > 0)
Match(
lambda: 'has positive decrement',
actual=lambda actual: actual - 1,
by=lambda res: res > 0,
)
# Match(
# lambda: 'has positive decrement',
# actual=lambda actual: actual - 1,
# by=lambda res: res > 0,
# )
# Match(
# lambda: 'has positive decrement',
# by=lambda res: res > 0,
Expand Down

0 comments on commit 4e0bd58

Please sign in to comment.