Skip to content

Commit 1173666

Browse files
authored
[tvOS]2nd: tvos build (#149)
* make tvos buildable * remove tvOS tests since currently they does not work * fix screenshot * tweak target os tv * add travis * get rid of xcode9.2 build because of no destination * update yycache to use 1.1.0 * fix fbtvfocuse * fix FBSpringboardApplication * cache hasFocuse * fix FBTVNavigationTracker * fix review * arrange indentations, enable isWDFocused for both ios and tvos * arrange func names, deltas * add self.description into error messages * tweak message
1 parent 038d2d9 commit 1173666

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1694
-20
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,12 @@ matrix:
9898
- os: osx
9999
osx_image: xcode10.2
100100
env: IPHONE_MODEL="iPhone X" IPAD_MODEL="iPad Air 2" IOS_VERSION="12.2" ACTION=int_test_3 DEST=ipad TARGET=lib SDK=sim
101+
102+
# Builds
103+
- os: osx
104+
osx_image: xcode10.2
105+
env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="12.2" ACTION=build TARGET=tv_runner SDK=tv_sim
106+
# Analyze
107+
- os: osx
108+
osx_image: xcode10.2
109+
env: DEST=tv TV_MODEL="Apple TV" TV_VERSION="12.2" ACTION=analyze TARGET=tv_runner SDK=tv_sim

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
github "appium/RoutingHTTPServer" "v1.0.2"
2-
github "appium/YYCache" "1.0.5"
2+
github "appium/YYCache" "1.1.0"
33
github "robbiehanson/CocoaAsyncSocket" "7.6.3"

PrivateHeaders/XCTest/XCEventGenerator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ typedef void (^XCEventGeneratorHandler)(XCSynthesizedEventRecord *record, NSErro
2525
@property unsigned long long generation; // @synthesize generation=_generation;
2626
//@property(readonly) NSObject<OS_dispatch_queue> *eventQueue; // @synthesize eventQueue=_eventQueue;
2727

28-
#if TARGET_OS_IPHONE
28+
#if TARGET_OS_TV
29+
// TODO: tvOS-specific headers
30+
31+
#elif TARGET_OS_IPHONE
2932
- (double)rotateInRect:(CGRect)arg1 withRotation:(double)arg2 velocity:(double)arg3 orientation:(UIInterfaceOrientation)arg4 handler:(XCEventGeneratorHandler)arg5;
3033
- (double)pinchInRect:(CGRect)arg1 withScale:(double)arg2 velocity:(double)arg3 orientation:(UIInterfaceOrientation)arg4 handler:(XCEventGeneratorHandler)arg5;
3134
- (double)pressAtPoint:(CGPoint)arg1 forDuration:(double)arg2 liftAtPoint:(CGPoint)arg3 velocity:(double)arg4 orientation:(UIInterfaceOrientation)arg5 name:(NSString *)arg6 handler:(XCEventGeneratorHandler)arg7;
@@ -43,9 +46,6 @@ typedef void (^XCEventGeneratorHandler)(XCSynthesizedEventRecord *record, NSErro
4346
// iOS 10.3 specific
4447
- (double)forcePressAtPoint:(struct CGPoint)arg1 orientation:(long long)arg2 handler:(CDUnknownBlockType)arg3;
4548

46-
#elif TARGET_OS_TV
47-
// TODO: tvOS-specific headers
48-
4949
#elif TARGET_OS_MAC
5050
- (double)sendKeyboardInputs:(id)arg1 layout:(id)arg2 handler:(CDUnknownBlockType)arg3;
5151
- (double)sendKey:(id)arg1 modifierFlags:(unsigned long long)arg2 handler:(CDUnknownBlockType)arg3;

Scripts/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ function define_xc_macros() {
1616
case "$TARGET" in
1717
"lib" ) XC_TARGET="WebDriverAgentLib";;
1818
"runner" ) XC_TARGET="WebDriverAgentRunner";;
19+
"tv_lib" ) XC_TARGET="WebDriverAgentLib_tvOS";;
20+
"tv_runner" ) XC_TARGET="WebDriverAgentRunner_tvOS";;
1921
*) echo "Unknown TARGET"; exit 1 ;;
2022
esac
2123

2224
case "${DEST:-}" in
2325
"iphone" ) XC_DESTINATION="-destination \"name=${IPHONE_MODEL},OS=${IOS_VERSION}\"";;
2426
"ipad" ) XC_DESTINATION="-destination \"name=${IPAD_MODEL},OS=${IOS_VERSION}\"";;
27+
"tv" ) XC_DESTINATION="-destination \"name=${TV_MODEL},OS=${TV_VERSION}\"";;
2528
esac
2629

2730
case "$ACTION" in
@@ -40,6 +43,8 @@ function define_xc_macros() {
4043
case "$SDK" in
4144
"sim" ) XC_SDK="iphonesimulator";;
4245
"device" ) XC_SDK="iphoneos";;
46+
"tv_sim" ) XC_SDK="appletvos";;
47+
"tv_device" ) XC_SDK="appletvsimulator";;
4348
*) echo "Unknown SDK"; exit 1 ;;
4449
esac
4550
}

WebDriverAgent.xcodeproj/project.pbxproj

Lines changed: 897 additions & 0 deletions
Large diffs are not rendered by default.

WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentLib.xcscheme

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -86,7 +85,6 @@
8685
buildConfiguration = "Debug"
8786
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
8887
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
89-
language = ""
9088
launchStyle = "0"
9189
useCustomWorkingDirectory = "NO"
9290
ignoresPersistentStateOnLaunch = "NO"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1010"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "641EE2C42240BAB800173FCB"
18+
BuildableName = "WebDriverAgentLib_tvOS.framework"
19+
BlueprintName = "WebDriverAgentLib_tvOS"
20+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<AdditionalOptions>
33+
</AdditionalOptions>
34+
</TestAction>
35+
<LaunchAction
36+
buildConfiguration = "Debug"
37+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
38+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
39+
launchStyle = "0"
40+
useCustomWorkingDirectory = "NO"
41+
ignoresPersistentStateOnLaunch = "NO"
42+
debugDocumentVersioning = "YES"
43+
debugServiceExtension = "internal"
44+
allowLocationSimulation = "YES">
45+
<MacroExpansion>
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "641EE2C42240BAB800173FCB"
49+
BuildableName = "WebDriverAgentLib_tvOS.framework"
50+
BlueprintName = "WebDriverAgentLib_tvOS"
51+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
52+
</BuildableReference>
53+
</MacroExpansion>
54+
<AdditionalOptions>
55+
</AdditionalOptions>
56+
</LaunchAction>
57+
<ProfileAction
58+
buildConfiguration = "Release"
59+
shouldUseLaunchSchemeArgsEnv = "YES"
60+
savedToolIdentifier = ""
61+
useCustomWorkingDirectory = "NO"
62+
debugDocumentVersioning = "YES">
63+
<MacroExpansion>
64+
<BuildableReference
65+
BuildableIdentifier = "primary"
66+
BlueprintIdentifier = "641EE2C42240BAB800173FCB"
67+
BuildableName = "WebDriverAgentLib_tvOS.framework"
68+
BlueprintName = "WebDriverAgentLib_tvOS"
69+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
70+
</BuildableReference>
71+
</MacroExpansion>
72+
</ProfileAction>
73+
<AnalyzeAction
74+
buildConfiguration = "Debug">
75+
</AnalyzeAction>
76+
<ArchiveAction
77+
buildConfiguration = "Release"
78+
revealArchiveInOrganizer = "YES">
79+
</ArchiveAction>
80+
</Scheme>

WebDriverAgent.xcodeproj/xcshareddata/xcschemes/WebDriverAgentRunner.xcscheme

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
systemAttachmentLifetime = "keepNever"
3130
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
@@ -48,7 +47,6 @@
4847
buildConfiguration = "Debug"
4948
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5049
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
51-
language = ""
5250
launchStyle = "0"
5351
useCustomWorkingDirectory = "NO"
5452
ignoresPersistentStateOnLaunch = "NO"
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1010"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "641EE2D92240BBE300173FCB"
18+
BuildableName = "WebDriverAgentRunner_tvOS.xctest"
19+
BlueprintName = "WebDriverAgentRunner_tvOS"
20+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "641EE2D92240BBE300173FCB"
36+
BuildableName = "WebDriverAgentRunner_tvOS.xctest"
37+
BlueprintName = "WebDriverAgentRunner_tvOS"
38+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "641EE2D92240BBE300173FCB"
46+
BuildableName = "WebDriverAgentRunner_tvOS.xctest"
47+
BlueprintName = "WebDriverAgentRunner_tvOS"
48+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
53+
</TestAction>
54+
<LaunchAction
55+
buildConfiguration = "Debug"
56+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
launchStyle = "0"
59+
useCustomWorkingDirectory = "NO"
60+
ignoresPersistentStateOnLaunch = "NO"
61+
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
63+
allowLocationSimulation = "YES">
64+
<MacroExpansion>
65+
<BuildableReference
66+
BuildableIdentifier = "primary"
67+
BlueprintIdentifier = "641EE2D92240BBE300173FCB"
68+
BuildableName = "WebDriverAgentRunner_tvOS.xctest"
69+
BlueprintName = "WebDriverAgentRunner_tvOS"
70+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
71+
</BuildableReference>
72+
</MacroExpansion>
73+
<EnvironmentVariables>
74+
<EnvironmentVariable
75+
key = "USE_PORT"
76+
value = "$(USE_PORT)"
77+
isEnabled = "YES">
78+
</EnvironmentVariable>
79+
<EnvironmentVariable
80+
key = "UPGRADE_TIMESTAMP"
81+
value = "$(UPGRADE_TIMESTAMP)"
82+
isEnabled = "YES">
83+
</EnvironmentVariable>
84+
<EnvironmentVariable
85+
key = "MJPEG_SERVER_PORT"
86+
value = "$(MJPEG_SERVER_PORT)"
87+
isEnabled = "YES">
88+
</EnvironmentVariable>
89+
<EnvironmentVariable
90+
key = "WDA_PRODUCT_BUNDLE_IDENTIFIER"
91+
value = "$(WDA_PRODUCT_BUNDLE_IDENTIFIER)"
92+
isEnabled = "YES">
93+
</EnvironmentVariable>
94+
</EnvironmentVariables>
95+
<AdditionalOptions>
96+
</AdditionalOptions>
97+
</LaunchAction>
98+
<ProfileAction
99+
buildConfiguration = "Release"
100+
shouldUseLaunchSchemeArgsEnv = "YES"
101+
savedToolIdentifier = ""
102+
useCustomWorkingDirectory = "NO"
103+
debugDocumentVersioning = "YES">
104+
<MacroExpansion>
105+
<BuildableReference
106+
BuildableIdentifier = "primary"
107+
BlueprintIdentifier = "641EE2D92240BBE300173FCB"
108+
BuildableName = "WebDriverAgentRunner_tvOS.xctest"
109+
BlueprintName = "WebDriverAgentRunner_tvOS"
110+
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
111+
</BuildableReference>
112+
</MacroExpansion>
113+
</ProfileAction>
114+
<AnalyzeAction
115+
buildConfiguration = "Debug">
116+
</AnalyzeAction>
117+
<ArchiveAction
118+
buildConfiguration = "Release"
119+
revealArchiveInOrganizer = "YES">
120+
</ArchiveAction>
121+
</Scheme>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright (c) 2018-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
10+
#import <XCTest/XCTest.h>
11+
#import "FBElement.h"
12+
13+
NS_ASSUME_NONNULL_BEGIN
14+
15+
@interface XCUIApplication (FBFocused)
16+
17+
/**
18+
Return current focused element
19+
*/
20+
- (id<FBElement>)fb_focusedElement;
21+
22+
@end
23+
24+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)