59 lines
1.5 KiB
Objective-C
59 lines
1.5 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <XCTest/XCTest.h>
|
|
|
|
#import <WebDriverAgentLib/FBDebugLogDelegateDecorator.h>
|
|
#import <WebDriverAgentLib/FBConfiguration.h>
|
|
#import <WebDriverAgentLib/FBFailureProofTestCase.h>
|
|
#import <WebDriverAgentLib/FBWebServer.h>
|
|
#import <WebDriverAgentLib/XCTestCase.h>
|
|
|
|
@interface UITestingUITests : FBFailureProofTestCase <FBWebServerDelegate>
|
|
@end
|
|
|
|
@implementation UITestingUITests
|
|
|
|
+ (void)setUp
|
|
{
|
|
[FBDebugLogDelegateDecorator decorateXCTestLogger];
|
|
[FBConfiguration disableRemoteQueryEvaluation];
|
|
[FBConfiguration configureDefaultKeyboardPreferences];
|
|
[FBConfiguration disableApplicationUIInterruptionsHandling];
|
|
if (NSProcessInfo.processInfo.environment[@"ENABLE_AUTOMATIC_SCREEN_RECORDINGS"]) {
|
|
[FBConfiguration enableScreenRecordings];
|
|
} else {
|
|
[FBConfiguration disableScreenRecordings];
|
|
}
|
|
if (NSProcessInfo.processInfo.environment[@"ENABLE_AUTOMATIC_SCREENSHOTS"]) {
|
|
[FBConfiguration enableScreenshots];
|
|
} else {
|
|
[FBConfiguration disableScreenshots];
|
|
}
|
|
[super setUp];
|
|
}
|
|
|
|
/**
|
|
Never ending test used to start WebDriverAgent
|
|
*/
|
|
- (void)testRunner
|
|
{
|
|
FBWebServer *webServer = [[FBWebServer alloc] init];
|
|
webServer.delegate = self;
|
|
[webServer startServing];
|
|
}
|
|
|
|
#pragma mark - FBWebServerDelegate
|
|
|
|
- (void)webServerDidRequestShutdown:(FBWebServer *)webServer
|
|
{
|
|
[webServer stopServing];
|
|
}
|
|
|
|
@end
|