Skip to content

Conversation

@GQAssurance
Copy link
Contributor

@GQAssurance GQAssurance commented Jul 18, 2019

Replicates the functionality of Java's AND / OR / NOT expected conditions.
Because of reserved word constraints in Python, these are named:

OR: any_of(*expected_condition)
AND: all_of(*expected_condition)
NOT: none_of(*expected_condition)

Each function takes an unlimited number of expected_conditions as arguments.

Implements #7121

@GQAssurance GQAssurance changed the title Implement AND OR NOT expected_conditions in Python Implement logical expected conditions in Python Jul 19, 2019
@GQAssurance GQAssurance changed the title Implement logical expected conditions in Python [PY] Implement logical expected conditions in Python Jul 19, 2019
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return True should be outside the for loop.
Many expected conditions sometimes return the element or object you're waiting for.
Should this return a list of all results?

Copy link
Contributor Author

@GQAssurance GQAssurance Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(1) (facepalm) fixed
(2) That's a good idea. the all_of function now returns every EC's result in a list; it could then be parsed for elemental results if needed.

@p0deje p0deje added the C-py Python Bindings label Jul 29, 2019
Replicates the functionality of Java's AND / OR / NOT expected conditions.
Because of reserved word constraints in Python, these are named:

OR:  `any_of(*expected_condition)`
AND: `all_of(*expected_condition)`
NOT: `none_of(*expected_condition)`

Each function takes an unlimited number of expected_conditions as arguments.

Implements SeleniumHQ#7121
@isaulv
Copy link
Contributor

isaulv commented Aug 1, 2019

LGTM.

@GQAssurance
Copy link
Contributor Author

LGTM.

Is there any way I can help get this merged into master?

@AutomatedTester AutomatedTester merged commit ef81299 into SeleniumHQ:master Aug 28, 2019
@GQAssurance GQAssurance deleted the python-logical-ecs branch August 28, 2019 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-py Python Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants