Skip to content

Port tvOS headers #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ cache:

script: ./Scripts/build.sh

branches:
only:
- master

env:
# Builds
- ACTION=build TARGET=runner SDK=sim
Expand Down
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Used for HTTP routing
github "marekcirkos/RoutingHTTPServer"
github "appium/RoutingHTTPServer"

# Used by the element cache
github "appium/YYCache"

# Used by screenshots broadcaster
github "robbiehanson/CocoaAsyncSocket"
github "robbiehanson/CocoaAsyncSocket"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "appium/YYCache" "1.0.5"
github "marekcirkos/RoutingHTTPServer" "v1.0.1"
github "appium/RoutingHTTPServer" "v1.0.2"
github "robbiehanson/CocoaAsyncSocket" "7.6.3"
1 change: 1 addition & 0 deletions Configurations/ProjectSettings.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ GCC_WARN_UNUSED_PARAMETER = YES
GCC_WARN_UNUSED_VALUE = YES
GCC_WARN_UNUSED_VARIABLE = YES
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES

CLANG_ANALYZER_NONNULL = YES
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
Expand Down
4 changes: 3 additions & 1 deletion PrivateHeaders/XCTest/XCEventGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ typedef void (^XCEventGeneratorHandler)(XCSynthesizedEventRecord *record, NSErro
@property unsigned long long generation; // @synthesize generation=_generation;
//@property(readonly) NSObject<OS_dispatch_queue> *eventQueue; // @synthesize eventQueue=_eventQueue;

#if TARGET_OS_IPHONE
#if TARGET_OS_TV
// TODO: tvOS-specific headers
#elif TARGET_OS_IPHONE
- (double)rotateInRect:(CGRect)arg1 withRotation:(double)arg2 velocity:(double)arg3 orientation:(UIInterfaceOrientation)arg4 handler:(XCEventGeneratorHandler)arg5;
- (double)pinchInRect:(CGRect)arg1 withScale:(double)arg2 velocity:(double)arg3 orientation:(UIInterfaceOrientation)arg4 handler:(XCEventGeneratorHandler)arg5;
- (double)pressAtPoint:(CGPoint)arg1 forDuration:(double)arg2 liftAtPoint:(CGPoint)arg3 velocity:(double)arg4 orientation:(UIInterfaceOrientation)arg5 name:(NSString *)arg6 handler:(XCEventGeneratorHandler)arg7;
Expand Down
6 changes: 6 additions & 0 deletions PrivateHeaders/XCTest/XCSynthesizedEventRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@
{
NSMutableArray *_eventPaths;
NSString *_name;
#if TARGET_OS_IOS
UIInterfaceOrientation _interfaceOrientation;
#endif
}
#if TARGET_OS_IOS
@property(readonly) UIInterfaceOrientation interfaceOrientation; // @synthesize interfaceOrientation=_interfaceOrientation;
#endif
@property(readonly, copy) NSString *name; // @synthesize name=_name;
@property(readonly) double maximumOffset;
@property(readonly) NSArray *eventPaths;

- (void)addPointerEventPath:(XCPointerEventPath *)arg1;
#if TARGET_OS_IOS
- (id)initWithName:(NSString *)arg1 interfaceOrientation:(UIInterfaceOrientation)arg2;
#endif
- (id)init;
- (BOOL)synthesizeWithError:(NSError **)arg1;

Expand Down
4 changes: 3 additions & 1 deletion PrivateHeaders/XCTest/XCUIApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
@property(getter=isIdleAnimationWaitEnabled) BOOL idleAnimationWaitEnabled; // @synthesize idleAnimationWaitEnabled=_idleAnimationWaitEnabled;
@property(nonatomic) BOOL doesNotHandleUIInterruptions; // @synthesize doesNotHandleUIInterruptions=_doesNotHandleUIInterruptions;
@property(readonly) BOOL fauxCollectionViewCellsEnabled;
@property(readonly, nonatomic) UIInterfaceOrientation interfaceOrientation; //TODO tvos
#if !TARGET_OS_TV
@property(readonly, nonatomic) UIInterfaceOrientation interfaceOrientation;
#endif
@property(readonly, nonatomic) BOOL running;
@property(nonatomic) pid_t processID; // @synthesize processID=_processID;
@property(readonly) XCAccessibilityElement *accessibilityElement;
Expand Down
2 changes: 2 additions & 0 deletions PrivateHeaders/XCTest/XCUIElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
@property BOOL safeQueryResolutionEnabled; // @synthesize safeQueryResolutionEnabled=_safeQueryResolutionEnabled;
@property(retain) XCElementSnapshot *lastSnapshot; // @synthesize lastSnapshot=_lastSnapshot;
@property(readonly) XCUIElementQuery *query; // @synthesize query=_query;
#if TARGET_OS_IOS
@property(readonly, nonatomic) UIInterfaceOrientation interfaceOrientation;
#endif
@property(readonly, copy) XCUICoordinate *hitPointCoordinate;
@property(readonly) BOOL isTopLevelTouchBarElement;
@property(readonly) BOOL isTouchBarElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,53 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEF988291C486603005CA669"
BuildableName = "WebDriverAgentRunner.xctest"
BlueprintName = "WebDriverAgentRunner"
BlueprintIdentifier = "EE9B75D31CF7956C00275851"
BuildableName = "IntegrationApp.app"
BlueprintName = "IntegrationApp"
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
language = ""
systemAttachmentLifetime = "keepNever"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEF988291C486603005CA669"
BuildableName = "WebDriverAgentRunner.xctest"
BlueprintName = "WebDriverAgentRunner"
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EE9B75D31CF7956C00275851"
BuildableName = "IntegrationApp.app"
BlueprintName = "IntegrationApp"
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEF988291C486603005CA669"
BuildableName = "WebDriverAgentRunner.xctest"
BlueprintName = "WebDriverAgentRunner"
BlueprintIdentifier = "EE9B75D31CF7956C00275851"
BuildableName = "IntegrationApp.app"
BlueprintName = "IntegrationApp"
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
Expand All @@ -73,15 +70,16 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EEF988291C486603005CA669"
BuildableName = "WebDriverAgentRunner.xctest"
BlueprintName = "WebDriverAgentRunner"
BlueprintIdentifier = "EE9B75D31CF7956C00275851"
BuildableName = "IntegrationApp.app"
BlueprintName = "IntegrationApp"
ReferencedContainer = "container:WebDriverAgent.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -86,7 +85,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
systemAttachmentLifetime = "keepNever"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
Expand All @@ -48,7 +47,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ - (void)verifyGesture:(NSArray<NSArray<NSDictionary<NSString *, id> *> *> *)gest
{
[[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:orientation];
NSError *error;
XCTAssertTrue(self.testedApplication.alerts.count == 0);
NSInteger initialCount = self.testedApplication.alerts.count;
XCTAssertTrue([self.testedApplication fb_performAppiumTouchActions:gesture elementCache:nil error:&error]);
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0);
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > initialCount);
}

