appium-webdriveragent 8.7.7 → 8.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [8.7.8](https://github.com/appium/WebDriverAgent/compare/v8.7.7...v8.7.8) (2024-07-18)
2
+
3
+ ### Bug Fixes
4
+
5
+ * do nothing for an empty array in w3c actions ([#919](https://github.com/appium/WebDriverAgent/issues/919)) ([9e70ec1](https://github.com/appium/WebDriverAgent/commit/9e70ec1dbec1d1844278a58297a5b956ebaeb7fc))
6
+
1
7
  ## [8.7.7](https://github.com/appium/WebDriverAgent/compare/v8.7.6...v8.7.7) (2024-07-18)
2
8
 
3
9
  ### Bug Fixes
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>8.7.7</string>
18
+ <string>8.7.8</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>8.7.7</string>
22
+ <string>8.7.8</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -692,14 +692,6 @@ static NSString *const FB_KEY_ACTIONS = @"actions";
692
692
  });
693
693
 
694
694
  NSArray<NSDictionary<NSString *, id> *> *actionItems = [actionDescription objectForKey:FB_KEY_ACTIONS];
695
- if (nil == actionItems || 0 == actionItems.count) {
696
- NSString *description = [NSString stringWithFormat:@"It is mandatory to have at least one item defined for each action. Action with id '%@' contains none", actionId];
697
- if (error) {
698
- *error = [[FBErrorBuilder.builder withDescription:description] build];
699
- }
700
- return nil;
701
- }
702
-
703
695
  FBW3CKeyItemsChain *chain = [[FBW3CKeyItemsChain alloc] init];
704
696
  NSArray<NSDictionary<NSString *, id> *> *processedItems = [self preprocessedActionItemsWith:actionItems];
705
697
  for (NSDictionary<NSString *, id> *actionItem in processedItems) {
@@ -770,14 +762,6 @@ static NSString *const FB_KEY_ACTIONS = @"actions";
770
762
  }
771
763
 
772
764
  NSArray<NSDictionary<NSString *, id> *> *actionItems = [actionDescription objectForKey:FB_KEY_ACTIONS];
773
- if (nil == actionItems || 0 == actionItems.count) {
774
- NSString *description = [NSString stringWithFormat:@"It is mandatory to have at least one gesture item defined for each action. Action with id '%@' contains none", actionId];
775
- if (error) {
776
- *error = [[FBErrorBuilder.builder withDescription:description] build];
777
- }
778
- return nil;
779
- }
780
-
781
765
  FBW3CGestureItemsChain *chain = [[FBW3CGestureItemsChain alloc] init];
782
766
  NSArray<NSDictionary<NSString *, id> *> *processedItems = [self preprocessedActionItemsWith:actionItems];
783
767
  for (NSDictionary<NSString *, id> *actionItem in processedItems) {
@@ -852,7 +836,20 @@ static NSString *const FB_KEY_ACTIONS = @"actions";
852
836
  *error = [[FBErrorBuilder.builder withDescription:description] build];
853
837
  }
854
838
  return nil;
839
+ }
840
+ NSArray<NSDictionary<NSString *, id> *> *actionItems = [action objectForKey:FB_KEY_ACTIONS];
841
+ if (nil == actionItems) {
842
+ NSString *description = [NSString stringWithFormat:@"It is mandatory to have at least one item defined for each action. Action with id '%@' contains none", actionId];
843
+ if (error) {
844
+ *error = [[FBErrorBuilder.builder withDescription:description] build];
845
+ }
846
+ return nil;
847
+ }
848
+ if (0 == actionItems.count) {
849
+ [FBLogger logFmt:@"Action items in the action id '%@' had an empty array. Skipping the action.", actionId];
850
+ continue;
855
851
  }
852
+
856
853
  [actionIds addObject:actionId];
857
854
  [actionsMapping setObject:action forKey:actionId];
858
855
  }
@@ -158,4 +158,28 @@
158
158
  XCTAssertEqualObjects(textField.wdValue, @"🏀NBA");
159
159
  }
160
160
 
161
+ - (void)testTextTypingWithEmptyActions
162
+ {
163
+ if (![XCPointerEvent.class fb_areKeyEventsSupported]) {
164
+ return;
165
+ }
166
+
167
+ XCUIElement *textField = self.testedApplication.textFields[@"aIdentifier"];
168
+ [textField tap];
169
+ NSArray<NSDictionary<NSString *, id> *> *typeAction =
170
+ @[
171
+ @{
172
+ @"type": @"pointer",
173
+ @"id": @"touch",
174
+ @"actions": @[],
175
+ },
176
+ ];
177
+ NSError *error;
178
+ XCTAssertTrue([self.testedApplication fb_performW3CActions:typeAction
179
+ elementCache:nil
180
+ error:&error]);
181
+ XCTAssertNil(error);
182
+ XCTAssertEqualObjects(textField.value, @"");
183
+ }
184
+
161
185
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "8.7.7",
3
+ "version": "8.7.8",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",