appium-webdriveragent 8.7.7 → 8.7.9

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,15 @@
1
+ ## [8.7.9](https://github.com/appium/WebDriverAgent/compare/v8.7.8...v8.7.9) (2024-07-21)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * keep error handling for the future possible usage ([#921](https://github.com/appium/WebDriverAgent/issues/921)) ([2f90739](https://github.com/appium/WebDriverAgent/commit/2f90739340d70073b48c703b36b9a313d3618972))
6
+
7
+ ## [8.7.8](https://github.com/appium/WebDriverAgent/compare/v8.7.7...v8.7.8) (2024-07-18)
8
+
9
+ ### Bug Fixes
10
+
11
+ * 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))
12
+
1
13
  ## [8.7.7](https://github.com/appium/WebDriverAgent/compare/v8.7.6...v8.7.7) (2024-07-18)
2
14
 
3
15
  ### 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.9</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.9</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -771,7 +771,7 @@ static NSString *const FB_KEY_ACTIONS = @"actions";
771
771
 
772
772
  NSArray<NSDictionary<NSString *, id> *> *actionItems = [actionDescription objectForKey:FB_KEY_ACTIONS];
773
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];
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
775
  if (error) {
776
776
  *error = [[FBErrorBuilder.builder withDescription:description] build];
777
777
  }
@@ -852,7 +852,20 @@ static NSString *const FB_KEY_ACTIONS = @"actions";
852
852
  *error = [[FBErrorBuilder.builder withDescription:description] build];
853
853
  }
854
854
  return nil;
855
+ }
856
+ NSArray<NSDictionary<NSString *, id> *> *actionItems = [action objectForKey:FB_KEY_ACTIONS];
857
+ if (nil == actionItems) {
858
+ NSString *description = [NSString stringWithFormat:@"It is mandatory to have at least one item defined for each action. Action with id '%@' contains none", actionId];
859
+ if (error) {
860
+ *error = [[FBErrorBuilder.builder withDescription:description] build];
861
+ }
862
+ return nil;
855
863
  }
864
+ if (0 == actionItems.count) {
865
+ [FBLogger logFmt:@"Action items in the action id '%@' had an empty array. Skipping the action.", actionId];
866
+ continue;
867
+ }
868
+
856
869
  [actionIds addObject:actionId];
857
870
  [actionsMapping setObject:action forKey:actionId];
858
871
  }
@@ -70,15 +70,6 @@
70
70
  },
71
71
  ],
72
72
 
73
- // Chain element with empty 'actions'
74
- @[@{
75
- @"type": @"pointer",
76
- @"id": @"finger1",
77
- @"parameters": @{@"pointerType": @"touch"},
78
- @"actions": @[],
79
- },
80
- ],
81
-
82
73
  // Chain element without type
83
74
  @[@{
84
75
  @"id": @"finger1",
@@ -276,6 +267,21 @@
276
267
  }
277
268
  }
278
269
 
270
+ - (void)testNothingDoesWithoutError
271
+ {
272
+ NSArray<NSDictionary<NSString *, id> *> *gesture =
273
+ @[@{
274
+ @"type": @"pointer",
275
+ @"id": @"finger1",
276
+ @"parameters": @{@"pointerType": @"touch"},
277
+ @"actions": @[],
278
+ },
279
+ ];
280
+ NSError *error;
281
+ XCTAssertTrue([self.testedApplication fb_performW3CActions:gesture elementCache:nil error:&error]);
282
+ XCTAssertNil(error);
283
+ }
284
+
279
285
  - (void)testTap
280
286
  {
281
287
  NSArray<NSDictionary<NSString *, id> *> *gesture =
@@ -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.9",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",