- (void)setUp
Expand Down Expand Up @@ -63,9 +63,9 @@ - (void)testErroneousGestures
}
],
],

];

for (NSArray<NSArray<NSDictionary<NSString *, id> *> *> *invalidGesture in invalidGestures) {
NSError *error;
XCTAssertFalse([self.testedApplication fb_performAppiumTouchActions:invalidGesture elementCache:nil error:&error]);
Expand Down Expand Up @@ -93,7 +93,7 @@ - (void)testSymmetricTwoFingersTap
}
],
];

[self verifyGesture:gesture orientation:UIDeviceOrientationPortrait];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ - (void)verifyGesture:(NSArray<NSDictionary<NSString *, id> *> *)gesture orienta
{
[[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:orientation];
NSError *error;
XCTAssertTrue(self.testedApplication.alerts.count == 0);
NSInteger initialCount = self.testedApplication.alerts.count;
XCTAssertTrue([self.testedApplication fb_performAppiumTouchActions:gesture elementCache:nil error:&error]);
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0);
XCTAssertNil(error);
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > initialCount);
}

- (void)setUp
Expand All @@ -57,20 +58,20 @@ - (void)tearDown
- (void)testErroneousGestures
{
XCUIElement *dstButton = self.testedApplication.buttons[FBShowAlertButtonName];

NSArray<NSArray<NSDictionary<NSString *, id> *> *> *invalidGestures =
@[
// Empty chain
@[],

// Chain element without 'action' key
@[@{
@"options": @{
@"ms": @100
}
},
],

// Empty chain because of cancel
@[@{
@"action": @"moveTo",
Expand All @@ -82,7 +83,7 @@ - (void)testErroneousGestures
@"action": @"cancel"
},
],

// Chain with unknown action
@[@{
@"action": @"tapP",
Expand All @@ -91,7 +92,7 @@ - (void)testErroneousGestures
}
},
],

// Wait without preceeding coordinate
@[@{
@"action": @"wait"
Expand Down Expand Up @@ -141,7 +142,7 @@ - (void)testErroneousGestures
}
},
],

