Additional Questions
These are the Questions added in ScreenPy Appium.
Attribute
-
class Attribute(attribute: str)
Ask about an attribute on an element.
- Abilities Required:
UseAnAndroidDevice
UseAnIOSDevice
Examples:
the_actor.should(
See.the(
Attribute("value").of_the(NAME_INPUT), ReadsExactly("Jessica Walters")),
),
See.the(
Attribute("aria-label").of_the(BALLOONS), ContainsTheText("balloon")),
),
)
-
of_the(target: Target) → Attribute
Target the element to get the attribute from.
-
of(target: Target) → Attribute
Target the element to get the attribute from.
-
of_the_first_of_the(target: Target) → Attribute
Target the element to get the attribute from.
-
of_all(target: Target) → Attribute
Target the elements, plural, to get the attribute from.
Element
-
class Element(target: Target)
Ask to retrieve a specific element.
- Abilities Required:
UseAnAndroidDevice
UseAnIOSDevice
Examples:
the_actor.should(See.the(Element(SURVEY_RESULT), IsVisible()))
List
-
class List(target: Target)
Ask for a list of elements.
- Abilities Required:
UseAnAndroidDevice
UseAnIOSDevice
Examples:
the_actor.should(See.the(List.of(CONFETTI), IsEmpty()))
-
static of_the(target: Target) → List
Target the element(s) to list.
-
static of_all_the(target: Target) → List
Target the element(s) to list.
-
static of_all(target: Target) → List
Target the element(s) to list.
-
static of(target: Target) → List
Target the element(s) to list.
Number
-
class Number(target: Target)
Ask how many of a certain element are on the page.
Note that in Android, this will only retrieve elements which are currently
included in the viewport. On iOS, this will retrieve every element.
- Abilities Required:
UseAnAndroidDevice
UseAnIOSDevice
Examples:
the_actor.should(See.the(Number.of(SEARCH_RESULTS), IsEqualTo(4)))
-
classmethod of(target: Target) → Number
Target the element to be counted.
Text
-
class Text(target: Target, multi: bool = False)
Ask what text appears in an element or elements.
- Abilities Required:
UseAnAndroidDevice
UseAnIOSDevice
Examples:
the_actor.should(
See.the(Text.of_the(WELCOME_HEADER), ReadsExactly("Welcome!"))
)
the_actor.should(
See.the(Text.of_all(SEARCH_RESULTS), ContainsTheItem("Rear Window"))
)
-
static of_the(target: Target) → Text
Target the element to extract the text from.
-
static of(target: Target) → Text
Target the element to extract the text from.
-
static of_the_first_of_the(target: Target) → Text
Target the element to extract the text from.
-
static of_all(multi_target: Target) → Text
Target the elements, plural, to extract the text from.