Skip to content

Commit ac62cad

Browse files
committed
Merge pull request #17 from VKCOM/sync/2024-11-18
Sync 2024-11-18
2 parents 7b81d49 + 389a141 commit ac62cad

File tree

1,143 files changed

+80059
-30858
lines changed

Some content is hidden

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

1,143 files changed

+80059
-30858
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ res/build/
1010
rethinkdb_data/
1111
temp/
1212
tmp/
13+
doc/
1314
.eslintcache
1415
scripts/
16+
.mypy_cache

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ root = true
44

55
[*]
66
indent_style = space
7-
indent_size = 2
7+
indent_size = 4
88
end_of_line = lf
99
charset = utf-8
1010
trim_trailing_whitespace = true

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
/res/build/**
22
/res/app/components/stf/screen/fast-image-render/pixi.js
3-
WebDriverAgent

.eslintrc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"extends": "eslint:recommended",
33
"env": {
4-
"node": true
4+
"node": true,
5+
"es6": true
56
},
67
"parserOptions": {
7-
"ecmaVersion": 2020,
8+
"ecmaVersion": 2022,
89
"sourceType": "module"
910
},
1011
"rules": {
@@ -99,7 +100,7 @@
99100
"func-style": 0, // optionally set `[2, "expression"]`
100101
"id-length": 0, // optionally set `[2, {"min": 3, "max": 10, "properties": "never", "exceptions": ["x"]}]`
101102
"id-match": 0, // optionally set `[2, "^[a-z]+([A-Z][a-z]+)*$", {"properties": false}]`
102-
"indent": [0, 2, {"SwitchCase": 0, "VariableDeclarator": 2}], // TODO: optionally set `[2, 2, {"SwitchCase": 1, "VariableDeclarator": {"var": 2, "let": 2, "const": 3}}]` this gives too many errors
103+
"indent": [2, 4, {"SwitchCase": 0, "VariableDeclarator": 2}], // TODO: optionally set `[2, 2, {"SwitchCase": 1, "VariableDeclarator": {"var": 2, "let": 2, "const": 3}}]` this gives too many errors
103104
"jsx-quotes": [2, "prefer-single"],
104105
"key-spacing": [2, {"beforeColon": false, "afterColon": true, "mode": "strict"}], // optionally set `[2, {"beforeColon": false, "afterColon": true, "mode": "strict", "align": "colon"}]`
105106
"lines-around-comment": 2, // optionally set `[2, {"beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true}]`
@@ -156,7 +157,7 @@
156157
"no-sync": 1 // `2` is default
157158

158159
// eslint v2
159-
//"keyword-spacing": 2
160+
// "keyword-spacing": 2
160161
},
161162
"globals": {
162163
"$window": true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
/rethinkdb_data/
1313
/temp/
1414
/tmp/
15+
.mypy_cache

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ RUN set -x && \
5454
mkdir /app/bundletool && \
5555
mv /tmp/bundletool/* /app/bundletool && \
5656
cd /app && \
57-
find /tmp -mindepth 1 ! -regex '^/tmp/hsperfdata_root\(/.*\)?' -delete
57+
find /tmp -mindepth 1 ! -regex '^/tmp/hsperfdata_root\(/.*\)?' -delete && \
58+
ln -s /app/bin/stf.mjs /app/bin/stf &&\
59+
cd ui && \
60+
npm ci && \
61+
npx tsc -b && \
62+
npx vite build --mode staging
5863

5964
# Switch to the app user.
6065
USER stf

WebDriverAgent/.azure-pipelines.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml
22
variables:
3-
MIN_VM_IMAGE: macOS-12
4-
MIN_XCODE_VERSION: 13.1
5-
MIN_PLATFORM_VERSION: 15.0
6-
MIN_TV_PLATFORM_VERSION: 15.0
7-
MIN_TV_DEVICE_NAME: Apple TV 4K (2nd generation)
8-
MIN_IPHONE_DEVICE_NAME: iPhone 11
9-
MIN_IPAD_DEVICE_NAME: iPad Pro (11-inch) (3rd generation)
10-
MAX_VM_IMAGE: macOS-12
11-
MAX_XCODE_VERSION: 14.2
12-
MAX_PLATFORM_VERSION: 16.2
13-
MAX_PLATFORM_VERSION_TV: 16.1
14-
MAX_IPHONE_DEVICE_NAME: iPhone 13
15-
MAX_TV_DEVICE_NAME: Apple TV 4K (2nd generation)
16-
MAX_IPAD_DEVICE_NAME: iPad Pro (11-inch) (3rd generation)
3+
MIN_VM_IMAGE: macOS-14
4+
MIN_XCODE_VERSION: 14.3.1
5+
MIN_PLATFORM_VERSION: 16.4
6+
MIN_TV_PLATFORM_VERSION: 16.4
7+
MIN_TV_DEVICE_NAME: Apple TV 4K (3rd generation)
8+
MIN_IPHONE_DEVICE_NAME: iPhone 14 Plus
9+
MIN_IPAD_DEVICE_NAME: iPad Pro (11-inch) (4th generation)
10+
MAX_VM_IMAGE: macOS-14
11+
MAX_XCODE_VERSION: 15.4
12+
MAX_PLATFORM_VERSION: 17.5
13+
MAX_PLATFORM_VERSION_TV: 17.5
14+
MAX_IPHONE_DEVICE_NAME: iPhone 15 Plus
15+
MAX_TV_DEVICE_NAME: Apple TV 4K (3rd generation)
16+
MAX_IPAD_DEVICE_NAME: iPad Air 11-inch (M2)
1717
DEFAULT_NODE_VERSION: "18.x"
1818

1919
trigger:

WebDriverAgent/CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
## [8.11.1](https://github.com/appium/WebDriverAgent/compare/v8.11.0...v8.11.1) (2024-11-11)
2+
3+
### Miscellaneous Chores
4+
5+
* bump appium-ios-device ([#955](https://github.com/appium/WebDriverAgent/issues/955)) ([021f349](https://github.com/appium/WebDriverAgent/commit/021f34901866f4a7870914c00781b83bd0cbddc4))
6+
7+
## [8.11.0](https://github.com/appium/WebDriverAgent/compare/v8.10.1...v8.11.0) (2024-11-11)
8+
9+
### Features
10+
11+
* Add support for excluded_attributes in JSON source hierarchy ([#953](https://github.com/appium/WebDriverAgent/issues/953)) ([6112223](https://github.com/appium/WebDriverAgent/commit/6112223b21026fae5545fe1b1433a09c67ff524b))
12+
13+
## [8.10.1](https://github.com/appium/WebDriverAgent/compare/v8.10.0...v8.10.1) (2024-11-10)
14+
15+
### Miscellaneous Chores
16+
17+
* remove unnecessary lines ([#954](https://github.com/appium/WebDriverAgent/issues/954)) ([940df80](https://github.com/appium/WebDriverAgent/commit/940df80937381b481a2762fbf86b6249804591bd))
18+
19+
## [8.10.0](https://github.com/appium/WebDriverAgent/compare/v8.9.4...v8.10.0) (2024-11-07)
20+
21+
### Features
22+
23+
* add useClearTextShortcut setting ([#952](https://github.com/appium/WebDriverAgent/issues/952)) ([61bc051](https://github.com/appium/WebDriverAgent/commit/61bc051180d691d26233c66a5a76ed20b7fa09d2))
24+
25+
## [8.9.4](https://github.com/appium/WebDriverAgent/compare/v8.9.3...v8.9.4) (2024-10-17)
26+
27+
### Bug Fixes
28+
29+
* Consider transient overlay windows when respectSystemAlerts is enabled ([#946](https://github.com/appium/WebDriverAgent/issues/946)) ([f0bdce7](https://github.com/appium/WebDriverAgent/commit/f0bdce7eb8fdb13d2309d28e936950c77f006b20))
30+
31+
## [8.9.3](https://github.com/appium/WebDriverAgent/compare/v8.9.2...v8.9.3) (2024-10-07)
32+
33+
### Miscellaneous Chores
34+
35+
* remove unused FBBaseActionsParser and cleanup imports in FBConfiguration ([#943](https://github.com/appium/WebDriverAgent/issues/943)) ([a2173d0](https://github.com/appium/WebDriverAgent/commit/a2173d05df8ef831310e805a8e6a8a8d17725201))
36+
137
## [8.9.2](https://github.com/appium/WebDriverAgent/compare/v8.9.1...v8.9.2) (2024-09-13)
238

339
### Miscellaneous Chores

WebDriverAgent/Configurations/IOSSettings.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ RUN_CLANG_STATIC_ANALYZER = YES
2828

2929
GCC_PREPROCESSOR_DEFINITIONS = $(inherited)
3030

31-
WARNING_CFLAGS = $(inherited) -Weverything -Wno-objc-missing-property-synthesis -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-gnu-statement-expression -Wno-language-extension-token -Wno-overriding-method-mismatch -Wno-missing-variable-declarations -Rno-module-build -Wno-auto-import -Wno-objc-interface-ivars -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-unused-parameter -Wno-gnu-conditional-omitted-operand -Wno-explicit-ownership-type -Wno-date-time -Wno-cast-align -Wno-cstring-format-directive -Wno-double-promotion -Wno-partial-availability
31+
WARNING_CFLAGS = $(inherited) -Weverything -Wno-objc-missing-property-synthesis -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-gnu-statement-expression -Wno-language-extension-token -Wno-overriding-method-mismatch -Wno-missing-variable-declarations -Rno-module-build -Wno-auto-import -Wno-objc-interface-ivars -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-unused-parameter -Wno-gnu-conditional-omitted-operand -Wno-explicit-ownership-type -Wno-date-time -Wno-cast-align -Wno-cstring-format-directive -Wno-double-promotion -Wno-partial-availability -Wno-declaration-after-statement -Wno-objc-messaging-id -Wno-direct-ivar-access -Wno-cast-qual -Wno-deprecated-declarations

WebDriverAgent/Configurations/TVOSSettings.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ RUN_CLANG_STATIC_ANALYZER = YES
2828

2929
GCC_PREPROCESSOR_DEFINITIONS = $(inherited)
3030

31-
WARNING_CFLAGS = $(inherited) -Weverything -Wno-objc-missing-property-synthesis -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-gnu-statement-expression -Wno-language-extension-token -Wno-overriding-method-mismatch -Wno-missing-variable-declarations -Rno-module-build -Wno-auto-import -Wno-objc-interface-ivars -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-unused-parameter -Wno-gnu-conditional-omitted-operand -Wno-explicit-ownership-type -Wno-date-time -Wno-cast-align -Wno-cstring-format-directive -Wno-double-promotion -Wno-partial-availability
31+
WARNING_CFLAGS = $(inherited) -Weverything -Wno-objc-missing-property-synthesis -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-gnu-statement-expression -Wno-language-extension-token -Wno-overriding-method-mismatch -Wno-missing-variable-declarations -Rno-module-build -Wno-auto-import -Wno-objc-interface-ivars -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-unused-parameter -Wno-gnu-conditional-omitted-operand -Wno-explicit-ownership-type -Wno-date-time -Wno-cast-align -Wno-cstring-format-directive -Wno-double-promotion -Wno-partial-availability -Wno-declaration-after-statement -Wno-objc-messaging-id -Wno-direct-ivar-access -Wno-cast-qual -Wno-deprecated-declarations

WebDriverAgent/WebDriverAgent.xcodeproj/project.pbxproj

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,6 +3525,7 @@
35253525
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
35263526
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Developer";
35273527
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
3528+
DEVELOPMENT_TEAM = 48LP2W34XH;
35283529
ENABLE_TESTING_SEARCH_PATHS = YES;
35293530
GCC_C_LANGUAGE_STANDARD = gnu11;
35303531
INFOPLIST_FILE = WebDriverAgentRunner/Info.plist;
@@ -3539,7 +3540,7 @@
35393540
);
35403541
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
35413542
MTL_FAST_MATH = YES;
3542-
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner;
3543+
PRODUCT_BUNDLE_IDENTIFIER = com.vkqa.WebDriverAgentRunner;
35433544
PRODUCT_NAME = "$(TARGET_NAME)";
35443545
SDKROOT = appletvos;
35453546
TARGETED_DEVICE_FAMILY = 3;
@@ -3585,6 +3586,7 @@
35853586
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
35863587
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Developer";
35873588
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
3589+
DEVELOPMENT_TEAM = 48LP2W34XH;
35883590
ENABLE_TESTING_SEARCH_PATHS = YES;
35893591
GCC_C_LANGUAGE_STANDARD = gnu11;
35903592
INFOPLIST_FILE = WebDriverAgentRunner/Info.plist;
@@ -3599,7 +3601,7 @@
35993601
);
36003602
MTL_FAST_MATH = YES;
36013603
ONLY_ACTIVE_ARCH = YES;
3602-
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner;
3604+
PRODUCT_BUNDLE_IDENTIFIER = com.vkqa.WebDriverAgentRunner;
36033605
PRODUCT_NAME = "$(TARGET_NAME)";
36043606
SDKROOT = appletvos;
36053607
TARGETED_DEVICE_FAMILY = 3;
@@ -3660,7 +3662,7 @@
36603662
/Developer/Library/Frameworks,
36613663
);
36623664
OTHER_LDFLAGS = "";
3663-
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentLib;
3665+
PRODUCT_BUNDLE_IDENTIFIER = com.vkqa.WebDriverAgentLib;
36643666
PRODUCT_NAME = "$(TARGET_NAME)";
36653667
SDKROOT = appletvos;
36663668
SKIP_INSTALL = YES;
@@ -3727,7 +3729,7 @@
37273729
);
37283730
ONLY_ACTIVE_ARCH = YES;
37293731
OTHER_LDFLAGS = "";
3730-
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentLib;
3732+
PRODUCT_BUNDLE_IDENTIFIER = com.vkqa.WebDriverAgentLib;
37313733
PRODUCT_NAME = "$(TARGET_NAME)";
37323734
PROVISIONING_PROFILE_SPECIFIER = "";
37333735
SDKROOT = appletvos;
@@ -3958,9 +3960,11 @@
39583960
baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* IOSSettings.xcconfig */;
39593961
buildSettings = {
39603962
CLANG_STATIC_ANALYZER_MODE = deep;
3963+
CODE_SIGN_IDENTITY = "Apple Development";
39613964
CURRENT_PROJECT_VERSION = 1;
39623965
DEBUG_INFORMATION_FORMAT = dwarf;
39633966
DEFINES_MODULE = NO;
3967+
DEVELOPMENT_TEAM = 48LP2W34XH;
39643968
DYLIB_COMPATIBILITY_VERSION = 1;
39653969
DYLIB_CURRENT_VERSION = 1;
39663970
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -3982,7 +3986,7 @@
39823986
/System/Developer/Library/Frameworks,
39833987
);
39843988
OTHER_LDFLAGS = "";
3985-
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentLib;
3989+
PRODUCT_BUNDLE_IDENTIFIER = com.vkqa.WebDriverAgentLib;
39863990
PRODUCT_NAME = "$(TARGET_NAME)";
39873991
SKIP_INSTALL = YES;
39883992
VERSIONING_SYSTEM = "apple-generic";
@@ -4023,8 +4027,10 @@
40234027
baseConfigurationReference = EEE5CABF1C80361500CBBDD9 /* IOSSettings.xcconfig */;
40244028
buildSettings = {
40254029
CLANG_STATIC_ANALYZER_MODE = deep;
4030+
CODE_SIGN_IDENTITY = "Apple Development";
40264031
CURRENT_PROJECT_VERSION = 1;
40274032
DEFINES_MODULE = NO;
4033+
DEVELOPMENT_TEAM = 48LP2W34XH;
40284034
DYLIB_COMPATIBILITY_VERSION = 1;
40294035
DYLIB_CURRENT_VERSION = 1;
40304036
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -4047,7 +4053,7 @@
40474053
);
40484054
ONLY_ACTIVE_ARCH = YES;
40494055
OTHER_LDFLAGS = "";
4050-
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentLib;
4056+
PRODUCT_BUNDLE_IDENTIFIER = com.vkqa.WebDriverAgentLib;
40514057
PRODUCT_NAME = "$(TARGET_NAME)";
40524058
SKIP_INSTALL = YES;
40534059
VERSIONING_SYSTEM = "apple-generic";
@@ -4200,7 +4206,6 @@
42004206
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
42014207
CLANG_ANALYZER_NONNULL = YES;
42024208
DEBUG_INFORMATION_FORMAT = dwarf;
4203-
DEVELOPMENT_TEAM = 48LP2W34XH;
42044209
INFOPLIST_FILE = WebDriverAgentTests/IntegrationApp/Info.plist;
42054210
LD_RUNPATH_SEARCH_PATHS = (
42064211
"$(inherited)",
@@ -4217,7 +4222,6 @@
42174222
buildSettings = {
42184223
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
42194224
CLANG_ANALYZER_NONNULL = YES;
4220-
DEVELOPMENT_TEAM = 48LP2W34XH;
42214225
INFOPLIST_FILE = WebDriverAgentTests/IntegrationApp/Info.plist;
42224226
LD_RUNPATH_SEARCH_PATHS = (
42234227
"$(inherited)",
@@ -4290,7 +4294,7 @@
42904294
"$(inherited)",
42914295
"-all_load",
42924296
);
4293-
PRODUCT_BUNDLE_IDENTIFIER = com.di.WebDriverAgentRunner;
4297+
PRODUCT_BUNDLE_IDENTIFIER = com.vkqa.WebDriverAgentRunner;
42944298
PRODUCT_NAME = "$(TARGET_NAME)";
42954299
USES_XCTRUNNER = YES;
42964300
WARNING_CFLAGS = (
@@ -4344,7 +4348,7 @@
43444348
"$(inherited)",
43454349
"-all_load",
43464350
);
4347-
PRODUCT_BUNDLE_IDENTIFIER = com.di.WebDriverAgentRunner;
4351+
PRODUCT_BUNDLE_IDENTIFIER = com.vkqa.WebDriverAgentRunner;
43484352
PRODUCT_NAME = "$(TARGET_NAME)";
43494353
USES_XCTRUNNER = YES;
43504354
WARNING_CFLAGS = (

WebDriverAgent/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ NS_ASSUME_NONNULL_BEGIN
3131
*/
3232
- (NSDictionary *)fb_tree;
3333

34+
/**
35+
@param excludedAttributes Set of possible attributes to be excluded i.e frame, enabled, visible, accessible, focused. If set to nil or an empty array then no attributes will be excluded from the resulting JSON
36+
@return application elements tree in form of nested dictionaries
37+
*/
38+
- (NSDictionary *)fb_tree:(nullable NSSet<NSString *> *) excludedAttributes;
39+
3440
/**
3541
Return application elements accessibility tree in form of nested dictionaries
3642
*/

WebDriverAgent/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,16 @@ - (BOOL)fb_deactivateWithDuration:(NSTimeInterval)duration error:(NSError **)err
152152
}
153153

154154
- (NSDictionary *)fb_tree
155+
{
156+
return [self fb_tree:nil];
157+
}
158+
159+
- (NSDictionary *)fb_tree:(nullable NSSet<NSString *> *) excludedAttributes
155160
{
156161
id<FBXCElementSnapshot> snapshot = self.fb_isResolvedFromCache.boolValue
157162
? self.lastSnapshot
158163
: [self fb_snapshotWithAllAttributesAndMaxDepth:nil];
159-
return [self.class dictionaryForElement:snapshot recursive:YES];
164+
return [self.class dictionaryForElement:snapshot recursive:YES excludedAttributes:excludedAttributes];
160165
}
161166

162167
- (NSDictionary *)fb_accessibilityTree
@@ -167,7 +172,9 @@ - (NSDictionary *)fb_accessibilityTree
167172
return [self.class accessibilityInfoForElement:snapshot];
168173
}
169174

170-
+ (NSDictionary *)dictionaryForElement:(id<FBXCElementSnapshot>)snapshot recursive:(BOOL)recursive
175+
+ (NSDictionary *)dictionaryForElement:(id<FBXCElementSnapshot>)snapshot
176+
recursive:(BOOL)recursive
177+
excludedAttributes:(nullable NSSet<NSString *> *) excludedAttributes
171178
{
172179
NSMutableDictionary *info = [[NSMutableDictionary alloc] init];
173180
info[@"type"] = [FBElementTypeTransformer shortStringWithElementType:snapshot.elementType];
@@ -177,11 +184,35 @@ + (NSDictionary *)dictionaryForElement:(id<FBXCElementSnapshot>)snapshot recursi
177184
info[@"value"] = FBValueOrNull(wrappedSnapshot.wdValue);
178185
info[@"label"] = FBValueOrNull(wrappedSnapshot.wdLabel);
179186
info[@"rect"] = wrappedSnapshot.wdRect;
180-
info[@"frame"] = NSStringFromCGRect(wrappedSnapshot.wdFrame);
181-
info[@"isEnabled"] = [@([wrappedSnapshot isWDEnabled]) stringValue];
182-
info[@"isVisible"] = [@([wrappedSnapshot isWDVisible]) stringValue];
183-
info[@"isAccessible"] = [@([wrappedSnapshot isWDAccessible]) stringValue];
184-
info[@"isFocused"] = [@([wrappedSnapshot isWDFocused]) stringValue];
187+
188+
NSDictionary<NSString *, NSString * (^)(void)> *attributeBlocks = @{
189+
@"frame": ^{
190+
return NSStringFromCGRect(wrappedSnapshot.wdFrame);
191+
},
192+
@"enabled": ^{
193+
return [@([wrappedSnapshot isWDEnabled]) stringValue];
194+
},
195+
@"visible": ^{
196+
return [@([wrappedSnapshot isWDVisible]) stringValue];
197+
},
198+
@"accessible": ^{
199+
return [@([wrappedSnapshot isWDAccessible]) stringValue];
200+
},
201+
@"focused": ^{
202+
return [@([wrappedSnapshot isWDFocused]) stringValue];
203+
}
204+
};
205+
206+
for (NSString *key in attributeBlocks) {
207+
if (excludedAttributes == nil || ![excludedAttributes containsObject:key]) {
208+
NSString *value = ((NSString * (^)(void))attributeBlocks[key])();
209+
if ([key isEqualToString:@"frame"]) {
210+
info[key] = value;
211+
} else {
212+
info[[NSString stringWithFormat:@"is%@", [key capitalizedString]]] = value;
213+
}
214+
}
215+
}
185216

186217
if (!recursive) {
187218
return info.copy;
@@ -191,7 +222,9 @@ + (NSDictionary *)dictionaryForElement:(id<FBXCElementSnapshot>)snapshot recursi
191222
if ([childElements count]) {
192223
info[@"children"] = [[NSMutableArray alloc] init];
193224
for (id<FBXCElementSnapshot> childSnapshot in childElements) {
194-
[info[@"children"] addObject:[self dictionaryForElement:childSnapshot recursive:YES]];
225+
[info[@"children"] addObject:[self dictionaryForElement:childSnapshot
226+
recursive:YES
227+
excludedAttributes:excludedAttributes]];
195228
}
196229
}
197230
return info;
@@ -379,7 +412,9 @@ - (BOOL)fb_dismissKeyboardWithKeyNames:(nullable NSArray<NSString *> *)keyNames
379412
id extractedElement = extractIssueProperty(issue, @"element");
380413

381414
id<FBXCElementSnapshot> elementSnapshot = [extractedElement fb_takeSnapshot];
382-
NSDictionary *elementAttributes = elementSnapshot ? [self.class dictionaryForElement:elementSnapshot recursive:NO] : @{};
415+
NSDictionary *elementAttributes = elementSnapshot
416+
? [self.class dictionaryForElement:elementSnapshot recursive:NO excludedAttributes:nil]
417+
: @{};
383418

384419
[resultArray addObject:@{
385420
@"detailedDescription": extractIssueProperty(issue, @"detailedDescription") ?: @"",

WebDriverAgent/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ - (BOOL)fb_clearTextWithSnapshot:(FBXCElementSnapshotWrapper *)snapshot
166166
[self fb_prepareForTextInputWithSnapshot:snapshot];
167167
}
168168

169-
if (retry == 0) {
169+
if (retry == 0 && FBConfiguration.useClearTextShortcut) {
170170
// 1st attempt is via the IOHIDEvent as the fastest operation
171171
// https://github.com/appium/appium/issues/19389
172172
[[XCUIDevice sharedDevice] fb_performIOHIDEventWithPage:0x07 // kHIDPage_KeyboardOrKeypad

0 commit comments

Comments
 (0)