初始化提交

This commit is contained in:
2026-02-03 16:52:44 +08:00
commit d2f9806384
512 changed files with 65167 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
/**
* Copyright (c) 2018-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 <Foundation/Foundation.h>
#import <WebDriverAgentLib/FBElement.h>
#import <XCTest/XCUIElementTypes.h>
@class XCUIApplication;
@interface XCUIElementDouble : NSObject<FBElement>
@property (nonatomic, strong, nonnull) XCUIApplication *application;
@property (nonatomic, readwrite, assign) CGRect frame;
@property (nonatomic, readwrite, nullable) id lastSnapshot;
@property (nonatomic, assign) BOOL fb_isObstructedByAlert;
@property (nonatomic, readwrite, copy, nonnull) NSDictionary *wdRect;
@property (nonatomic, readwrite, assign) CGRect wdFrame;
@property (nonatomic, readwrite, copy, nonnull) NSString *wdUID;
@property (nonatomic, copy, readwrite, nullable) NSString *wdName;
@property (nonatomic, copy, readwrite, nullable) NSString *wdLabel;
@property (nonatomic, copy, readwrite, nonnull) NSString *wdType;
@property (nonatomic, strong, readwrite, nullable) NSString *wdValue;
@property (nonatomic, readwrite, getter=isWDEnabled) BOOL wdEnabled;
@property (nonatomic, readwrite, getter=isWDSelected) BOOL wdSelected;
@property (nonatomic, readwrite) NSUInteger wdIndex;
@property (nonatomic, readwrite, getter=isWDVisible) BOOL wdVisible;
@property (nonatomic, readwrite, getter=isWDAccessible) BOOL wdAccessible;
@property (nonatomic, readwrite, getter=isWDFocused) BOOL wdFocused;
@property (nonatomic, readwrite, getter = isWDHittable) BOOL wdHittable;
@property (copy, nonnull) NSArray *children;
@property (nonatomic, readwrite, assign) XCUIElementType elementType;
@property (nonatomic, readwrite, getter=isWDAccessibilityContainer) BOOL wdAccessibilityContainer;
- (void)resolve;
- (id _Nonnull)fb_standardSnapshot;
- (id _Nonnull)fb_customSnapshot;
// Checks
@property (nonatomic, assign, readonly) BOOL didResolve;
@end

View File

@@ -0,0 +1,79 @@
/**
* Copyright (c) 2018-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 "XCUIElementDouble.h"
@interface XCUIElementDouble ()
@property (nonatomic, assign, readwrite) BOOL didResolve;
@end
@implementation XCUIElementDouble
- (id)init
{
self = [super init];
if (self) {
self.wdFrame = CGRectMake(0, 0, 0, 0);
self.wdName = @"testName";
self.wdLabel = @"testLabel";
self.wdValue = @"magicValue";
self.wdVisible = YES;
self.wdAccessible = YES;
self.wdEnabled = YES;
self.wdSelected = YES;
self.wdHittable = YES;
self.wdIndex = 0;
#if TARGET_OS_TV
self.wdFocused = YES;
#endif
self.children = @[];
self.wdRect = @{@"x": @0,
@"y": @0,
@"width": @0,
@"height": @0,
};
self.wdAccessibilityContainer = NO;
self.elementType = XCUIElementTypeOther;
self.wdType = @"XCUIElementTypeOther";
self.wdUID = @"0";
self.lastSnapshot = nil;
}
return self;
}
- (id)fb_valueForWDAttributeName:(NSString *)name
{
return @"test";
}
- (id)fb_standardSnapshot
{
return [self lastSnapshot];
}
- (id)fb_customSnapshot
{
return [self lastSnapshot];
}
- (void)resolve
{
self.didResolve = YES;
}
- (id)lastSnapshot
{
return self;
}
- (id)fb_uid
{
return self.wdUID;
}
@end