PageObjectWhen
public protocol PageObjectWhen : AnyObject
Abstract Page object to provide the default functionality for a concrete Page object.
Attention
None of these methods require a custom implementation. Everything is provided with internal extensions.-
Undocumented
Declaration
Swift
associatedtype Element
-
whenTap(element:coordinates:timeout:swipeAction:)
Default implementationPerforms a tap in a element.
Default Implementation
Declaration
Swift
@discardableResult func whenTap(element: Element, coordinates: CGPoint?, timeout: TimeInterval?, swipeAction: SwipeAction?) -> Self
Parameters
element
Element to tap.
coordinates
Optional coordinates to perform the tap inside the element.
timeout
Optional timeout to wait the visibility of the element.
swipeAction
Optional swipe action to find a not visible cell.
Return Value
itself to use in a chain of calls.
-
whenTapCell(in:at:timeout:swipeAction:)
Default implementationPerforms a tap inside a cell.
Default Implementation
Declaration
Swift
@discardableResult func whenTapCell(in tableView: Element, at index: Int, timeout: TimeInterval?, swipeAction: SwipeAction?) -> Self
Parameters
tableView
Table view where to find the cell.
index
Index of the cell to tap
timeout
Optional timeout to wait the visibility of the element.
swipeAction
Optional swipe action to find a not visible cell.
Return Value
itself to use in a chain of calls.
-
whenTap(coordinates:)
Default implementationPerforms a tap in the screen to a specific coordinate.
Default Implementation
Declaration
Swift
@discardableResult func whenTap(coordinates: CGPoint) -> Self
Parameters
coordinates
Location to tap.
Return Value
itself to use in a chain of calls.
-
whenTapBackButton()
Default implementationPerforms a tap in the back button of a navigation controller.
Default Implementation
Declaration
Swift
@discardableResult func whenTapBackButton() -> Self
Return Value
itself to use in a chain of calls.
-
whenTapAlertButton(at:timeout:)
Default implementationPerforms a tap in an alert view button.
Default Implementation
Declaration
Swift
@discardableResult func whenTapAlertButton(at index: Int, timeout: TimeInterval?) -> Self
Parameters
index
Index of the button to tap.
timeout
Optional timeout to wait the visibility of the element.
Return Value
itself to use in a chain of calls.
-
whenTapActionSheetButton(at:timeout:)
Default implementationPerforms a tap in an action sheet button.
Default Implementation
Declaration
Swift
@discardableResult func whenTapActionSheetButton(at index: Int, timeout: TimeInterval?) -> Self
Parameters
index
Index of the button to tap.
timeout
Optional timeout to wait the visibility of the element.
Return Value
itself to use in a chain of calls.
-
whenType(_:in:shouldReplace:timeout:swipeAction:)
Default implementationPerforms a typing inside an UI element.
Default Implementation
Declaration
Swift
@discardableResult func whenType(_ text: String, in element: Element, shouldReplace: Bool, timeout: TimeInterval?, swipeAction: SwipeAction?) -> Self
Parameters
text
Text to type.
element
Element where to type the text.
shouldReplace
Replace the current text of the element. Default true.
timeout
Optional timeout to wait the visibility of the element.
swipeAction
Optional swipe action to find a not visible cell.
Return Value
itself to use in a chain of calls.
-
whenSelectDatePicker(wheels:timeout:)
Default implementationPerforms the pick of a date from a date picker.
Default Implementation
Declaration
Swift
@discardableResult func whenSelectDatePicker(wheels: [String], timeout: TimeInterval?) -> Self
Parameters
wheels
The day, month and year to pick. (The order depends on the format of your date picker).
timeout
Optional timeout to wait the visibility of the element.
Return Value
itself to use in a chain of calls.
-
whenAcceptLocationRequest()
Default implementationPerforms the tap on the GPS permission request of iOS.
Default Implementation
Declaration
Swift
@discardableResult func whenAcceptLocationRequest() -> Self
Return Value
itself to use in a chain of calls.
-
whenSwipe(_:timeout:)
Default implementationPerforms a swipe in the screen.
Default Implementation
Declaration
Swift
@discardableResult func whenSwipe(_ swipeAction: SwipeAction, timeout: TimeInterval?) -> Self
Parameters
swipeAction
Swipe action to perform.
timeout
Optional timeout to wait the visibility of the element.
Return Value
itself to use in a chain of calls.
-
whenSlide(element:toNormalizedSliderPosition:timeout:)
Default implementationPerforms a scroll in a scrollable view.
Default Implementation
Declaration
Swift
@discardableResult func whenSlide(element: Element, toNormalizedSliderPosition: CGFloat, timeout: TimeInterval?) -> Self
Parameters
element
Scrollable element to scroll.
toNormalizedSliderPosition
Position where to scroll.
timeout
Optional timeout to wait the visibility of the element.
Return Value
itself to use in a chain of calls.