Last active
September 28, 2018 14:18
-
-
Save milanstevanovic/305b4251835c7eaf0dd2d75f5af646b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UIElementPage<T: UIElement>: Page { | |
| override init(element: XCUIElement) { | |
| super.init(element: element) | |
| } | |
| init(root: T) { | |
| super.init(element: Page.app.otherElements[root]) | |
| } | |
| func label(_ element: T) -> XCUIElement { | |
| return self.element.staticTexts[element] | |
| } | |
| func textField(_ element: T) -> XCUIElement { | |
| return self.element.textFields[element] | |
| } | |
| func textView(_ element: T) -> XCUIElement { | |
| return self.element.textViews[element] | |
| } | |
| func staticText(_ element: T) -> XCUIElement { | |
| return self.element.staticTexts[element] | |
| } | |
| func button(_ element: T) -> XCUIElement { | |
| return self.element.buttons[element] | |
| } | |
| func image(_ element: T) -> XCUIElement { | |
| return self.element.images[element] | |
| } | |
| func table(_ element: T) -> XCUIElement { | |
| return self.element.tables[element] | |
| } | |
| func collection(_ element: T) -> XCUIElement { | |
| return self.element.collectionViews[element] | |
| } | |
| func otherElement(_ element: T) -> XCUIElement { | |
| return self.element.otherElements[element] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment