detox 20.23.1 → 20.23.2-smoke.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. package/Detox-android/com/wix/detox/{20.23.1/detox-20.23.1-sources.jar → 20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.aar +0 -0
  7. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.aar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.aar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.aar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.aar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{20.23.1/detox-20.23.1.pom → 20.23.2-smoke.0/detox-20.23.2-smoke.0.pom} +1 -1
  12. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.pom.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.pom.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.pom.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.pom.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  17. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  18. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  19. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  20. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  21. package/Detox-android/com/wix/detox-legacy/{20.23.1/detox-legacy-20.23.1-sources.jar → 20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar} +0 -0
  22. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar.md5 +1 -0
  23. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar.sha1 +1 -0
  24. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar.sha256 +1 -0
  25. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar.sha512 +1 -0
  26. package/Detox-android/com/wix/detox-legacy/{20.23.1/detox-legacy-20.23.1.aar → 20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar} +0 -0
  27. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar.md5 +1 -0
  28. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar.sha1 +1 -0
  29. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar.sha256 +1 -0
  30. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar.sha512 +1 -0
  31. package/Detox-android/com/wix/detox-legacy/{20.23.1/detox-legacy-20.23.1.pom → 20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom} +1 -1
  32. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom.md5 +1 -0
  33. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom.sha1 +1 -0
  34. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom.sha256 +1 -0
  35. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom.sha512 +1 -0
  36. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml +4 -4
  37. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.md5 +1 -1
  38. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha1 +1 -1
  39. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha256 +1 -1
  40. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha512 +1 -1
  41. package/Detox-ios-framework.tbz +0 -0
  42. package/Detox-ios-src.tbz +0 -0
  43. package/Detox-ios-xcuitest.tbz +0 -0
  44. package/android/detox/src/full/java/com/wix/detox/espresso/DetoxMatcher.java +11 -12
  45. package/android/detox/src/full/java/com/wix/detox/espresso/matcher/IsDisplayingAtLeastDetoxMatcher.kt +145 -0
  46. package/android/detox/src/full/java/com/wix/detox/espresso/matcher/ViewMatchers.kt +3 -0
  47. package/android/detox/src/testFull/resources/robolectric.properties +1 -1
  48. package/package.json +2 -2
  49. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1-sources.jar.md5 +0 -1
  50. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1-sources.jar.sha1 +0 -1
  51. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1-sources.jar.sha256 +0 -1
  52. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1-sources.jar.sha512 +0 -1
  53. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.aar +0 -0
  54. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.aar.md5 +0 -1
  55. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.aar.sha1 +0 -1
  56. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.aar.sha256 +0 -1
  57. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.aar.sha512 +0 -1
  58. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.pom.md5 +0 -1
  59. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.pom.sha1 +0 -1
  60. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.pom.sha256 +0 -1
  61. package/Detox-android/com/wix/detox/20.23.1/detox-20.23.1.pom.sha512 +0 -1
  62. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1-sources.jar.md5 +0 -1
  63. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1-sources.jar.sha1 +0 -1
  64. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1-sources.jar.sha256 +0 -1
  65. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1-sources.jar.sha512 +0 -1
  66. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1.aar.md5 +0 -1
  67. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1.aar.sha1 +0 -1
  68. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1.aar.sha256 +0 -1
  69. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1.aar.sha512 +0 -1
  70. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1.pom.md5 +0 -1
  71. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1.pom.sha1 +0 -1
  72. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1.pom.sha256 +0 -1
  73. package/Detox-android/com/wix/detox-legacy/20.23.1/detox-legacy-20.23.1.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ ed1be2e6a4a9de036c4c82a3685fb64d
@@ -0,0 +1 @@
1
+ fe5bfc9cdc8a8123e5a531e23e751cf58a74f18e
@@ -0,0 +1 @@
1
+ c5f1e92eff24778043d565adaa667f26393176f02b9e21f2b79a464f3e96ab34
@@ -0,0 +1 @@
1
+ 3c390122f86540122713417396dd8809c09f0c78809a88ce2889ff4c53122ad9e790d48b2d0dfb9475ec067631c1dc661d980eae2eb1005619a716cdf822006c
@@ -0,0 +1 @@
1
+ c30ab5e84a5014b0b81d4faabde6a700
@@ -0,0 +1 @@
1
+ 5bb074cd595fd75e357176cbd1427eb75ed4e8d5
@@ -0,0 +1 @@
1
+ 5fc6ee2c1a19b885d28766a68f924162061b405d79aec808d7c41eb3165bc2b1
@@ -0,0 +1 @@
1
+ 844af749105ed914beb68383c07baf6fd4bdc33b053073f0bd29de638e7474cd66a31bf2df6a0f7824d0f322b742eed9d9376da5ada807a5cd539dd217fe2ab5
@@ -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.23.1</version>
6
+ <version>20.23.2-smoke.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
+ 695ca8c83a9ca9732212ede0b994426d
@@ -0,0 +1 @@
1
+ 01b188846e4b6c7903ad135bbf7dd481d9c49c7b
@@ -0,0 +1 @@
1
+ eac469c94469dbc2f7e132654885574cea14019903725a418ca556a9223d4a07
@@ -0,0 +1 @@
1
+ 4b1eca97bb0bd89458f81c369a2d2e7cdf894a2038b92bbe67a9b1e1feecf69dc605f580dfc5a6b9aee07df7342d95992f83cf50722d2667a235fcd522682f30
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.23.1</latest>
7
- <release>20.23.1</release>
6
+ <latest>20.23.2-smoke.0</latest>
7
+ <release>20.23.2-smoke.0</release>
8
8
  <versions>
9
- <version>20.23.1</version>
9
+ <version>20.23.2-smoke.0</version>
10
10
  </versions>
11
- <lastUpdated>20240707082451</lastUpdated>
11
+ <lastUpdated>20240711082111</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 78b48563afe0104137fd3b757f1bcdc5
1
+ c5d84a01d446af422c8a56081568088e
@@ -1 +1 @@
1
- 5529cca0a44104194e06b119d685ac67700c7ef9
1
+ cad52192217ab8710048332b8da4d7156c1a0a1b
@@ -1 +1 @@
1
- 1d7b645643d03590d649689c164e62fa9d72a77f7cd3620bbcbd8c8a0024d88d
1
+ 360e627f2037ff7be332f56c9b5803c66717c13a3a3177a89da116ad099c6245
@@ -1 +1 @@
1
- c7736535d361fd82b448019e52539a2e6812605cd99c5452053c1176831258df602f390ee523a28a1a82311e33e6eee19cbb9f35b3a2aae2c5c1bbf4427db74c
1
+ ca2e0fd044c3bdff63a5bc10274bb81b7b815f7aba16b5736c778910cc1bcb38148afe0db4f78b8009f47068eebe634061fbdbb4ae2ab754d6bdea69d3935a89
@@ -0,0 +1 @@
1
+ 3e1bc603593d47252544ff8304b924a48e6ccc246261db360c8ecbc58172b01e
@@ -0,0 +1 @@
1
+ c12048517a2a252f9caed898f73211a0485e0f5f34879eb4a4b11e492bbe1283a41a8a58345df0dd69ec822684a3a8d36dc86f539297a16c0b0c86f20ac9a617
@@ -0,0 +1 @@
1
+ 697e735f9b859cf2cf8097e9ea2b99ed1b018ef4
@@ -0,0 +1 @@
1
+ b5fa97662e36dee60aa838e47f457705d0145b0243dd2f7eb0076ec53ea42127
@@ -0,0 +1 @@
1
+ cb3be83d53a83577894d9ed9fe8d96c86ebfa960c3be707684d82eb911871aebe33dcfc5fff988dc9a40e99135962a8ac8ac4c9f1be02ac957eb1fd0ddbb2277
@@ -3,7 +3,7 @@
3
3
  <modelVersion>4.0.0</modelVersion>
4
4
  <groupId>com.wix</groupId>
5
5
  <artifactId>detox-legacy</artifactId>
6
- <version>20.23.1</version>
6
+ <version>20.23.2-smoke.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
+ c40c157385354846dbace7287e4b216e5c8c2018
@@ -0,0 +1 @@
1
+ 5549ceca38b4c6a6fe0dea84247db9eeedb2d3eabacf0630f68038a1d80ac248
@@ -0,0 +1 @@
1
+ 3e7329a64b7d0411765f4620e46cd3f7cd493f6ccf0ce47e5526f83af72ab7a14fd60bf229ae4c6db96245e69d4ea308e2ee5b23d638142057ced5c562d2acd0
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox-legacy</artifactId>
5
5
  <versioning>
6
- <latest>20.23.1</latest>
7
- <release>20.23.1</release>
6
+ <latest>20.23.2-smoke.0</latest>
7
+ <release>20.23.2-smoke.0</release>
8
8
  <versions>
9
- <version>20.23.1</version>
9
+ <version>20.23.2-smoke.0</version>
10
10
  </versions>
11
- <lastUpdated>20240707082529</lastUpdated>
11
+ <lastUpdated>20240711082136</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- e03e58fb9452a8ebadba990679a065be
1
+ 0f436877f2c3b17a186f682bacb2d685
@@ -1 +1 @@
1
- b41fb223cda9768095fb8284545f2e99f7903e77
1
+ 1c8b1bfd41b9caf20abbff6f9f344a73d91b54b4
@@ -1 +1 @@
1
- 86cf62280fc03cd5c0412e0910d613653fa1a1dec574233c4cd1782d34658c92
1
+ 54a26ecd056ecb46d3468291560a3ab91ead3065c8f71b659cf093fbc755709f
@@ -1 +1 @@
1
- dfab2257d6aaa2833bda70a27bd86468f5f68859993b3f1581c60e23eb018a8eefe664bdca0c32bbff9431279d21a36a9a94adcf91fb723a184988f5825bf71c
1
+ 6e91dc08e997b3344ba8b2b6e7ff60177f6b9bd19a94e0b22330373361cdacbe7324b7b8164bf5809877663b573ed1968c36366cf8d3a2d69f15488bc94871e8
Binary file
package/Detox-ios-src.tbz CHANGED
Binary file
Binary file
@@ -1,35 +1,34 @@
1
1
  package com.wix.detox.espresso;
2
2
 
3
- import android.view.View;
4
-
5
- import org.hamcrest.Matcher;
6
-
7
- import androidx.test.espresso.matcher.ViewMatchers.Visibility;
8
-
9
3
  import static androidx.test.espresso.matcher.ViewMatchers.hasDescendant;
10
4
  import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom;
11
5
  import static androidx.test.espresso.matcher.ViewMatchers.isChecked;
12
6
  import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA;
13
7
  import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
14
- import static androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast;
15
8
  import static androidx.test.espresso.matcher.ViewMatchers.isFocused;
16
9
  import static androidx.test.espresso.matcher.ViewMatchers.isNotChecked;
17
10
  import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
18
- import static com.wix.detox.espresso.matcher.ViewMatchers.withTagValue;
19
- import static com.wix.detox.espresso.matcher.ViewMatchers.withContentDescription;
20
- import static com.wix.detox.espresso.matcher.ViewMatchers.withText;
11
+ import static com.wix.detox.espresso.matcher.ViewMatchers.matcherForDisplayingAtLeast;
21
12
  import static com.wix.detox.espresso.matcher.ViewMatchers.isMatchingAtIndex;
22
13
  import static com.wix.detox.espresso.matcher.ViewMatchers.isOfClassName;
23
14
  import static com.wix.detox.espresso.matcher.ViewMatchers.toHaveSliderPosition;
24
15
  import static com.wix.detox.espresso.matcher.ViewMatchers.withAccessibilityLabel;
16
+ import static com.wix.detox.espresso.matcher.ViewMatchers.withContentDescription;
25
17
  import static com.wix.detox.espresso.matcher.ViewMatchers.withShallowAccessibilityLabel;
18
+ import static com.wix.detox.espresso.matcher.ViewMatchers.withTagValue;
19
+ import static com.wix.detox.espresso.matcher.ViewMatchers.withText;
26
20
  import static org.hamcrest.Matchers.allOf;
27
21
  import static org.hamcrest.Matchers.anyOf;
28
- import static org.hamcrest.Matchers.is;
29
22
  import static org.hamcrest.Matchers.not;
30
23
  import static org.hamcrest.Matchers.notNullValue;
31
24
  import static org.hamcrest.Matchers.nullValue;
32
25
 
26
+ import android.view.View;
27
+
28
+ import androidx.test.espresso.matcher.ViewMatchers.Visibility;
29
+
30
+ import org.hamcrest.Matcher;
31
+
33
32
  /**
34
33
  * Created by simonracz on 10/07/2017.
35
34
  */
@@ -90,7 +89,7 @@ public class DetoxMatcher {
90
89
  }
91
90
 
92
91
  public static Matcher<View> matcherForSufficientlyVisible(int pct) {
93
- return isDisplayingAtLeast(pct);
92
+ return matcherForDisplayingAtLeast(pct);
94
93
  }
95
94
 
96
95
  public static Matcher<View> matcherForNotVisible() {
@@ -0,0 +1,145 @@
1
+ package com.wix.detox.espresso.matcher
2
+
3
+ import android.R
4
+ import android.annotation.SuppressLint
5
+ import android.content.Context
6
+ import android.graphics.Rect
7
+ import android.util.DisplayMetrics
8
+ import android.util.TypedValue
9
+ import android.view.View
10
+ import android.view.WindowManager
11
+ import androidx.test.espresso.matcher.ViewMatchers
12
+ import org.hamcrest.Description
13
+ import org.hamcrest.TypeSafeDiagnosingMatcher
14
+ import kotlin.math.abs
15
+ import kotlin.math.min
16
+
17
+ /**
18
+ * This matcher is a workaround for the issue with the `isDisplayingAtLeast` matcher.
19
+ * Because of an issue with [View.getGlobalVisibleRect], the `isDisplayingAtLeast` matcher does not work
20
+ * as expected with React Native views.
21
+ * @see [React Native Issue](https://github.com/facebook/react-native/issues/23870)
22
+ * The implementation of this matcher is based on the [isDisplayingAtLeast] matcher.
23
+ *
24
+ * This hack can be removed after proper fix in React Native.
25
+ */
26
+ class IsDisplayingAtLeastDetoxMatcher(private val areaPercentage: Int) : TypeSafeDiagnosingMatcher<View>() {
27
+
28
+ private val visibilityMatchers = ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)
29
+
30
+ override fun describeTo(description: Description) {
31
+ description
32
+ .appendText("(")
33
+ .appendDescriptionOf(visibilityMatchers)
34
+ .appendText(" and view.getGlobalVisibleRect() covers at least ")
35
+ .appendValue(areaPercentage)
36
+ .appendText(" percent of the view's area)")
37
+ }
38
+
39
+ override fun matchesSafely(item: View, mismatchDescription: Description): Boolean {
40
+ // First check if the view is visible using the default matcher
41
+ if (!ViewMatchers.isDisplayingAtLeast(areaPercentage).matches(item)) {
42
+ return false
43
+ }
44
+
45
+ // In case it is, we need to check if the view is actually visible by running intersection of all parent views rects
46
+ return isDisplayingAtLeast(item, mismatchDescription)
47
+ }
48
+
49
+ private fun isDisplayingAtLeast(view: View, mismatchDescription: Description): Boolean {
50
+ val viewVisibleRect = getGlobalVisibleRectWorkaround(view)
51
+ val maxArea = getViewMaxArea(view)
52
+ val visibleArea: Double = getViewVisibleArea(viewVisibleRect)
53
+ val displayedPercentage = (visibleArea / maxArea * 100).toInt()
54
+
55
+ if (displayedPercentage < areaPercentage) {
56
+ mismatchDescription
57
+ .appendText("view was ")
58
+ .appendValue(displayedPercentage)
59
+ .appendText(" percent visible to the user")
60
+ return false
61
+ }
62
+ return true
63
+ }
64
+
65
+ /**
66
+ * Calculate the actual visible area of the view.
67
+ */
68
+ private fun getViewVisibleArea(viewVisibleRect: Rect): Double {
69
+ return (viewVisibleRect.height() * viewVisibleRect.width()).toDouble()
70
+ }
71
+
72
+ /**
73
+ * Calculate the maximum possible area of the view (including the not visible part).
74
+ */
75
+ private fun getViewMaxArea(view: View): Double {
76
+ val (viewWidth, viewHeight) = getViewSize(view)
77
+ return viewWidth * viewHeight
78
+ }
79
+
80
+ /**
81
+ * Calculate the actual size of the view, taking into account the scaling factor and the screen size.
82
+ */
83
+ private fun getViewSize(view: View): Pair<Double, Double> {
84
+ val screenSize = getScreenWithoutStatusBarActionBar(view)
85
+ val viewWidth = min((view.width * abs(view.scaleX.toDouble())), screenSize.width().toDouble())
86
+ val viewHeight = min((view.height * abs(view.scaleY.toDouble())), screenSize.height().toDouble())
87
+ return Pair(viewWidth, viewHeight)
88
+ }
89
+
90
+ /**
91
+ * Traverse the view hierarchy and calculate the intersection of all parent views with the given view.
92
+ *
93
+ * @return The actual visible rectangle of the view.
94
+ */
95
+ private fun getGlobalVisibleRectWorkaround(view: View): Rect {
96
+ var currentParent = view.parent as? View
97
+
98
+ val calculatedVisibleRect = Rect()
99
+ view.getGlobalVisibleRect(calculatedVisibleRect)
100
+
101
+ while (currentParent != null) {
102
+ val parentVisibleRectangle = Rect()
103
+ // Fill the visible rectangle of the parent view
104
+ currentParent.getGlobalVisibleRect(parentVisibleRectangle)
105
+
106
+ // The viewVisibleRect will be replaced with the intersection of the viewVisibleRect and the parentVisibleRectangle
107
+ if (!calculatedVisibleRect.intersect(parentVisibleRectangle)) {
108
+ return Rect()
109
+ }
110
+
111
+ currentParent = currentParent.parent as? View
112
+ }
113
+
114
+ return calculatedVisibleRect
115
+ }
116
+
117
+ private fun getScreenWithoutStatusBarActionBar(view: View): Rect {
118
+ val m = DisplayMetrics()
119
+ (view.context.getSystemService(Context.WINDOW_SERVICE) as WindowManager)
120
+ .defaultDisplay
121
+ .getMetrics(m)
122
+
123
+ val statusBarHeight = getStatusBarHeight(view)
124
+ val actionBarHeight = getActionBarHeight(view)
125
+ return Rect(0, 0, m.widthPixels, m.heightPixels - (statusBarHeight + actionBarHeight))
126
+ }
127
+
128
+ private fun getActionBarHeight(view: View): Int {
129
+ val tv = TypedValue()
130
+ val actionBarHeight = if (view.context.theme.resolveAttribute(R.attr.actionBarSize, tv, true)) {
131
+ TypedValue.complexToDimensionPixelSize(
132
+ tv.data, view.context.resources.displayMetrics
133
+ )
134
+ } else {
135
+ 0
136
+ }
137
+ return actionBarHeight
138
+ }
139
+
140
+ @SuppressLint("InternalInsetResource", "DiscouragedApi")
141
+ private fun getStatusBarHeight(view: View): Int {
142
+ val resourceId = view.context.resources.getIdentifier("status_bar_height", "dimen", "android")
143
+ return if (resourceId > 0) view.context.resources.getDimensionPixelSize(resourceId) else 0
144
+ }
145
+ }
@@ -66,6 +66,9 @@ fun toHaveSliderPosition(expectedValuePct: Double, tolerance: Double): Matcher<V
66
66
  }
67
67
  }
68
68
 
69
+ fun matcherForDisplayingAtLeast(percents: Int): Matcher<View> =
70
+ IsDisplayingAtLeastDetoxMatcher(percents)
71
+
69
72
  /**
70
73
  * Same as [androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom], but accepts any class. Needed
71
74
  * in order to avoid warning when passing 'any' class.
@@ -1 +1 @@
1
- sdk=28
1
+ sdk=34
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.23.1",
4
+ "version": "20.23.2-smoke.0",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -115,5 +115,5 @@
115
115
  "browserslist": [
116
116
  "node 14"
117
117
  ],
118
- "gitHead": "b88feaef564db9789ae93495e16345b617bf79ea"
118
+ "gitHead": "eb228ba5b8e7da7d9e41ed17d51d6a59c497e640"
119
119
  }
@@ -1 +0,0 @@
1
- a6c11f311486c0089c2a591153da960b
@@ -1 +0,0 @@
1
- eb688821805ba530cd0c2f992602d4c1e60f7baa
@@ -1 +0,0 @@
1
- 97ac302fd60d3222cd12a017689a5aec0fe1807ff13669963de994f021d7e9f1
@@ -1 +0,0 @@
1
- 729e03d6844e9cd93e0263cb91a677bb413e1f92c02dfe9818bd8bc9c386d578357e44aa4c88597317c849a922616201c4d3baa5170e5ac011a2d6b537569b9d
@@ -1 +0,0 @@
1
- 31bc3655525c5e1de60651828dbe4b23
@@ -1 +0,0 @@
1
- 05e3d3c1fb1dfe0ef619885bd89f3e23ad265c14
@@ -1 +0,0 @@
1
- 4c664be552f9844c390dcf9843c16195ee71ae5fac82340fc2fa26d7f98f97da
@@ -1 +0,0 @@
1
- b9a385a9b94cf5b0bec34751c9c7e03fd7cd8f6f094beac31df31bed89dbe93895289e45a08cf230a9806c71786ae74c75e8f58f3f57814624af8fa28e6b76d6
@@ -1 +0,0 @@
1
- 4aa672371661e33ad6fd319635800fe3
@@ -1 +0,0 @@
1
- 048238d8892904bfdc5cc5a5fb53c2343f6ebd22
@@ -1 +0,0 @@
1
- 23fde2bba6b636f529b57824b37826605d5bcb992c4be7e1b7868a0e8e8d05b0
@@ -1 +0,0 @@
1
- cc0f7a5b564f095425eb028941db473432ec29578e2941938b0cb984fbc417fc40cf37b6b082326980ae92b40fe93ccc16232dd23810901d0de024d95538a81c
@@ -1 +0,0 @@
1
- 640b542a370a33156a7f5b3ce93cf14c
@@ -1 +0,0 @@
1
- ab462a41c3beba1d0d091d3ad825945c22a24f4c
@@ -1 +0,0 @@
1
- 090fe49e76e78a4df885259987094d69e43a2598ccf160a84b2b721c687dffba
@@ -1 +0,0 @@
1
- 338bfe5267f92249ff291bdfde8b151af5dcaa68ceead4ba633902913cb7f50dddf69ddf259d5a92905c6f34a09c0060f016c0a9ed8c1fca9f1d3548c703d351
@@ -1 +0,0 @@
1
- f35c1d0b6e6002973dc3a27dcd693666
@@ -1 +0,0 @@
1
- 95b13b9d33524b8c704258c314a3e21572086d45
@@ -1 +0,0 @@
1
- a40f50e7629a8076af5698aa1a533523ea1bc53782240ff01be641911d8865b2
@@ -1 +0,0 @@
1
- c3c9d8eca84ce4da0e1a75a7364ec0a8df8fd1b910db22769b719d4c222fbb726ba973a41c35eeab77db3603c87a31d8b85bb71cd6c5d25bdb36d48f72733fa4
@@ -1 +0,0 @@
1
- fafebb865959268871870adcec140228
@@ -1 +0,0 @@
1
- d4615c9c5e6f8cad8a55f161ad8749b800a6a225
@@ -1 +0,0 @@
1
- a18809379a8aea88523e3e85d3f21153e7bb48ac0dd085f334176f03eb00df33
@@ -1 +0,0 @@
1
- 4545c4f1ced6aff0f03cba2a4a5189a5e96435dcaf3291e401e334c8766cd58bf8c85d99c4d89f3acf0ed06d6f270a0496b1ff4745d79148075aa88b586f47a3