Reuse some iOS code in tvOS UI tests
This commit is contained in:
parent
d8447ddb38
commit
7d327b21d7
|
@ -88,7 +88,7 @@ extension XCUIApplicationProviding where Self: XCTestCase {
|
|||
}
|
||||
|
||||
private func container(for target: ScreenshotTarget) -> XCUIElement {
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(tvOS)
|
||||
app.windows.firstMatch
|
||||
#else
|
||||
switch target {
|
||||
|
|
|
@ -42,14 +42,14 @@ extension XCUIElement {
|
|||
|
||||
private extension XCUIElement {
|
||||
func query(for elementType: AccessibilityInfo.ElementType) -> XCUIElementQuery {
|
||||
#if os(iOS)
|
||||
#if os(iOS) || os(tvOS)
|
||||
switch elementType {
|
||||
case .button, .link, .menu, .menuItem:
|
||||
return buttons
|
||||
case .text:
|
||||
return staticTexts
|
||||
}
|
||||
#elseif os(macOS)
|
||||
#else
|
||||
switch elementType {
|
||||
case .button, .link:
|
||||
return buttons
|
||||
|
@ -60,13 +60,6 @@ private extension XCUIElement {
|
|||
case .text:
|
||||
return staticTexts
|
||||
}
|
||||
#else
|
||||
switch elementType {
|
||||
case .button, .link, .menu, .menuItem:
|
||||
return buttons
|
||||
case .text:
|
||||
return staticTexts
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue