detox 20.1.3-smoke.0 → 20.1.4
Sign up to get free protection for your applications and to get access to all the features.
- package/Detox-android/com/wix/detox/{20.1.3-smoke.0/detox-20.1.3-smoke.0-javadoc.jar → 20.1.4/detox-20.1.4-javadoc.jar} +0 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4-javadoc.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4-javadoc.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4-javadoc.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4-javadoc.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.1.3-smoke.0/detox-20.1.3-smoke.0-sources.jar → 20.1.4/detox-20.1.4-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.1.3-smoke.0/detox-20.1.3-smoke.0.aar → 20.1.4/detox-20.1.4.aar} +0 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4.aar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4.aar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.1.3-smoke.0/detox-20.1.3-smoke.0.pom → 20.1.4/detox-20.1.4.pom} +13 -1
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.1.4/detox-20.1.4.pom.sha512 +1 -0
- package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
- package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
- package/Detox-ios-src.tbz +0 -0
- package/Detox-ios.tbz +0 -0
- package/android/build.gradle +1 -1
- package/android/detox/build.gradle +4 -0
- package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java +31 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/index.d.ts +8 -5
- package/local-cli/run-server.js +12 -1
- package/package.json +3 -4
- package/src/android/actions/native.js +8 -0
- package/src/android/core/NativeElement.js +11 -0
- package/src/android/espressoapi/DetoxAction.js +25 -0
- package/src/devices/runtime/drivers/android/genycloud/GenyCloudDriver.js +1 -11
- package/src/devices/runtime/factories/android.js +0 -1
- package/src/ios/expectTwo.js +4 -0
- package/src/utils/dateUtils.js +5 -0
- package/src/utils/logger.js +1 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0.aar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.1.3-smoke.0/detox-20.1.3-smoke.0.pom.sha512 +0 -1
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
a037b43ce6bc59546776fdca033ac14d
|
@@ -0,0 +1 @@
|
|
1
|
+
bc477e164dea9fb8564a3777fe9292f1a01e2c6a
|
@@ -0,0 +1 @@
|
|
1
|
+
6ad72ad7919203a5031df3a8f207d8f364c466b06425e832f17495407454251c
|
@@ -0,0 +1 @@
|
|
1
|
+
4f5ee1c9cf2741ed00a83d041bc5e098610667feea261d3b2bad4d8153987c05b4238853a76abd94f3076f47505fd62b406182dbff88920a8aa9d3c7ae656f08
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
51bfbca6459248aa9b5de068729dd717
|
@@ -0,0 +1 @@
|
|
1
|
+
bbfc6d7cc390c93ebc6184badd6fd534b87b6650
|
@@ -0,0 +1 @@
|
|
1
|
+
308ebaa7fb78b7e9441bd9309989c1e14d70b0e32f3e9ee24f022c92d0682d0f
|
@@ -0,0 +1 @@
|
|
1
|
+
9950fec15e1dbcf1e54f34edf1f778e2f0ff5509b9e844bab207f12c1e7a49c1320c233e5d3a057d55f617e7fcdde1a3d957568d60903ecb31c4b278033619bf
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
e8ad50ff5afce32b3cb728f837917c3a
|
@@ -0,0 +1 @@
|
|
1
|
+
8f1738000005765fd1d4746e5f2d85c766dd591f
|
@@ -0,0 +1 @@
|
|
1
|
+
da1efa26b94b52cdbb831470e5753e0982bbe5ec1c861f8965a7347199e67b8b
|
@@ -0,0 +1 @@
|
|
1
|
+
9940e5dd655923d057b095817edc22c952105b1518ff02f1316cfd50be45999127e8410eb9b22e95d155517f455a484b3a52f9533f6f40e3f1e9efbf49a5eaa9
|
@@ -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.1.
|
6
|
+
<version>20.1.4</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>
|
@@ -42,6 +42,18 @@
|
|
42
42
|
<version>3.4.0</version>
|
43
43
|
<scope>compile</scope>
|
44
44
|
</dependency>
|
45
|
+
<dependency>
|
46
|
+
<groupId>androidx.test.espresso</groupId>
|
47
|
+
<artifactId>espresso-contrib</artifactId>
|
48
|
+
<version>3.4.0</version>
|
49
|
+
<scope>compile</scope>
|
50
|
+
<exclusions>
|
51
|
+
<exclusion>
|
52
|
+
<groupId>org.checkerframework</groupId>
|
53
|
+
<artifactId>checker</artifactId>
|
54
|
+
</exclusion>
|
55
|
+
</exclusions>
|
56
|
+
</dependency>
|
45
57
|
<dependency>
|
46
58
|
<groupId>androidx.test</groupId>
|
47
59
|
<artifactId>rules</artifactId>
|
@@ -0,0 +1 @@
|
|
1
|
+
276b12e3498bd391aa3b9fc7a8592d2a
|
@@ -0,0 +1 @@
|
|
1
|
+
186e24c87264e1d5ab32ff86ec2e004582319328
|
@@ -0,0 +1 @@
|
|
1
|
+
1bed68095956cfb460a5604f0365c6f2af83a3b738ccdf1f45ad30b315bbfb26
|
@@ -0,0 +1 @@
|
|
1
|
+
435866ac061a537fe55d601a43aceced241b3a15874fec00f6963b4e917da029a9b157169515ad5922422549520ac9e69ac9d2c9b38a47e7e19e1611233c2647
|
@@ -3,11 +3,11 @@
|
|
3
3
|
<groupId>com.wix</groupId>
|
4
4
|
<artifactId>detox</artifactId>
|
5
5
|
<versioning>
|
6
|
-
<latest>20.1.
|
7
|
-
<release>20.1.
|
6
|
+
<latest>20.1.4</latest>
|
7
|
+
<release>20.1.4</release>
|
8
8
|
<versions>
|
9
|
-
<version>20.1.
|
9
|
+
<version>20.1.4</version>
|
10
10
|
</versions>
|
11
|
-
<lastUpdated>
|
11
|
+
<lastUpdated>20230219155712</lastUpdated>
|
12
12
|
</versioning>
|
13
13
|
</metadata>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
477850ee9d457fff5e051c384e935a36
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6892b767c10d18357da7200e4930c5928f91e79d
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
fe6380e49ff410b2ad3ac229c662f3c18d284a28a3b78b2fdd548d57e4240e9a
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
1cf976ff594d5f85a1c92f518a65a2bc53b5838036c8a03bb65933155e7f72eb689dcd6828ff60c9069b0a2f8f5a5af0db8571909bd5540e5524389eea162a93
|
package/Detox-ios-src.tbz
CHANGED
Binary file
|
package/Detox-ios.tbz
CHANGED
Binary file
|
package/android/build.gradle
CHANGED
@@ -23,7 +23,7 @@ buildscript {
|
|
23
23
|
google()
|
24
24
|
}
|
25
25
|
dependencies {
|
26
|
-
classpath 'com.android.tools.build:gradle:7.
|
26
|
+
classpath 'com.android.tools.build:gradle:7.2.1'
|
27
27
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
28
28
|
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
|
29
29
|
|
@@ -95,6 +95,10 @@ dependencies {
|
|
95
95
|
api('androidx.test.espresso:espresso-web:3.4.0') {
|
96
96
|
because 'Web-View testing'
|
97
97
|
}
|
98
|
+
api('androidx.test.espresso:espresso-contrib:3.4.0') {
|
99
|
+
because 'Android datepicker support'
|
100
|
+
exclude group: "org.checkerframework", module: "checker"
|
101
|
+
}
|
98
102
|
api('androidx.test:rules:1.4.0') {
|
99
103
|
because 'of ActivityTestRule. Needed by users *and* internally used by Detox.'
|
100
104
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
package com.wix.detox.espresso;
|
2
2
|
|
3
3
|
import android.view.View;
|
4
|
+
import android.os.Build;
|
4
5
|
|
5
6
|
import com.wix.detox.common.DetoxErrors.DetoxRuntimeException;
|
6
7
|
import com.wix.detox.common.DetoxErrors.StaleActionException;
|
@@ -19,6 +20,11 @@ import com.wix.detox.espresso.scroll.ScrollHelper;
|
|
19
20
|
import com.wix.detox.espresso.scroll.SwipeHelper;
|
20
21
|
|
21
22
|
import org.hamcrest.Matcher;
|
23
|
+
import java.text.ParseException;
|
24
|
+
import java.text.SimpleDateFormat;
|
25
|
+
import java.time.ZonedDateTime;
|
26
|
+
import java.util.Calendar;
|
27
|
+
import java.util.Date;
|
22
28
|
|
23
29
|
import androidx.test.espresso.UiController;
|
24
30
|
import androidx.test.espresso.ViewAction;
|
@@ -26,10 +32,12 @@ import androidx.test.espresso.action.CoordinatesProvider;
|
|
26
32
|
import androidx.test.espresso.action.GeneralClickAction;
|
27
33
|
import androidx.test.espresso.action.GeneralLocation;
|
28
34
|
import androidx.test.espresso.action.Press;
|
35
|
+
import androidx.test.espresso.contrib.PickerActions;
|
29
36
|
|
30
37
|
import static androidx.test.espresso.action.ViewActions.actionWithAssertions;
|
31
38
|
import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom;
|
32
39
|
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
40
|
+
|
33
41
|
import static org.hamcrest.Matchers.allOf;
|
34
42
|
|
35
43
|
|
@@ -39,6 +47,8 @@ import static org.hamcrest.Matchers.allOf;
|
|
39
47
|
|
40
48
|
public class DetoxAction {
|
41
49
|
private static final String LOG_TAG = "detox";
|
50
|
+
private static final String ISO8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";
|
51
|
+
private static final String ISO8601_FORMAT_NO_TZ = "yyyy-MM-dd'T'HH:mm:ss";
|
42
52
|
|
43
53
|
private DetoxAction() {
|
44
54
|
// static class
|
@@ -149,6 +159,19 @@ public class DetoxAction {
|
|
149
159
|
return new ScrollToIndexAction(index);
|
150
160
|
}
|
151
161
|
|
162
|
+
public static ViewAction setDatePickerDate(String dateString, String formatString) throws ParseException {
|
163
|
+
Date date;
|
164
|
+
if (formatString.equals("ISO8601")) {
|
165
|
+
date = parseDateISO8601(dateString);
|
166
|
+
} else {
|
167
|
+
date = new SimpleDateFormat(formatString).parse(dateString);
|
168
|
+
}
|
169
|
+
|
170
|
+
Calendar cal = Calendar.getInstance();
|
171
|
+
cal.setTime(date);
|
172
|
+
return PickerActions.setDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH));
|
173
|
+
}
|
174
|
+
|
152
175
|
public static ViewAction adjustSliderToPosition(final double newPosition) {
|
153
176
|
return new AdjustSliderToPositionAction(newPosition);
|
154
177
|
}
|
@@ -179,4 +202,12 @@ public class DetoxAction {
|
|
179
202
|
}
|
180
203
|
};
|
181
204
|
}
|
205
|
+
|
206
|
+
private static Date parseDateISO8601(String dateString) throws ParseException {
|
207
|
+
try {
|
208
|
+
return new SimpleDateFormat(ISO8601_FORMAT).parse(dateString);
|
209
|
+
} catch (ParseException e) {
|
210
|
+
return new SimpleDateFormat(ISO8601_FORMAT_NO_TZ).parse(dateString);
|
211
|
+
}
|
212
|
+
}
|
182
213
|
}
|
@@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
|
|
3
3
|
distributionPath=wrapper/dists
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
5
5
|
zipStorePath=wrapper/dists
|
6
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.
|
6
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
|
7
7
|
|
package/index.d.ts
CHANGED
@@ -1365,12 +1365,15 @@ declare global {
|
|
1365
1365
|
setColumnToValue(column: number, value: string): Promise<void>;
|
1366
1366
|
|
1367
1367
|
/**
|
1368
|
-
* Sets the date of a date
|
1369
|
-
* @param dateString
|
1370
|
-
* @param dateFormat
|
1368
|
+
* Sets the date of a date-picker according to the specified date-string and format.
|
1369
|
+
* @param dateString Textual representation of a date (e.g. '2023/01/01'). Should be in coherence with the format specified by `dateFormat`.
|
1370
|
+
* @param dateFormat Format of `dateString`: Generally either 'ISO8601' or an explicitly specified format (e.g. 'yyyy/MM/dd'); It should
|
1371
|
+
* follow the rules of NSDateFormatter for iOS and DateTimeFormatter for Android.
|
1372
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
|
1371
1373
|
* @example
|
1372
|
-
* await
|
1373
|
-
* await element(by.id('datePicker')).setDatePickerDate(
|
1374
|
+
* await element(by.id('datePicker')).setDatePickerDate('2023-01-01T00:00:00Z', 'ISO8601');
|
1375
|
+
* await element(by.id('datePicker')).setDatePickerDate(new Date().toISOString(), 'ISO8601');
|
1376
|
+
* await element(by.id('datePicker')).setDatePickerDate('2023/01/01', 'yyyy/MM/dd');
|
1374
1377
|
*/
|
1375
1378
|
setDatePickerDate(dateString: string, dateFormat: string): Promise<void>;
|
1376
1379
|
|
package/local-cli/run-server.js
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
const
|
1
|
+
const collectCliConfig = require('../src/configuration/collectCliConfig');
|
2
|
+
const composeLoggerConfig = require('../src/configuration/composeLoggerConfig');
|
3
|
+
const { DetoxRuntimeError } = require('../src/errors');
|
2
4
|
const DetoxServer = require('../src/server/DetoxServer');
|
5
|
+
const logger = require('../src/utils/logger');
|
3
6
|
|
4
7
|
module.exports.command = 'run-server';
|
5
8
|
module.exports.desc = 'Start a standalone Detox server';
|
@@ -28,6 +31,14 @@ module.exports.handler = async function runServer(argv) {
|
|
28
31
|
throw new DetoxRuntimeError(`The port should be between 1 and 65535, got ${argv.port}`);
|
29
32
|
}
|
30
33
|
|
34
|
+
await logger.setConfig(composeLoggerConfig({
|
35
|
+
// @ts-ignore
|
36
|
+
globalConfig: {},
|
37
|
+
// @ts-ignore
|
38
|
+
localConfig: {},
|
39
|
+
cliConfig: collectCliConfig({ argv }),
|
40
|
+
}));
|
41
|
+
|
31
42
|
await new DetoxServer({
|
32
43
|
port: +argv.port,
|
33
44
|
standalone: true,
|
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.1.
|
4
|
+
"version": "20.1.4",
|
5
5
|
"bin": {
|
6
6
|
"detox": "local-cli/cli.js"
|
7
7
|
},
|
@@ -51,7 +51,7 @@
|
|
51
51
|
"jest-allure2-reporter": "^1.2.1",
|
52
52
|
"mockdate": "^2.0.1",
|
53
53
|
"prettier": "1.7.0",
|
54
|
-
"react-native": "0.
|
54
|
+
"react-native": "0.70.7",
|
55
55
|
"react-native-codegen": "^0.0.8",
|
56
56
|
"typescript": "^4.5.2",
|
57
57
|
"wtfnode": "^0.9.1"
|
@@ -146,7 +146,6 @@
|
|
146
146
|
"src/devices/common/drivers/ios/tools",
|
147
147
|
"src/devices/runtime/drivers/android/AndroidDriver.js",
|
148
148
|
"src/devices/runtime/drivers/android/emulator/EmulatorDriver.js",
|
149
|
-
"src/devices/runtime/drivers/android/genycloud/GenyCloudDriver.js",
|
150
149
|
"src/devices/runtime/drivers/DeviceDriverBase.js",
|
151
150
|
"src/devices/runtime/drivers/ios",
|
152
151
|
"src/devices/runtime/factories",
|
@@ -200,5 +199,5 @@
|
|
200
199
|
}
|
201
200
|
}
|
202
201
|
},
|
203
|
-
"gitHead": "
|
202
|
+
"gitHead": "f41b0fa54e6de03488e80a7a67e6b3d859e8a1a4"
|
204
203
|
}
|
@@ -124,6 +124,13 @@ class ScrollToIndex extends Action {
|
|
124
124
|
}
|
125
125
|
}
|
126
126
|
|
127
|
+
class SetDatePickerDateAction extends Action {
|
128
|
+
constructor(dateString, formatString) {
|
129
|
+
super();
|
130
|
+
this._call = invoke.callDirectly(DetoxActionApi.setDatePickerDate(dateString, formatString));
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
127
134
|
class AdjustSliderToPosition extends Action {
|
128
135
|
constructor(newPosition) {
|
129
136
|
super();
|
@@ -155,5 +162,6 @@ module.exports = {
|
|
155
162
|
SwipeAction,
|
156
163
|
TakeElementScreenshot,
|
157
164
|
ScrollToIndex,
|
165
|
+
SetDatePickerDateAction,
|
158
166
|
AdjustSliderToPosition,
|
159
167
|
};
|
@@ -5,6 +5,7 @@ const tempfile = require('tempfile');
|
|
5
5
|
|
6
6
|
const DetoxRuntimeError = require('../../errors/DetoxRuntimeError');
|
7
7
|
const invoke = require('../../invoke');
|
8
|
+
const { removeMilliseconds } = require('../../utils/dateUtils');
|
8
9
|
const { actionDescription } = require('../../utils/invocationTraceDescriptions');
|
9
10
|
const actions = require('../actions/native');
|
10
11
|
const DetoxMatcherApi = require('../espressoapi/DetoxMatcher');
|
@@ -112,6 +113,16 @@ class NativeElement {
|
|
112
113
|
return await new ActionInteraction(this._invocationManager, this, action, traceDescription).execute();
|
113
114
|
}
|
114
115
|
|
116
|
+
async setDatePickerDate(rawDateString, formatString) {
|
117
|
+
const dateString = formatString === 'ISO8601'
|
118
|
+
? removeMilliseconds(rawDateString)
|
119
|
+
: rawDateString;
|
120
|
+
|
121
|
+
const action = new actions.SetDatePickerDateAction(dateString, formatString);
|
122
|
+
const traceDescription = actionDescription.setDatePickerDate(dateString, formatString);
|
123
|
+
return await new ActionInteraction(this._invocationManager, this, action, traceDescription).execute();
|
124
|
+
}
|
125
|
+
|
115
126
|
/**
|
116
127
|
* @param {'up' | 'right' | 'down' | 'left'} direction
|
117
128
|
* @param {'slow' | 'fast'} [speed]
|
@@ -194,6 +194,19 @@ class DetoxAction {
|
|
194
194
|
};
|
195
195
|
}
|
196
196
|
|
197
|
+
static setDatePickerDate(dateString, formatString) {
|
198
|
+
if (typeof dateString !== "string") throw new Error("dateString should be a string, but got " + (dateString + (" (" + (typeof dateString + ")"))));
|
199
|
+
if (typeof formatString !== "string") throw new Error("formatString should be a string, but got " + (formatString + (" (" + (typeof formatString + ")"))));
|
200
|
+
return {
|
201
|
+
target: {
|
202
|
+
type: "Class",
|
203
|
+
value: "com.wix.detox.espresso.DetoxAction"
|
204
|
+
},
|
205
|
+
method: "setDatePickerDate",
|
206
|
+
args: [dateString, formatString]
|
207
|
+
};
|
208
|
+
}
|
209
|
+
|
197
210
|
static adjustSliderToPosition(newPosition) {
|
198
211
|
if (typeof newPosition !== "number") throw new Error("newPosition should be a number, but got " + (newPosition + (" (" + (typeof newPosition + ")"))));
|
199
212
|
return {
|
@@ -220,6 +233,18 @@ class DetoxAction {
|
|
220
233
|
};
|
221
234
|
}
|
222
235
|
|
236
|
+
static parseDateISO8601(dateString) {
|
237
|
+
if (typeof dateString !== "string") throw new Error("dateString should be a string, but got " + (dateString + (" (" + (typeof dateString + ")"))));
|
238
|
+
return {
|
239
|
+
target: {
|
240
|
+
type: "Class",
|
241
|
+
value: "com.wix.detox.espresso.DetoxAction"
|
242
|
+
},
|
243
|
+
method: "parseDateISO8601",
|
244
|
+
args: [dateString]
|
245
|
+
};
|
246
|
+
}
|
247
|
+
|
223
248
|
}
|
224
249
|
|
225
250
|
module.exports = DetoxAction;
|
@@ -9,7 +9,6 @@ const AndroidDriver = require('../AndroidDriver');
|
|
9
9
|
/**
|
10
10
|
* @typedef GenycloudDriverProps
|
11
11
|
* @property instance { GenyInstance } The DTO associated with the cloud instance
|
12
|
-
* @property forceAdbInstall { Boolean }
|
13
12
|
*/
|
14
13
|
|
15
14
|
class GenyCloudDriver extends AndroidDriver {
|
@@ -17,10 +16,9 @@ class GenyCloudDriver extends AndroidDriver {
|
|
17
16
|
* @param deps { GenycloudDriverDeps }
|
18
17
|
* @param props { GenycloudDriverProps }
|
19
18
|
*/
|
20
|
-
constructor(deps, { instance
|
19
|
+
constructor(deps, { instance }) {
|
21
20
|
super(deps, { adbName: instance.adbName });
|
22
21
|
this.instance = instance;
|
23
|
-
this._forceAdbInstall = forceAdbInstall;
|
24
22
|
}
|
25
23
|
|
26
24
|
getDeviceName() {
|
@@ -32,14 +30,6 @@ class GenyCloudDriver extends AndroidDriver {
|
|
32
30
|
}
|
33
31
|
|
34
32
|
async _installAppBinaries(appBinaryPath, testBinaryPath) {
|
35
|
-
if (this._forceAdbInstall) {
|
36
|
-
await super._installAppBinaries(appBinaryPath, testBinaryPath);
|
37
|
-
} else {
|
38
|
-
await this.__installAppBinaries(appBinaryPath, testBinaryPath);
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
async __installAppBinaries(appBinaryPath, testBinaryPath) {
|
43
33
|
await this.appInstallHelper.install(this.adbName, appBinaryPath, testBinaryPath);
|
44
34
|
}
|
45
35
|
}
|
@@ -56,7 +56,6 @@ class Genycloud extends RuntimeDriverFactoryAndroid {
|
|
56
56
|
_createDriver(deviceCookie, deps, configs) {
|
57
57
|
const props = {
|
58
58
|
instance: deviceCookie.instance,
|
59
|
-
forceAdbInstall: configs.deviceConfig.forceAdbInstall,
|
60
59
|
};
|
61
60
|
|
62
61
|
const { GenycloudRuntimeDriver } = require('../drivers');
|
package/src/ios/expectTwo.js
CHANGED
@@ -7,6 +7,7 @@ const _ = require('lodash');
|
|
7
7
|
const tempfile = require('tempfile');
|
8
8
|
|
9
9
|
const { assertEnum, assertNormalized } = require('../utils/assertArgument');
|
10
|
+
const { removeMilliseconds } = require('../utils/dateUtils');
|
10
11
|
const { actionDescription, expectDescription } = require('../utils/invocationTraceDescriptions');
|
11
12
|
const log = require('../utils/logger').child({ cat: 'ws-client, ws' });
|
12
13
|
const traceInvocationCall = require('../utils/traceInvocationCall').bind(null, log);
|
@@ -275,6 +276,9 @@ class Element {
|
|
275
276
|
setDatePickerDate(dateString, dateFormat) {
|
276
277
|
if (typeof dateString !== 'string') throw new Error('dateString should be a string, but got ' + (dateString + (' (' + (typeof dateString + ')'))));
|
277
278
|
if (typeof dateFormat !== 'string') throw new Error('dateFormat should be a string, but got ' + (dateFormat + (' (' + (typeof dateFormat + ')'))));
|
279
|
+
if (dateFormat === 'ISO8601') {
|
280
|
+
dateString = removeMilliseconds(dateString);
|
281
|
+
}
|
278
282
|
|
279
283
|
const traceDescription = actionDescription.setDatePickerDate(dateString, dateFormat);
|
280
284
|
return this.withAction('setDatePickerDate', traceDescription, dateString, dateFormat);
|
package/src/utils/dateUtils.js
CHANGED
@@ -10,6 +10,11 @@ function shortFormat(date) {
|
|
10
10
|
return `${HH}:${MM}:${ss}.${milli}`;
|
11
11
|
}
|
12
12
|
|
13
|
+
function removeMilliseconds(isoDate) {
|
14
|
+
return isoDate.replace(/(T\d\d:\d\d:\d\d)(\.\d\d\d)/, '$1');
|
15
|
+
}
|
16
|
+
|
13
17
|
module.exports = {
|
14
18
|
shortFormat,
|
19
|
+
removeMilliseconds,
|
15
20
|
};
|
package/src/utils/logger.js
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
5ea178d37800ac85657519326c612490
|
@@ -1 +0,0 @@
|
|
1
|
-
514390d5c32fd969557547ee5d671a353c127b7e
|
@@ -1 +0,0 @@
|
|
1
|
-
963693e1366f136d7b1d560831c04140d4eb45d3ce66e6250fa94564ee0e6898
|
@@ -1 +0,0 @@
|
|
1
|
-
443148418bb248bcfc7b4f7dbc598c49e76238ca3d1a594c3d6faa1582d51152a3fcda51150f5748b58b8f7b1eebe30c44e6373b4bd34ed2bd92bb313f36df76
|
@@ -1 +0,0 @@
|
|
1
|
-
f1f70446a009ef210c4f845bf91536f6
|
@@ -1 +0,0 @@
|
|
1
|
-
35501e58eef68c0dc26c62419332872f5b8560e5
|
@@ -1 +0,0 @@
|
|
1
|
-
a6763332834870304f092606c17fc9a3e6e9c48e7b249b0eddb2dad559193a96
|
@@ -1 +0,0 @@
|
|
1
|
-
366d1835c72e688bb0c3e11343813724c5fdec5123ebc54a82a28a49ceddae04a3091ccc3430c210f7743fc6cb7d661bc7f1bc9b2813257b6fa0e3c97ea2ef9d
|
@@ -1 +0,0 @@
|
|
1
|
-
c7eb63b23e9fec3154e5402cc0f65283
|
@@ -1 +0,0 @@
|
|
1
|
-
16bed62cec4774262c71a7daad13efcdac3c7942
|
@@ -1 +0,0 @@
|
|
1
|
-
c12164b0a26a6db45c65d984af4c2a880e2bf5d516ceb582361576eff713e378
|
@@ -1 +0,0 @@
|
|
1
|
-
d50db96253552903c6acf2328ff2baa9788aac5846622bc01c4c9e6026738991f6eea1ea2723afe21ffdec692a3caeadb39b6ac5cfb31bf40c7d184e058701bb
|
@@ -1 +0,0 @@
|
|
1
|
-
576fdc79c38e30ef9865ebd14804f7d1
|
@@ -1 +0,0 @@
|
|
1
|
-
14372ce8c7b2b1a2a0e6ce3eee61470ee23e3efb
|
@@ -1 +0,0 @@
|
|
1
|
-
867e0414f1e99ca2bac00e68677bce8e392a3affe74ca9ee64acae9653cd9316
|
@@ -1 +0,0 @@
|
|
1
|
-
63cd497446b3521940236c4d10074cffd5a29de519400615c7e55d6ba05671452c2c1d8b3bc4c59d71ca5800010df98294286deb1fff5c46b89ffd18af3d61d0
|