Skip to content

Add methods for handling A/B testing, where different versions of sites could appear #3860

Closed
@mdmintz

Description

@mdmintz

Add methods for handling A/B testing, where different versions of sites could appear


Eg. There are three versions of a site, one with an h1, but not h2 or h3, another with an h2, but not h1 or h3, and another with h3, but not an h1 or h2. There should be a way to verify that at least one of these elements is visible, but not necessarily all of them at the same time.

Here are the methods I plan to add to handle this:

self.wait_for_any_of_elements_visible(*args, **kwargs)
self.wait_for_any_of_elements_present(*args, **kwargs)
self.assert_any_of_elements_visible(*args, **kwargs)
self.assert_any_of_elements_present(*args, **kwargs)

Those will be built to allow flexible inputs. (Eg. Multiple args or a list of args):

self.wait_for_any_of_elements_visible("h1", "h2", "h3")  # Multiple args
self.wait_for_any_of_elements_visible(["h1", "h2", "h3"])  # A list of args

The default timeout can be changed by adding timeout as a kwarg. (Eg. timeout=5)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions