Skip to content

Python ExpectedCondition "Or" "And" "Not" #7121

@GQAssurance

Description

@GQAssurance

🚀 Feature Proposal

Copy the ExpectedConditions "Or", "And", and "Not" from the Java library to the Python library.

Motivation

  • "Or" will simplify logic & speed up execution in tests when we need only 1 of several possible expected conditions to appear.
  • "And" may simplify logic in tests where we need all of several conditions to appear.
  • "Not" may increase code readability

Example

e.g. "Or": During A/B testing of a website, it is unknown which of 2 elements will be served every page load. The "Or" expected condition can ensure the test is unblocked as soon as either of them displays.

e.g. "Or": A user may or may not be shown a splash screen before the login-screen. Using "Or", a single test can begin execution as soon as it confirms that either a splash element or a login element is visible.

e.g. "And": A test may wish to confirm the visibility of multiple elements before continuing. (This functionality can be easily synthesized in test code, but using the "And" expected condition might create clearer code.)

e.g. "Not": A test may wish to wait for an element to disappear before continuing.
(This functionality can be easily synthesized in test code, AND it's often better to use the inverse ExpectedCondition, but using the "Not" expected condition might make clearer code.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-pyPython Bindings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions