detox 20.7.8-smoke.0 → 20.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/Detox-android/com/wix/detox/{20.7.8-smoke.0/detox-20.7.8-smoke.0-javadoc.jar → 20.8.0/detox-20.8.0-javadoc.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0-javadoc.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0-javadoc.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0-javadoc.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0-javadoc.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{20.7.8-smoke.0/detox-20.7.8-smoke.0-sources.jar → 20.8.0/detox-20.8.0-sources.jar} +0 -0
  7. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0-sources.jar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0-sources.jar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0-sources.jar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0-sources.jar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.aar +0 -0
  12. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.aar.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.aar.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.aar.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.aar.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/{20.7.8-smoke.0/detox-20.7.8-smoke.0.pom → 20.8.0/detox-20.8.0.pom} +1 -1
  17. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.pom.md5 +1 -0
  18. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.pom.sha1 +1 -0
  19. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.pom.sha256 +1 -0
  20. package/Detox-android/com/wix/detox/20.8.0/detox-20.8.0.pom.sha512 +1 -0
  21. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  22. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  23. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  24. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  25. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  26. package/Detox-ios-src.tbz +0 -0
  27. package/Detox-ios.tbz +0 -0
  28. package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java +5 -0
  29. package/android/detox/src/full/java/com/wix/detox/espresso/action/RNDetoxAccessibilityAction.kt +46 -0
  30. package/index.d.ts +7 -0
  31. package/package.json +2 -2
  32. package/src/android/actions/native.js +8 -0
  33. package/src/android/core/NativeElement.js +5 -0
  34. package/src/android/espressoapi/DetoxAction.js +12 -0
  35. package/src/ios/expectTwo.js +13 -0
  36. package/src/utils/invocationTraceDescriptions.js +1 -0
  37. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0-javadoc.jar.md5 +0 -1
  38. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0-javadoc.jar.sha1 +0 -1
  39. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0-javadoc.jar.sha256 +0 -1
  40. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0-javadoc.jar.sha512 +0 -1
  41. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0-sources.jar.md5 +0 -1
  42. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0-sources.jar.sha1 +0 -1
  43. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0-sources.jar.sha256 +0 -1
  44. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0-sources.jar.sha512 +0 -1
  45. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.aar +0 -0
  46. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.aar.md5 +0 -1
  47. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.aar.sha1 +0 -1
  48. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.aar.sha256 +0 -1
  49. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.aar.sha512 +0 -1
  50. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.pom.md5 +0 -1
  51. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.pom.sha1 +0 -1
  52. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.pom.sha256 +0 -1
  53. package/Detox-android/com/wix/detox/20.7.8-smoke.0/detox-20.7.8-smoke.0.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ 792ec48d40b137aee8326498f06802ba
@@ -0,0 +1 @@
1
+ 947c68556282679ffedda563e4151f6376616c51
@@ -0,0 +1 @@
1
+ 7da803e7363959eb9069793f5ac82521662e1cb709b2656ffde6c8fe5540d27d
@@ -0,0 +1 @@
1
+ 07d59319717591997b56a679bd0650ab67d40ce9deda8399cce6b4c3f0f4ed24147a27cada9ac020c854722fb9317150676cd8693fed579874a28c3868f31644
@@ -0,0 +1 @@
1
+ a03f44fd50ca8a15e86dae9198a9c716
@@ -0,0 +1 @@
1
+ 5def9152aed0ad30bcf2e1374c1110933687ea0a
@@ -0,0 +1 @@
1
+ 747dca51b905c864fab661e7aa21608cb31b38352c67d2b127f8dedd56bac402
@@ -0,0 +1 @@
1
+ 37bc3ee03bcbf4fe754b4591722a5877424662fc988c7afabf170640be1c7814ee82979bd80e00d3bea1d5ac847f1379b7f0443b08938fc6d1f9d68eb7d4e0f7
@@ -0,0 +1 @@
1
+ 001128eb4136e2b6dfd5ae42e49fa792
@@ -0,0 +1 @@
1
+ 7538b1401396940dea0af5be16ea173f2595eb4c
@@ -0,0 +1 @@
1
+ b15fa80eba92332ea0a70dadda71bdad0a682cf34e1fc78f7e4164189ef10600
@@ -0,0 +1 @@
1
+ 5f28a6696e87294fb442399987dcd37f78ccd2ddb4fb4aeeb6f53899afb9239e3d731d285a9c72cfb0d667b959637b8a6333db714f0734b4bfa08bf14833afa9
@@ -3,7 +3,7 @@
3
3
  <modelVersion>4.0.0</modelVersion>
4
4
  <groupId>com.wix</groupId>
5
5
  <artifactId>detox</artifactId>
6
- <version>20.7.8-smoke.0</version>
6
+ <version>20.8.0</version>
7
7
  <packaging>aar</packaging>
8
8
  <name>Detox</name>
9
9
  <description>Gray box end-to-end testing and automation library for mobile apps</description>
@@ -0,0 +1 @@
1
+ 0803846df1d9260c09a90b1c6467378d
@@ -0,0 +1 @@
1
+ 00737aae2409c83bddc6aec2891f985280305bc0
@@ -0,0 +1 @@
1
+ c6cb0623d8a76007cc12fd67205344a9034c2313051c1b54119ad3cd5cdafb77
@@ -0,0 +1 @@
1
+ 962dc6a37a4b0c7456f1dbd199d3b994860fb54741f9eca239d06073fea3512538fe67b3ec66cb4548b57b2779b9614d98d4369fe025d1ff0e3bd910fae34f49
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.7.8-smoke.0</latest>
7
- <release>20.7.8-smoke.0</release>
6
+ <latest>20.8.0</latest>
7
+ <release>20.8.0</release>
8
8
  <versions>
9
- <version>20.7.8-smoke.0</version>
9
+ <version>20.8.0</version>
10
10
  </versions>
11
- <lastUpdated>20230503131305</lastUpdated>
11
+ <lastUpdated>20230507161556</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 12770a9d4f6d8e755279d548b81a0a48
1
+ 2786fb3cd2426eb001460b298d9c766c
@@ -1 +1 @@
1
- 680e7072bb92861c38c84417961ae7f8f0fa1522
1
+ 5512aa69e65841e973d53310bdfd44d3c70648c3
@@ -1 +1 @@
1
- f911526e429ded942d8a8554affb4e15bec56698257b79affc9d6bb455bae029
1
+ fed10b1eed606b777b4bc403440240f7c15893f53b1d0110393384c9348bfdf4
@@ -1 +1 @@
1
- bb5353e380042c23cb29d7885f5de21b2868b6e9da50416822740f8d61ef6eb54535a0fa8e8389e4f1d3b80b57f0ed8cd054c15d2f12e5d70f8346e0825256c4
1
+ 2dce9a7ddef81ad4eda0057868c2dd6712a33cacf878b6f35ed1d9fe8dceedcacd6aad9923bdf15dc207f26885ed79f33acb5c4b81d5c9e0acfa639c43c1ba88
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
@@ -5,6 +5,7 @@ import android.os.Build;
5
5
 
6
6
  import com.wix.detox.common.DetoxErrors.DetoxRuntimeException;
7
7
  import com.wix.detox.common.DetoxErrors.StaleActionException;
8
+ import com.wix.detox.espresso.action.RNDetoxAccessibilityAction;
8
9
  import com.wix.detox.espresso.action.AdjustSliderToPositionAction;
9
10
  import com.wix.detox.espresso.action.DetoxMultiTap;
10
11
  import com.wix.detox.espresso.action.RNClickAction;
@@ -203,6 +204,10 @@ public class DetoxAction {
203
204
  };
204
205
  }
205
206
 
207
+ public static ViewAction accessibilityAction(final String actionName) {
208
+ return new RNDetoxAccessibilityAction(actionName);
209
+ }
210
+
206
211
  private static Date parseDateISO8601(String dateString) throws ParseException {
207
212
  try {
208
213
  return new SimpleDateFormat(ISO8601_FORMAT).parse(dateString);
@@ -0,0 +1,46 @@
1
+ package com.wix.detox.espresso.action
2
+
3
+ import android.view.View
4
+ import androidx.test.espresso.UiController
5
+ import androidx.test.espresso.ViewAction
6
+ import com.facebook.react.bridge.Arguments
7
+ import com.facebook.react.bridge.ReactContext
8
+ import com.facebook.react.bridge.WritableMap
9
+ import com.facebook.react.uimanager.UIManagerHelper
10
+ import com.facebook.react.uimanager.events.Event
11
+ import com.wix.detox.espresso.DetoxMatcher
12
+ import org.hamcrest.Matcher
13
+
14
+ class RNDetoxAccessibilityAction(private val mActionName: String) : ViewAction {
15
+
16
+ override fun getConstraints(): Matcher<View?>? = DetoxMatcher.matcherForNotNull()
17
+
18
+ override fun getDescription(): String = "Dispatch an Accessibility Action"
19
+
20
+ override fun perform(uiController: UiController?, view: View?) {
21
+ val reactContext = view?.context as? ReactContext ?: return
22
+ val reactTag = view.id
23
+
24
+ UIManagerHelper.getEventDispatcherForReactTag(reactContext, reactTag)
25
+ ?.dispatchEvent(
26
+ TopAccessibilityEvent(
27
+ surfaceId = UIManagerHelper.getSurfaceId(reactContext),
28
+ viewId = reactTag,
29
+ actionName = mActionName,
30
+ )
31
+ )
32
+
33
+ val waitTimeMS = 100
34
+ uiController!!.loopMainThreadForAtLeast(waitTimeMS.toLong())
35
+ }
36
+ }
37
+
38
+ class TopAccessibilityEvent(surfaceId: Int, viewId: Int, private val actionName: String) :
39
+ Event<TopAccessibilityEvent>(surfaceId, viewId) {
40
+
41
+ override fun getEventName(): String = "topAccessibilityAction"
42
+
43
+ override fun getEventData(): WritableMap? {
44
+ return Arguments.createMap().apply { putString("actionName", actionName) }
45
+ }
46
+ }
package/index.d.ts CHANGED
@@ -1380,6 +1380,13 @@ declare global {
1380
1380
  */
1381
1381
  setDatePickerDate(dateString: string, dateFormat: string): Promise<void>;
1382
1382
 
1383
+ /**
1384
+ * Triggers a given [accessibility action]{@link https://reactnative.dev/docs/accessibility#accessibility-actions}.
1385
+ * @param actionName - name of the accessibility action
1386
+ * @example await element(by.id('view')).performAccessibilityAction('activate');
1387
+ */
1388
+ performAccessibilityAction(actionName: string): Promise<void>
1389
+
1383
1390
  /**
1384
1391
  * Pinches in the given direction with speed and angle. (iOS only)
1385
1392
  * @param angle value in radiant, default is `0`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "detox",
3
3
  "description": "E2E tests and automation for mobile",
4
- "version": "20.7.8-smoke.0",
4
+ "version": "20.8.0",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -200,5 +200,5 @@
200
200
  }
201
201
  }
202
202
  },
203
- "gitHead": "7a0e32ee4ba5fc236437ccfbeb285b41cde7d762"
203
+ "gitHead": "5a568946b47dc03ffe24150ebbfa0a94a1126de0"
204
204
  }
@@ -145,6 +145,13 @@ class TakeElementScreenshot extends Action {
145
145
  }
146
146
  }
147
147
 
148
+ class AccessibilityActionAction extends Action {
149
+ constructor(actionName) {
150
+ super();
151
+ this._call = invoke.callDirectly(DetoxActionApi.accessibilityAction(actionName));
152
+ }
153
+ }
154
+
148
155
  module.exports = {
149
156
  Action,
150
157
  TapAction,
@@ -164,4 +171,5 @@ module.exports = {
164
171
  ScrollToIndex,
165
172
  SetDatePickerDateAction,
166
173
  AdjustSliderToPosition,
174
+ AccessibilityActionAction
167
175
  };
@@ -169,6 +169,11 @@ class NativeElement {
169
169
  const traceDescription = actionDescription.adjustSliderToPosition(newPosition);
170
170
  return await new ActionInteraction(this._invocationManager, this, action, traceDescription).execute();
171
171
  }
172
+
173
+ async performAccessibilityAction(actionName) {
174
+ const traceDescription = actionDescription.performAccessibilityAction(actionName);
175
+ return await new ActionInteraction(this._invocationManager, this, new actions.AccessibilityActionAction(actionName), traceDescription).execute();
176
+ }
172
177
  }
173
178
 
174
179
  module.exports = {
@@ -233,6 +233,18 @@ class DetoxAction {
233
233
  };
234
234
  }
235
235
 
236
+ static accessibilityAction(actionName) {
237
+ if (typeof actionName !== "string") throw new Error("actionName should be a string, but got " + (actionName + (" (" + (typeof actionName + ")"))));
238
+ return {
239
+ target: {
240
+ type: "Class",
241
+ value: "com.wix.detox.espresso.DetoxAction"
242
+ },
243
+ method: "accessibilityAction",
244
+ args: [actionName]
245
+ };
246
+ }
247
+
236
248
  static parseDateISO8601(dateString) {
237
249
  if (typeof dateString !== "string") throw new Error("dateString should be a string, but got " + (dateString + (" (" + (typeof dateString + ")"))));
238
250
  return {
@@ -229,6 +229,13 @@ class Element {
229
229
  return this.withAction('clearText', traceDescription);
230
230
  }
231
231
 
232
+ performAccessibilityAction(actionName) {
233
+ if (typeof actionName !== 'string') throw new Error('actionName should be a string, but got ' + (actionName + (' (' + (typeof actionName + ')'))));
234
+
235
+ const traceDescription = actionDescription.performAccessibilityAction(actionName);
236
+ return this.withAction('accessibilityAction', traceDescription, actionName);
237
+ }
238
+
232
239
  scroll(pixels, direction = 'down', startPositionX = NaN, startPositionY = NaN) {
233
240
  if (!['left', 'right', 'up', 'down'].some(option => option === direction)) throw new Error('direction should be one of [left, right, up, down], but got ' + direction);
234
241
  if (typeof pixels !== 'number') throw new Error('amount of pixels should be a number, but got ' + (pixels + (' (' + (typeof pixels + ')'))));
@@ -660,6 +667,12 @@ class WaitFor {
660
667
  return this.waitForWithAction(traceDescription);
661
668
  }
662
669
 
670
+ performAccessibilityAction(actionName) {
671
+ this.action = this.actionableElement.performAccessibilityAction(actionName);
672
+ const traceDescription = actionDescription.performAccessibilityAction(actionName);
673
+ return this.waitForWithAction(traceDescription);
674
+ }
675
+
663
676
  pinch(scale, speed, angle) {
664
677
  this.action = this.actionableElement.pinch(scale, speed, angle);
665
678
  const traceDescription = actionDescription.pinch(scale, speed, angle);
@@ -7,6 +7,7 @@ module.exports = {
7
7
  longPressAndDrag: (duration, startX, startY, targetElement, endX, endY, speed, holdDuration) =>
8
8
  `long press and drag from ${startX}, ${startY} to ${endX}, ${endY} with speed ${speed} and hold duration ${holdDuration}`,
9
9
  multiTap: (times) => `tap ${times} times`,
10
+ performAccessibilityAction: (actionName) => `perform ${actionName} accessibilityAction`,
10
11
  pinch: (scale, speed, angle) => `pinch with scale ${scale}, speed ${speed}, and angle ${angle}`,
11
12
  pinchWithAngle: (direction, speed, angle) => `pinch with direction ${direction}, speed ${speed}, and angle ${angle}`,
12
13
  replaceText: (value) => `replace input text: "${value}"`,
@@ -1 +0,0 @@
1
- 61016340ff5600de9ad747d730680a7a
@@ -1 +0,0 @@
1
- 37c24264e9e760f3152b958f6a58b82628850064
@@ -1 +0,0 @@
1
- 901baff687dbfd1fc46afdfc3d34269d55506cb4c3eeaed8a6c92df22315ee74
@@ -1 +0,0 @@
1
- 7f87d1a65c5ad19e33a2aa5ce1c601741ffdf18b56fba8336d3f852bc4ebaf253f2fe87303ab4b225ae747b88647bcdc17644b35e51af72e31bd049daa623eea
@@ -1 +0,0 @@
1
- aee180246106d681db3aa8d519d9e27a
@@ -1 +0,0 @@
1
- 9ee53937cf4a14151ec43a8ca29a967366748a27
@@ -1 +0,0 @@
1
- 997d3a8a4b2d6fd51b4213966d2f7c546e1ebb6afeb6bc5e8495de143a7f66ec
@@ -1 +0,0 @@
1
- b58f279506325a8b4621ae0b7fccd726e1b7a01f208c3597a2500e042181ade1d6009a299cadf1968d66d612baae062b62a4149d4142275c00d7d9aef7eb72ca
@@ -1 +0,0 @@
1
- f62ab63d03ba71b4776965696f3d4a88
@@ -1 +0,0 @@
1
- 1a38f931edf9925af1d131a0e0a0822bd880dcc8
@@ -1 +0,0 @@
1
- 4145b5a8078b613e10205937ffb3da254d006fe78fbb169d8b2cedb3d02c021c
@@ -1 +0,0 @@
1
- ab25979faccc1aa8200a637ea866a5fc59e35bf340170673a01253ae8ce479fb5b7af87167dbde2d43d5b536f3fb350b34b478bbf75f5e87d5276940283a8ab6
@@ -1 +0,0 @@
1
- ce8a041d72a679e6f836a3f4c3821975
@@ -1 +0,0 @@
1
- 139bbd4ed5398cb999dd5fd12a2c9b77409ac2e3
@@ -1 +0,0 @@
1
- 4a017761e2e806b5bb8fac1d054c01cffdfb443129315073172ce3c7720bcecb
@@ -1 +0,0 @@
1
- 94585e8fd886448cc45aca119ed1dd1329f8d743ca902a0911743d7cee94baecae5ecfad1ba62ea8b9471b0fc251c23bfea4032c30f9231e5b8e97d933c8322c