初始化提交
This commit is contained in:
58
WebDriverAgentRunner/UITestingUITests.m
Normal file
58
WebDriverAgentRunner/UITestingUITests.m
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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
|
||||
Reference in New Issue
Block a user