// longPress with negative duration
@[@{
@"action": @"longPress",
Expand All @@ -152,9 +153,9 @@ - (void)testErroneousGestures
}
},
],

];

for (NSArray<NSDictionary<NSString *, id> *> *invalidGesture in invalidGestures) {
NSError *error;
XCTAssertFalse([self.testedApplication fb_performAppiumTouchActions:invalidGesture elementCache:nil error:&error]);
Expand Down Expand Up @@ -423,4 +424,3 @@ - (void)testSwipePickerWheelWithAbsoluteCoordinates
}

@end

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ @implementation FBAutoAlertsHandlerTests
- (void)setUp
{
[super setUp];

[self launchApplication];
[self goToAlertsPage];
}
Expand All @@ -48,7 +47,7 @@ - (void)testAutoAcceptingOfAlerts
if (SYSTEM_VERSION_LESS_THAN(@"11.0")) {
return;
}

self.session = [FBSession
sessionWithApplication:FBApplication.fb_activeApplication
defaultAlertAction:@"accept"];
Expand Down
4 changes: 2 additions & 2 deletions WebDriverAgentTests/IntegrationTests/FBForceTouchTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ - (void)verifyForceTapWithOrientation:(UIDeviceOrientation)orientation
{
[[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:orientation];
NSError *error;
XCTAssertTrue(self.testedApplication.alerts.count == 0);
NSInteger initialCount = self.testedApplication.alerts.count;
[self.testedApplication.buttons[FBShowAlertForceTouchButtonName] fb_forceTouchWithPressure:1.0 duration:1.0 error:&error];
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0);
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > initialCount);
}

- (void)setUp
Expand Down
9 changes: 5 additions & 4 deletions WebDriverAgentTests/IntegrationTests/FBTapTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ - (void)verifyTapWithOrientation:(UIDeviceOrientation)orientation
{
[[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:orientation];
NSError *error;
XCTAssertTrue(self.testedApplication.alerts.count == 0);
NSInteger initialCount = self.testedApplication.alerts.count;
[self.testedApplication.buttons[FBShowAlertButtonName] fb_tapWithError:&error];
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0);
XCTAssertNil(error);
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > initialCount);
}

- (void)setUp
Expand Down Expand Up @@ -77,10 +78,10 @@ - (void)verifyTapByCoordinatesWithOrientation:(UIDeviceOrientation)orientation
{
[[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:orientation];
NSError *error;
XCTAssertTrue(self.testedApplication.alerts.count == 0);
NSInteger initialCount = self.testedApplication.alerts.count;
XCUIElement *dstButton = self.testedApplication.buttons[FBShowAlertButtonName];
[dstButton fb_tapCoordinate:CGPointMake(dstButton.frame.size.width / 2, dstButton.frame.size.height / 2) error:&error];
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > 0);
FBAssertWaitTillBecomesTrue(self.testedApplication.alerts.count > initialCount);
}

- (void)testTapCoordinates
Expand Down
Loading