appium-safari-driver 3.5.19 → 3.5.21
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 +12 -0
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -6
- package/build/index.js.map +1 -1
- package/build/lib/commands/record-screen.js +7 -7
- package/build/lib/commands/record-screen.js.map +1 -1
- package/build/lib/driver.js +2 -2
- package/build/lib/driver.js.map +1 -1
- package/build/lib/safari.js +4 -4
- package/build/lib/safari.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.mjs +5 -0
- package/index.js +1 -1
- package/lib/commands/record-screen.js +5 -5
- package/lib/driver.js +1 -1
- package/lib/safari.js +4 -4
- package/npm-shrinkwrap.json +240 -124
- package/package.json +3 -4
- package/test/functional/mobile-driver-e2e-specs.js +1 -1
- package/test/unit/driver-specs.js +1 -1
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -22
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { util, fs, net, tempDir } from 'appium/support';
|
|
3
3
|
import { waitForCondition } from 'asyncbox';
|
|
4
|
-
import Simctl from 'node-simctl';
|
|
4
|
+
import { Simctl } from 'node-simctl';
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
const commands = {};
|
|
@@ -43,7 +43,7 @@ process.on('exit', () => {
|
|
|
43
43
|
for (const videoFile of VIDEO_FILES) {
|
|
44
44
|
try {
|
|
45
45
|
fs.rimrafSync(videoFile);
|
|
46
|
-
} catch
|
|
46
|
+
} catch {}
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
|
|
@@ -89,7 +89,7 @@ class ScreenRecorder {
|
|
|
89
89
|
this.log.debug('Force-stopping the currently running video recording');
|
|
90
90
|
try {
|
|
91
91
|
await /** @type {import('teen_process').SubProcess} */ (this._process).stop('SIGKILL');
|
|
92
|
-
} catch
|
|
92
|
+
} catch {}
|
|
93
93
|
}
|
|
94
94
|
this._process = null;
|
|
95
95
|
const videoPath = await this.getVideoPath();
|
|
@@ -145,7 +145,7 @@ class ScreenRecorder {
|
|
|
145
145
|
waitMs: STARTUP_TIMEOUT_MS,
|
|
146
146
|
intervalMs: STARTUP_INTERVAL_MS,
|
|
147
147
|
});
|
|
148
|
-
} catch
|
|
148
|
+
} catch {
|
|
149
149
|
await this._enforceTermination();
|
|
150
150
|
throw this.log.errorWithException(
|
|
151
151
|
`The expected screen record file '${this._videoPath}' does not exist after ${STARTUP_TIMEOUT_MS}ms. ` +
|
|
@@ -181,7 +181,7 @@ class ScreenRecorder {
|
|
|
181
181
|
|
|
182
182
|
try {
|
|
183
183
|
await /** @type {import('teen_process').SubProcess} */ (this._process).stop('SIGINT', PROCESS_SHUTDOWN_TIMEOUT_MS);
|
|
184
|
-
} catch
|
|
184
|
+
} catch {
|
|
185
185
|
await this._enforceTermination();
|
|
186
186
|
throw new Error(`Screen recording has failed to stop after ${PROCESS_SHUTDOWN_TIMEOUT_MS}ms`);
|
|
187
187
|
}
|
package/lib/driver.js
CHANGED
|
@@ -2,7 +2,7 @@ import _ from 'lodash';
|
|
|
2
2
|
import { BaseDriver } from 'appium/driver';
|
|
3
3
|
import SafariDriverServer from './safari';
|
|
4
4
|
import { desiredCapConstraints } from './desired-caps';
|
|
5
|
-
import commands from './commands/index';
|
|
5
|
+
import { commands } from './commands/index';
|
|
6
6
|
import { formatCapsForServer } from './utils';
|
|
7
7
|
import { newMethodMap } from './method-map';
|
|
8
8
|
|
package/lib/safari.js
CHANGED
|
@@ -52,7 +52,7 @@ class SafariDriverProcess {
|
|
|
52
52
|
const [startPort, endPort] = SAFARI_PORT_RANGE;
|
|
53
53
|
try {
|
|
54
54
|
this.port = await findAPortNotInUse(startPort, endPort);
|
|
55
|
-
} catch
|
|
55
|
+
} catch {
|
|
56
56
|
throw new Error(
|
|
57
57
|
`Cannot find any free port in range ${startPort}..${endPort}. ` +
|
|
58
58
|
`Double check the processes that are locking ports within this range and terminate ` +
|
|
@@ -62,7 +62,7 @@ class SafariDriverProcess {
|
|
|
62
62
|
let safariBin;
|
|
63
63
|
try {
|
|
64
64
|
safariBin = await fs.which(SD_BINARY);
|
|
65
|
-
} catch
|
|
65
|
+
} catch {
|
|
66
66
|
throw new Error(`${SD_BINARY} binary cannot be found in PATH. ` +
|
|
67
67
|
`Please make sure it is present on your system`);
|
|
68
68
|
}
|
|
@@ -83,7 +83,7 @@ class SafariDriverProcess {
|
|
|
83
83
|
if (this.isRunning) {
|
|
84
84
|
try {
|
|
85
85
|
await this.proc?.stop('SIGKILL');
|
|
86
|
-
} catch
|
|
86
|
+
} catch {}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -94,7 +94,7 @@ process.once('exit', () => {
|
|
|
94
94
|
if (SAFARI_DRIVER_PROCESS.isRunning) {
|
|
95
95
|
try {
|
|
96
96
|
execSync(`kill ${SAFARI_DRIVER_PROCESS.proc?.pid}`);
|
|
97
|
-
} catch
|
|
97
|
+
} catch {}
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
|