Skip to content

Commit

Permalink
[#528] DOC: add todos and thoughts on default list globs
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaka committed Jun 23, 2024
1 parent 60c18d6 commit 6b7160a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ especially relevant for have.texts to turn on/off ignoring invisible elements

## 2.0.0rc10: «copy&paste, frames, shadow & texts_like» (to be released on DD.05.2024)

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

### TODO: ensure no warnings

### TODO: add `<` before driver.switch_to.* tab in iframe faq doc
Expand Down
9 changes: 9 additions & 0 deletions selene/core/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def __deprecated_is_existing(element: Element) -> bool:
by=lambda actual: actual.is_displayed(),
# TODO: consider adding describe_actual
# describe_actual=lambda actual: (actual and actual.get_attribute('outerHTML')),
# TODO: but implementation should count mobile case...
)
"""Alternative and disabled via protection prefix version of visible condition,
that will result in errors with unclear actual, something like:
Expand Down Expand Up @@ -688,6 +689,14 @@ class _exact_texts_like(Condition[Collection]):
([(...,)], _PredefinedGlobPatterns['zero_or_more']),
)

# TODO: consider this set of list globs as a default
__X_DEFAULT_GLOBS: Tuple[Tuple[Any, str], ...] = (
({...}, _PredefinedGlobPatterns['exactly_one']),
([{...}], _PredefinedGlobPatterns['zero_or_one']),
(..., _PredefinedGlobPatterns['one_or_more']),
([...], _PredefinedGlobPatterns['zero_or_more']),
)

def __init__(
self,
*expected: str | int | float | Iterable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from selene.core import match
from tests.integration.helpers.givenpage import GivenPage

# TODO: review tests: clean up, add more cases if needed, break down into smaller tests,
# todo: review tests: clean up, add more cases if needed, break down into smaller tests,
# find better names for tests
# add more tests for re.DOTALL flag

Expand Down

0 comments on commit 6b7160a

Please sign in to comment.