appium-mac2-driver 4.3.5 → 4.4.0
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/WebDriverAgentMac/IntegrationTests/AMSessionTests.m +14 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/FBSessionCommands.m +17 -5
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBSession.m +5 -1
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/FBXPath.m +48 -2
- package/WebDriverAgentMac/WebDriverAgentMac.xcodeproj/project.pbxproj +4 -0
- package/build/lib/driver.d.ts +3 -0
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +52 -32
- package/build/lib/driver.js.map +1 -1
- package/build/lib/session-claim-handler.d.ts +41 -0
- package/build/lib/session-claim-handler.d.ts.map +1 -0
- package/build/lib/session-claim-handler.js +236 -0
- package/build/lib/session-claim-handler.js.map +1 -0
- package/build/lib/wda-mac.d.ts +6 -2
- package/build/lib/wda-mac.d.ts.map +1 -1
- package/build/lib/wda-mac.js +43 -14
- package/build/lib/wda-mac.js.map +1 -1
- package/lib/driver.ts +55 -31
- package/lib/session-claim-handler.ts +306 -0
- package/lib/wda-mac.ts +45 -15
- package/node_modules/@appium/logger/CHANGELOG.md +8 -0
- package/node_modules/@appium/logger/package.json +3 -3
- package/node_modules/@appium/strongbox/build/lib/index.d.ts.map +1 -1
- package/node_modules/@appium/strongbox/build/lib/index.js +6 -1
- package/node_modules/@appium/strongbox/build/lib/index.js.map +1 -1
- package/node_modules/@appium/strongbox/lib/index.ts +6 -1
- package/node_modules/@appium/strongbox/package.json +2 -2
- package/node_modules/@appium/support/build/lib/fs.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/fs.js +7 -0
- package/node_modules/@appium/support/build/lib/fs.js.map +1 -1
- package/node_modules/@appium/support/build/lib/index.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/net.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/net.js +6 -2
- package/node_modules/@appium/support/build/lib/net.js.map +1 -1
- package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/util.js +10 -4
- package/node_modules/@appium/support/build/lib/util.js.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.js +2 -7
- package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
- package/node_modules/@appium/support/lib/fs.ts +8 -1
- package/node_modules/@appium/support/lib/net.ts +7 -2
- package/node_modules/@appium/support/lib/util.ts +9 -3
- package/node_modules/@appium/support/lib/zip.ts +3 -9
- package/node_modules/@appium/support/package.json +9 -9
- package/node_modules/@appium/types/package.json +4 -4
- package/node_modules/@img/sharp-darwin-arm64/index.cjs +1 -1
- package/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.5.node +0 -0
- package/node_modules/@img/sharp-darwin-arm64/package.json +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/README.md +1 -1
- package/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/lib/{libvips-cpp.8.18.6.dylib → libvips-cpp.8.18.7.dylib} +0 -0
- package/node_modules/@img/sharp-libvips-darwin-arm64/package.json +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +11 -11
- package/node_modules/appium-xcode/CHANGELOG.md +35 -0
- package/node_modules/appium-xcode/README.md +1 -1
- package/node_modules/appium-xcode/package.json +14 -18
- package/node_modules/async-lock/AUTHORS +21 -0
- package/node_modules/async-lock/History.md +132 -0
- package/node_modules/async-lock/LICENSE +22 -0
- package/node_modules/async-lock/README.md +177 -0
- package/node_modules/async-lock/index.js +2 -0
- package/node_modules/async-lock/lib/index.js +312 -0
- package/node_modules/async-lock/package.json +48 -0
- package/node_modules/b4a/browser.js +5 -0
- package/node_modules/b4a/index.d.ts +144 -0
- package/node_modules/b4a/index.js +5 -0
- package/node_modules/b4a/package.json +4 -1
- package/node_modules/b4a/runtime.d.ts +14 -0
- package/node_modules/bare-fs/binding.c +52 -23
- package/node_modules/bare-fs/index.d.ts +12 -10
- package/node_modules/bare-fs/index.js +43 -10
- package/node_modules/bare-fs/package.json +2 -1
- package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
- package/node_modules/bplist-creator/README.md +26 -6
- package/node_modules/bplist-creator/dist/index.cjs +508 -0
- package/node_modules/bplist-creator/dist/index.cjs.map +7 -0
- package/node_modules/bplist-creator/dist/index.d.cts +12 -0
- package/node_modules/bplist-creator/dist/index.d.ts +12 -0
- package/node_modules/bplist-creator/dist/index.mjs +472 -0
- package/node_modules/bplist-creator/dist/index.mjs.map +7 -0
- package/node_modules/bplist-creator/package.json +43 -9
- package/node_modules/bplist-parser/README.md +37 -3
- package/node_modules/bplist-parser/dist/index.cjs +385 -0
- package/node_modules/bplist-parser/dist/index.cjs.map +7 -0
- package/node_modules/bplist-parser/dist/index.d.cts +13 -0
- package/node_modules/bplist-parser/dist/index.d.ts +13 -0
- package/node_modules/bplist-parser/{bplistParser.js → dist/index.mjs} +141 -171
- package/node_modules/bplist-parser/dist/index.mjs.map +7 -0
- package/node_modules/bplist-parser/package.json +39 -12
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts +4 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js +69 -25
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.d.ts +4 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +68 -24
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +2 -1
- package/node_modules/follow-redirects/index.js +10 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.js.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.d.ts +5 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.js +7 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts +1400 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.js +1733 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.js.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts +12 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.js +10 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.d.ts +5 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.js +4 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.d.ts +1400 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.js +1729 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.d.ts +12 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.js +7 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.js.map +1 -0
- package/node_modules/lru-cache/package.json +27 -1
- package/node_modules/p-limit/index.d.ts +2 -0
- package/node_modules/p-limit/index.js +17 -1
- package/node_modules/p-limit/package.json +1 -1
- package/node_modules/p-limit/readme.md +2 -0
- package/node_modules/readable-stream/lib/internal/shims/process.js +19 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/duplexify.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/from.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/legacy.js +6 -1
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/readable.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/writable.js +1 -1
- package/node_modules/readable-stream/package.json +3 -2
- package/node_modules/sharp/dist/index.d.cts +2 -2
- package/node_modules/sharp/dist/index.d.mts +3 -3
- package/node_modules/sharp/dist/is.cjs +8 -2
- package/node_modules/sharp/dist/is.mjs +8 -2
- package/node_modules/sharp/dist/operation.cjs +2 -2
- package/node_modules/sharp/dist/operation.mjs +2 -2
- package/node_modules/sharp/dist/output.cjs +1 -0
- package/node_modules/sharp/dist/output.mjs +1 -0
- package/node_modules/sharp/dist/resize.cjs +14 -14
- package/node_modules/sharp/dist/resize.mjs +14 -14
- package/node_modules/sharp/dist/sharp.cjs +3 -3
- package/node_modules/sharp/dist/sharp.mjs +3 -3
- package/node_modules/sharp/lib/index.d.ts +2 -2
- package/node_modules/sharp/package.json +35 -35
- package/node_modules/sharp/src/binding.gyp +1 -1
- package/node_modules/sharp/src/common.cc +4 -4
- package/node_modules/sharp/src/common.h +2 -2
- package/node_modules/sharp/src/pipeline.cc +31 -6
- package/node_modules/sharp/src/utilities.cc +1 -1
- package/node_modules/spdx-license-ids/index.json +13 -0
- package/node_modules/spdx-license-ids/package.json +1 -1
- package/node_modules/stream-buffers/.codeclimate.yml +12 -0
- package/node_modules/stream-buffers/.eslintignore +1 -0
- package/node_modules/stream-buffers/.eslintrc +25 -0
- package/node_modules/stream-buffers/.github/workflows/codeql-analysis.yml +71 -0
- package/node_modules/stream-buffers/.github/workflows/node.js.yml +31 -0
- package/node_modules/stream-buffers/.mailmap +1 -0
- package/node_modules/stream-buffers/.nvmrc +1 -0
- package/node_modules/stream-buffers/README.md +65 -65
- package/node_modules/stream-buffers/lib/constants.js +8 -6
- package/node_modules/stream-buffers/lib/readable_streambuffer.js +114 -136
- package/node_modules/stream-buffers/lib/streambuffer.js +5 -3
- package/node_modules/stream-buffers/lib/writable_streambuffer.js +72 -97
- package/node_modules/stream-buffers/package.json +7 -5
- package/node_modules/tar-stream/package.json +7 -7
- package/node_modules/type-fest/index.d.ts +7 -7
- package/node_modules/type-fest/package.json +2 -1
- package/node_modules/type-fest/readme.md +7 -16
- package/node_modules/type-fest/source/all-extend.d.ts +9 -7
- package/node_modules/type-fest/source/array-reverse.d.ts +13 -12
- package/node_modules/type-fest/source/array-tail.d.ts +3 -3
- package/node_modules/type-fest/source/delimiter-case.d.ts +1 -1
- package/node_modules/type-fest/source/get.d.ts +1 -1
- package/node_modules/type-fest/source/int-closed-range.d.ts +4 -1
- package/node_modules/type-fest/source/int-range.d.ts +56 -9
- package/node_modules/type-fest/source/internal/array.d.ts +14 -13
- package/node_modules/type-fest/source/internal/numeric.d.ts +0 -38
- package/node_modules/type-fest/source/internal/object.d.ts +30 -1
- package/node_modules/type-fest/source/is-boolean-literal.d.ts +39 -0
- package/node_modules/type-fest/source/is-literal.d.ts +43 -269
- package/node_modules/type-fest/source/is-numeric-literal.d.ts +50 -0
- package/node_modules/type-fest/source/is-string-literal.d.ts +72 -0
- package/node_modules/type-fest/source/is-symbol-literal.d.ts +39 -0
- package/node_modules/type-fest/source/is-tuple.d.ts +3 -3
- package/node_modules/type-fest/source/jsonify.d.ts +1 -5
- package/node_modules/type-fest/source/merge-deep.d.ts +3 -3
- package/node_modules/type-fest/source/remove-prefix.d.ts +1 -1
- package/node_modules/type-fest/source/remove-suffix.d.ts +1 -1
- package/node_modules/type-fest/source/rename-keys.d.ts +163 -0
- package/node_modules/type-fest/source/set-required.d.ts +10 -9
- package/node_modules/type-fest/source/shared-union-fields-deep.d.ts +6 -4
- package/node_modules/type-fest/source/some-extend.d.ts +9 -7
- package/node_modules/type-fest/source/split-on-rest-element.d.ts +14 -13
- package/node_modules/type-fest/source/split.d.ts +22 -11
- package/node_modules/type-fest/source/string-repeat.d.ts +1 -1
- package/node_modules/type-fest/source/string-to-array.d.ts +1 -1
- package/node_modules/type-fest/source/tsconfig-json.d.ts +1 -1
- package/node_modules/type-fest/source/typed-array.d.ts +6 -0
- package/node_modules/type-fest/source/union-max.d.ts +56 -0
- package/node_modules/type-fest/source/writable.d.ts +2 -2
- package/package.json +5 -3
- package/node_modules/@appium/support/node_modules/asyncbox/LICENSE +0 -203
- package/node_modules/@appium/support/node_modules/asyncbox/README.md +0 -215
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -301
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts +0 -84
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/package.json +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -288
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts +0 -84
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js +0 -2
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/package.json +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/lib/asyncbox.ts +0 -365
- package/node_modules/@appium/support/node_modules/asyncbox/lib/types.ts +0 -88
- package/node_modules/@appium/support/node_modules/asyncbox/package.json +0 -74
- package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +0 -1872
- package/node_modules/@appium/support/node_modules/axios/LICENSE +0 -7
- package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +0 -877
- package/node_modules/@appium/support/node_modules/axios/README.md +0 -2623
- package/node_modules/@appium/support/node_modules/axios/dist/axios.js +0 -5509
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +0 -5
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +0 -1
- package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +0 -5469
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +0 -5490
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +0 -1
- package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +0 -6356
- package/node_modules/@appium/support/node_modules/axios/index.d.cts +0 -762
- package/node_modules/@appium/support/node_modules/axios/index.d.ts +0 -783
- package/node_modules/@appium/support/node_modules/axios/index.js +0 -45
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +0 -36
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +0 -132
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +0 -643
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +0 -1406
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +0 -228
- package/node_modules/@appium/support/node_modules/axios/lib/axios.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +0 -135
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +0 -22
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +0 -5
- package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +0 -301
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +0 -219
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +0 -474
- package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +0 -72
- package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +0 -8
- package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +0 -88
- package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +0 -174
- package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +0 -27
- package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +0 -27
- package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +0 -28
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +0 -177
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +0 -10
- package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +0 -2
- package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +0 -1
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -156
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -59
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +0 -119
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -78
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +0 -7
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -29
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +0 -14
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +0 -69
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +0 -18
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +0 -23
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +0 -68
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +0 -64
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -31
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +0 -166
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +0 -125
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +0 -119
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +0 -68
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -19
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +0 -2
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +0 -71
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +0 -54
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +0 -15
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +0 -105
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +0 -60
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +0 -329
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +0 -55
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +0 -28
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +0 -44
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +0 -286
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +0 -112
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -4
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +0 -13
- package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +0 -52
- package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +0 -7
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +0 -11
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -4
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +0 -37
- package/node_modules/@appium/support/node_modules/axios/lib/utils.js +0 -1029
- package/node_modules/@appium/support/node_modules/axios/package.json +0 -203
- package/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.4.node +0 -0
- package/node_modules/big-integer/BigInteger.d.ts +0 -2393
- package/node_modules/big-integer/BigInteger.js +0 -1453
- package/node_modules/big-integer/BigInteger.min.js +0 -1
- package/node_modules/big-integer/LICENSE +0 -24
- package/node_modules/big-integer/README.md +0 -589
- package/node_modules/big-integer/bower.json +0 -29
- package/node_modules/big-integer/package.json +0 -48
- package/node_modules/big-integer/tsconfig.json +0 -24
- package/node_modules/bplist-creator/bplistCreator.d.ts +0 -8
- package/node_modules/bplist-creator/bplistCreator.js +0 -460
- package/node_modules/bplist-creator/test/airplay.bplist +0 -0
- package/node_modules/bplist-creator/test/binaryData.bplist +0 -0
- package/node_modules/bplist-creator/test/creatorTest.js +0 -211
- package/node_modules/bplist-creator/test/iTunes-small.bplist +0 -0
- package/node_modules/bplist-creator/test/integers.bplist +0 -0
- package/node_modules/bplist-creator/test/sample1.bplist +0 -0
- package/node_modules/bplist-creator/test/sample2.bplist +0 -0
- package/node_modules/bplist-creator/test/uid.bplist +0 -0
- package/node_modules/bplist-creator/test/utf16.bplist +0 -0
- package/node_modules/bplist-parser/.editorconfig +0 -12
- package/node_modules/bplist-parser/.eslintignore +0 -1
- package/node_modules/bplist-parser/.eslintrc.js +0 -296
- package/node_modules/bplist-parser/bplistParser.d.ts +0 -8
- package/node_modules/stream-buffers/.travis.yml +0 -28
- package/node_modules/stream-buffers/coverage/coverage.json +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/base.css +0 -182
- package/node_modules/stream-buffers/coverage/lcov-report/index.html +0 -73
- package/node_modules/stream-buffers/coverage/lcov-report/lib/constants.js.html +0 -63
- package/node_modules/stream-buffers/coverage/lcov-report/lib/index.html +0 -112
- package/node_modules/stream-buffers/coverage/lcov-report/lib/readable_streambuffer.js.html +0 -453
- package/node_modules/stream-buffers/coverage/lcov-report/lib/streambuffer.js.html +0 -54
- package/node_modules/stream-buffers/coverage/lcov-report/lib/writable_streambuffer.js.html +0 -336
- package/node_modules/stream-buffers/coverage/lcov-report/prettify.css +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/prettify.js +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/node_modules/stream-buffers/coverage/lcov-report/sorter.js +0 -156
- package/node_modules/stream-buffers/coverage/lcov.info +0 -305
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [4.4.0](https://github.com/appium/appium-mac2-driver/compare/v4.3.6...v4.4.0) (2026-10-11)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* enforce a single session, a new session replaces the previous one ([#426](https://github.com/appium/appium-mac2-driver/issues/426)) ([fb10372](https://github.com/appium/appium-mac2-driver/commit/fb10372c16d861fb7ff9463b345ba6fcb3f67387))
|
|
6
|
+
|
|
7
|
+
## [4.3.6](https://github.com/appium/appium-mac2-driver/compare/v4.3.5...v4.3.6) (2026-10-02)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Isolated process-exit state, page-source xml, Reused geometry during XML serialization ([#423](https://github.com/appium/appium-mac2-driver/issues/423)) ([b4dc1f8](https://github.com/appium/appium-mac2-driver/commit/b4dc1f8aa403e18b3b6c1807403144fd19552492))
|
|
12
|
+
|
|
1
13
|
## [4.3.5](https://github.com/appium/appium-mac2-driver/compare/v4.3.4...v4.3.5) (2026-09-10)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -43,6 +43,20 @@ static NSString *const SETTINGS_BUNDLE_ID = @"com.apple.systempreferences";
|
|
|
43
43
|
[super tearDown];
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
- (void)testNewSessionOverridesThePreviousOne
|
|
47
|
+
{
|
|
48
|
+
NSString *oldId = self.session.identifier;
|
|
49
|
+
FBSession *newSession = [FBSession initWithApplication:nil];
|
|
50
|
+
XCTAssertNotEqualObjects(oldId, newSession.identifier);
|
|
51
|
+
XCTAssertEqual(FBSession.activeSession, newSession);
|
|
52
|
+
XCTAssertNil([FBSession sessionWithIdentifier:oldId]);
|
|
53
|
+
// Killing the stale session must not drop the active one
|
|
54
|
+
[self.session kill];
|
|
55
|
+
XCTAssertEqual(FBSession.activeSession, newSession);
|
|
56
|
+
[newSession kill];
|
|
57
|
+
XCTAssertNil(FBSession.activeSession);
|
|
58
|
+
}
|
|
59
|
+
|
|
46
60
|
- (void)testSettingsAppCanBeOpenedInScopeOfTheCurrentSession
|
|
47
61
|
{
|
|
48
62
|
[self.session launchApplicationWithBundleId:SETTINGS_BUNDLE_ID
|
|
@@ -99,9 +99,15 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
|
|
|
99
99
|
NSString *appPath = requirements[AM_APP_PATH_CAPABILITY];
|
|
100
100
|
NSString *deepLink = requirements[AM_INITIAL_DEEPLINK_URL_CAPABILITY];
|
|
101
101
|
BOOL noReset = [requirements[AM_NO_RESET_CAPABILITY] boolValue];
|
|
102
|
-
|
|
102
|
+
|
|
103
|
+
// XCTest is single-threaded, so there can only be one session. A new one always
|
|
104
|
+
// takes over, and the previous one must be gone before any app gets touched.
|
|
105
|
+
[FBSession.activeSession kill];
|
|
106
|
+
|
|
107
|
+
XCUIApplication *app = nil;
|
|
108
|
+
BOOL didLaunchApp = NO;
|
|
103
109
|
if (nil == bundleID && nil == appPath && nil == deepLink) {
|
|
104
|
-
|
|
110
|
+
// no app to manage
|
|
105
111
|
} else if (nil != deepLink) {
|
|
106
112
|
NSURL *url = [NSURL URLWithString:deepLink];
|
|
107
113
|
NSError *error;
|
|
@@ -113,13 +119,12 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
|
|
|
113
119
|
traceback:nil]);
|
|
114
120
|
}
|
|
115
121
|
if (nil != bundleID) {
|
|
116
|
-
|
|
122
|
+
app = [[XCUIApplication alloc] initWithBundleIdentifier:bundleID];
|
|
117
123
|
}
|
|
118
124
|
} else {
|
|
119
|
-
|
|
125
|
+
app = nil != appPath
|
|
120
126
|
? [[XCUIApplication alloc] initWithURL:[NSURL fileURLWithPath:appPath]]
|
|
121
127
|
: [[XCUIApplication alloc] initWithBundleIdentifier:bundleID];
|
|
122
|
-
session = [FBSession initWithApplication:app];
|
|
123
128
|
if (noReset && app.state > XCUIApplicationStateNotRunning) {
|
|
124
129
|
[app activate];
|
|
125
130
|
} else {
|
|
@@ -140,6 +145,7 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
|
|
|
140
145
|
}
|
|
141
146
|
app.launchEnvironment = [launchEnv copy];
|
|
142
147
|
[app launch];
|
|
148
|
+
didLaunchApp = YES;
|
|
143
149
|
if (app.state <= XCUIApplicationStateNotRunning) {
|
|
144
150
|
NSString *message = [NSString stringWithFormat:@"Failed to launch '%@' application", appPath ?: bundleID];
|
|
145
151
|
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:message
|
|
@@ -149,6 +155,10 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
|
|
|
149
155
|
if (nil != bundleID && nil != appPath) {
|
|
150
156
|
NSString *realBundleID = app.am_bundleID;
|
|
151
157
|
if (![realBundleID isEqualToString:bundleID]) {
|
|
158
|
+
// no session owns the app, so don't leave it behind
|
|
159
|
+
if (didLaunchApp) {
|
|
160
|
+
[app terminate];
|
|
161
|
+
}
|
|
152
162
|
NSString *message = [NSString stringWithFormat:@"The bundle identifier %@ of the '%@' does not match to the one provided in capabilities: %@",
|
|
153
163
|
realBundleID, appPath, bundleID];
|
|
154
164
|
return FBResponseWithStatus([FBCommandStatus sessionNotCreatedError:message
|
|
@@ -156,6 +166,8 @@ const static NSString *CAPABILITIES_KEY = @"capabilities";
|
|
|
156
166
|
}
|
|
157
167
|
}
|
|
158
168
|
}
|
|
169
|
+
// The session is only registered once startup has fully succeeded
|
|
170
|
+
FBSession *session = [FBSession initWithApplication:app];
|
|
159
171
|
if (nil != requirements[AM_SKIP_APP_KILL_CAPABILITY]) {
|
|
160
172
|
session.skipAppTermination = [requirements[AM_SKIP_APP_KILL_CAPABILITY] boolValue];
|
|
161
173
|
} else if (nil == bundleID) {
|
|
@@ -72,6 +72,11 @@ static FBSession *_activeSession = nil;
|
|
|
72
72
|
[self.testedApplication terminate];
|
|
73
73
|
}
|
|
74
74
|
self.testedApplication = nil;
|
|
75
|
+
[self.elementCache reset];
|
|
76
|
+
// The recording belongs to the active session, so a stale one must not touch it
|
|
77
|
+
if (_activeSession != self) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
75
80
|
FBScreenRecordingContainer *screenRecordingContainer = FBScreenRecordingContainer.sharedInstance;
|
|
76
81
|
NSUUID *videoRecordingId = screenRecordingContainer.screenRecordingPromise.identifier;
|
|
77
82
|
if (nil != videoRecordingId) {
|
|
@@ -83,7 +88,6 @@ static FBSession *_activeSession = nil;
|
|
|
83
88
|
if (nil != screenRecordingContainer.screenRecordingPromise) {
|
|
84
89
|
[screenRecordingContainer reset];
|
|
85
90
|
}
|
|
86
|
-
[self.elementCache reset];
|
|
87
91
|
_activeSession = nil;
|
|
88
92
|
}
|
|
89
93
|
|
|
@@ -139,7 +139,46 @@ static NSString *const kXMLIndexPathKey = @"private_indexPath";
|
|
|
139
139
|
return nil;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
return [
|
|
142
|
+
return [self xmlStringWithSnapshot:snapshot];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Serialize one native XML node at a time without retaining a document tree.
|
|
146
|
+
+ (nullable NSString *)xmlStringWithSnapshot:(id<XCUIElementSnapshot>)snapshot
|
|
147
|
+
{
|
|
148
|
+
NSMutableString *result = [NSMutableString stringWithString:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"];
|
|
149
|
+
[self appendXmlWithSnapshot:snapshot toString:result indentation:@""];
|
|
150
|
+
return result.copy;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
+ (void)appendXmlWithSnapshot:(id<XCUIElementSnapshot>)snapshot
|
|
154
|
+
toString:(NSMutableString *)result
|
|
155
|
+
indentation:(NSString *)indentation
|
|
156
|
+
{
|
|
157
|
+
NSString *type = [FBElementTypeTransformer stringWithElementType:snapshot.elementType];
|
|
158
|
+
NSArray<id<XCUIElementSnapshot>> *children = snapshot.children;
|
|
159
|
+
@autoreleasepool {
|
|
160
|
+
NSXMLElement *node = [NSXMLElement elementWithName:type];
|
|
161
|
+
[self recordElementAttributes:node forSnapshot:snapshot indexPath:nil];
|
|
162
|
+
// Native serialization handles escaping and keeps Foundation's existing
|
|
163
|
+
// attribute whitespace behavior. Compact empty nodes always end in "/>".
|
|
164
|
+
NSString *xml = [node XMLStringWithOptions:NSXMLNodeCompactEmptyElement];
|
|
165
|
+
[result appendString:indentation];
|
|
166
|
+
if (children.count == 0) {
|
|
167
|
+
[result appendString:xml];
|
|
168
|
+
} else {
|
|
169
|
+
[result appendString:[xml substringToIndex:xml.length - 2]];
|
|
170
|
+
[result appendString:@">"];
|
|
171
|
+
}
|
|
172
|
+
[result appendString:@"\n"];
|
|
173
|
+
}
|
|
174
|
+
if (children.count == 0) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
NSString *childIndentation = [indentation stringByAppendingString:@" "];
|
|
178
|
+
for (id<XCUIElementSnapshot> child in children) {
|
|
179
|
+
[self appendXmlWithSnapshot:child toString:result indentation:childIndentation];
|
|
180
|
+
}
|
|
181
|
+
[result appendFormat:@"%@</%@>\n", indentation, type];
|
|
143
182
|
}
|
|
144
183
|
|
|
145
184
|
+ (NSArray<XCUIElement *> *)matchesWithRootElement:(XCUIElement *)root
|
|
@@ -219,8 +258,15 @@ static NSString *const kXMLIndexPathKey = @"private_indexPath";
|
|
|
219
258
|
forSnapshot:(id<XCUIElementSnapshot>)snapshot
|
|
220
259
|
indexPath:(nullable NSString *)indexPath
|
|
221
260
|
{
|
|
261
|
+
NSDictionary *rect = nil;
|
|
222
262
|
for (Class attributeCls in FBElementAttribute.supportedAttributes) {
|
|
223
|
-
[attributeCls
|
|
263
|
+
if ([attributeCls isSubclassOfClass:FBDimensionAttribute.class]) {
|
|
264
|
+
rect = rect ?: AMCGRectToDict(snapshot.frame);
|
|
265
|
+
[node addAttribute:[NSXMLNode attributeWithName:[attributeCls name]
|
|
266
|
+
stringValue:[rect[[attributeCls name]] description]]];
|
|
267
|
+
} else {
|
|
268
|
+
[attributeCls recordWithNode:node forElement:snapshot];
|
|
269
|
+
}
|
|
224
270
|
}
|
|
225
271
|
|
|
226
272
|
if (nil != indexPath) {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
+
B182601DDE174B5AB2AD7701 /* AMXPathTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B182601DDE174B5AB2AD7702 /* AMXPathTests.m */; };
|
|
10
11
|
06865ADF2DB5D6F7819CE2A8 /* AMTCPSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 702867B5FC5F035D1CC8E596 /* AMTCPSocket.h */; };
|
|
11
12
|
1E964A1C6D82FF8B9E17C024 /* AMHTTPServerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AFF6D8DC9CE6831D94DFA00 /* AMHTTPServerTests.m */; };
|
|
12
13
|
2A45B1885FA76B1DE65D4E09 /* AMHTTPServer.h in Headers */ = {isa = PBXBuildFile; fileRef = B1768D9362DADEAF91410A76 /* AMHTTPServer.h */; };
|
|
@@ -255,6 +256,7 @@
|
|
|
255
256
|
/* End PBXCopyFilesBuildPhase section */
|
|
256
257
|
|
|
257
258
|
/* Begin PBXFileReference section */
|
|
259
|
+
B182601DDE174B5AB2AD7702 /* AMXPathTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AMXPathTests.m; sourceTree = "<group>"; };
|
|
258
260
|
56444252148A6377AB34CC3B /* RouteRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = RouteRequest.m; sourceTree = "<group>"; };
|
|
259
261
|
56885A73AAD5DB0A05C9882D /* AMTCPSocket.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = AMTCPSocket.m; sourceTree = "<group>"; };
|
|
260
262
|
6AFF6D8DC9CE6831D94DFA00 /* AMHTTPServerTests.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = AMHTTPServerTests.m; sourceTree = "<group>"; };
|
|
@@ -834,6 +836,7 @@
|
|
|
834
836
|
isa = PBXGroup;
|
|
835
837
|
children = (
|
|
836
838
|
6AFF6D8DC9CE6831D94DFA00 /* AMHTTPServerTests.m */,
|
|
839
|
+
B182601DDE174B5AB2AD7702 /* AMXPathTests.m */,
|
|
837
840
|
A14FCEABDDD9E126A7774B1F /* Info.plist */,
|
|
838
841
|
);
|
|
839
842
|
name = UnitTests;
|
|
@@ -1123,6 +1126,7 @@
|
|
|
1123
1126
|
buildActionMask = 2147483647;
|
|
1124
1127
|
files = (
|
|
1125
1128
|
1E964A1C6D82FF8B9E17C024 /* AMHTTPServerTests.m in Sources */,
|
|
1129
|
+
B182601DDE174B5AB2AD7701 /* AMXPathTests.m in Sources */,
|
|
1126
1130
|
);
|
|
1127
1131
|
runOnlyForDeploymentPostprocessing = 0;
|
|
1128
1132
|
};
|
package/build/lib/driver.d.ts
CHANGED
|
@@ -268,6 +268,8 @@ export declare class Mac2Driver extends BaseDriver<Mac2Constraints, StringRecord
|
|
|
268
268
|
proxyReqRes: (...args: any) => any;
|
|
269
269
|
private isProxyActive;
|
|
270
270
|
private _wda;
|
|
271
|
+
private _wdaSessionId;
|
|
272
|
+
private _hasClaimedHost;
|
|
271
273
|
constructor(opts?: InitialOpts);
|
|
272
274
|
get wda(): WDAMacServer;
|
|
273
275
|
onSettingsUpdate(key: string, value: unknown): Promise<void>;
|
|
@@ -279,6 +281,7 @@ export declare class Mac2Driver extends BaseDriver<Mac2Constraints, StringRecord
|
|
|
279
281
|
getWindowRect(): Promise<any>;
|
|
280
282
|
createSession(w3cCaps1: W3CMac2DriverCaps, w3cCaps2?: W3CMac2DriverCaps, w3cCaps3?: W3CMac2DriverCaps, driverData?: DriverData[]): Promise<DefaultCreateSessionResult<Mac2Constraints>>;
|
|
281
283
|
deleteSession(): Promise<void>;
|
|
284
|
+
private teardownSession;
|
|
282
285
|
private resetState;
|
|
283
286
|
}
|
|
284
287
|
export default Mac2Driver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,0BAA0B,EAC1B,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EAGd,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,0BAA0B,EAC1B,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EAGd,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AAEpE,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;AACvE,OAAO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,GAAG,YAAY,EAAE;IAIpD,QAAQ,IAAI,OAAO;IAItB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,QAAe,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzE,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC;IAQlC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC;IAIpB,aAAa,CAC1B,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,UAAU,CAAC,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,0BAA0B,CAAC,eAAe,CAAC,CAAC;IAyCxC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;YAM/B,eAAe;IAqC7B,OAAO,CAAC,UAAU;CAWnB;AAED,eAAe,UAAU,CAAC"}
|
package/build/lib/driver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseDriver, DeviceSettings } from 'appium/driver.js';
|
|
1
|
+
import { BaseDriver, DeviceSettings, errors } from 'appium/driver.js';
|
|
2
2
|
import * as appManagemenetCommands from './commands/app-management.js';
|
|
3
3
|
import * as appleScriptCommands from './commands/applescript.js';
|
|
4
4
|
import * as auditCommands from './commands/audit.js';
|
|
@@ -15,6 +15,7 @@ import MAC2_CONSTRAINTS from './constraints.js';
|
|
|
15
15
|
import { executeMethodMap } from './execute-method-map.js';
|
|
16
16
|
import log from './logger.js';
|
|
17
17
|
import { newMethodMap } from './method-map.js';
|
|
18
|
+
import { sessionClaimHandler } from './session-claim-handler.js';
|
|
18
19
|
import { WDA_MAC_SERVER } from './wda-mac.js';
|
|
19
20
|
const NO_PROXY = [
|
|
20
21
|
['GET', new RegExp('^/session/[^/]+/appium')],
|
|
@@ -70,6 +71,8 @@ export class Mac2Driver extends BaseDriver {
|
|
|
70
71
|
proxyReqRes;
|
|
71
72
|
isProxyActive = false;
|
|
72
73
|
_wda = null;
|
|
74
|
+
_wdaSessionId = null;
|
|
75
|
+
_hasClaimedHost = false;
|
|
73
76
|
constructor(opts = {}) {
|
|
74
77
|
super(opts);
|
|
75
78
|
this.desiredCapConstraints = structuredClone(MAC2_CONSTRAINTS);
|
|
@@ -91,13 +94,18 @@ export class Mac2Driver extends BaseDriver {
|
|
|
91
94
|
if (!this._wda) {
|
|
92
95
|
throw new Error('WDA server is not initialized');
|
|
93
96
|
}
|
|
97
|
+
// The WDA server is shared and only supports a single session, so a newer
|
|
98
|
+
// session replaces this one. Never send commands on its behalf after that.
|
|
99
|
+
if (this._wdaSessionId && !this._wda.isSessionActive(this._wdaSessionId)) {
|
|
100
|
+
throw new errors.NoSuchDriverError('This session has been replaced by a newer one, because this driver only supports a single session');
|
|
101
|
+
}
|
|
94
102
|
return this._wda;
|
|
95
103
|
}
|
|
96
104
|
async onSettingsUpdate(key, value) {
|
|
97
105
|
if (!this._wda) {
|
|
98
106
|
return;
|
|
99
107
|
}
|
|
100
|
-
return await this.
|
|
108
|
+
return await this.wda.proxy.command('/appium/settings', 'POST', {
|
|
101
109
|
settings: { [key]: value },
|
|
102
110
|
});
|
|
103
111
|
}
|
|
@@ -113,10 +121,7 @@ export class Mac2Driver extends BaseDriver {
|
|
|
113
121
|
return true;
|
|
114
122
|
}
|
|
115
123
|
async proxyCommand(url, method, body = null) {
|
|
116
|
-
|
|
117
|
-
throw new Error('WDA server is not initialized');
|
|
118
|
-
}
|
|
119
|
-
return await this._wda.proxy.command(url, method, body);
|
|
124
|
+
return await this.wda.proxy.command(url, method, body);
|
|
120
125
|
}
|
|
121
126
|
async getStatus() {
|
|
122
127
|
if (!this._wda) {
|
|
@@ -126,10 +131,7 @@ export class Mac2Driver extends BaseDriver {
|
|
|
126
131
|
}
|
|
127
132
|
// needed to make image plugin work
|
|
128
133
|
async getWindowRect() {
|
|
129
|
-
|
|
130
|
-
throw new Error('WDA server is not initialized');
|
|
131
|
-
}
|
|
132
|
-
return await this._wda.proxy.command('/window/rect', 'GET');
|
|
134
|
+
return await this.wda.proxy.command('/window/rect', 'GET');
|
|
133
135
|
}
|
|
134
136
|
async createSession(w3cCaps1, w3cCaps2, w3cCaps3, driverData) {
|
|
135
137
|
const [sessionId, caps] = await super.createSession(w3cCaps1, w3cCaps2, w3cCaps3, driverData);
|
|
@@ -137,34 +139,49 @@ export class Mac2Driver extends BaseDriver {
|
|
|
137
139
|
this.caps = caps;
|
|
138
140
|
// oxlint-disable-next-line no-self-assign -- narrows this.opts' type for the rest of the method
|
|
139
141
|
this.opts = this.opts;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
// The host supports a single session: the previous one has to quit first
|
|
143
|
+
await sessionClaimHandler.runExclusive(async () => {
|
|
144
|
+
// The session might have been deleted while it was waiting for its turn
|
|
145
|
+
if (!this._wda || !this.sessionId) {
|
|
146
|
+
throw new errors.NoSuchDriverError('The session has been deleted before it could start');
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
await sessionClaimHandler.registerActiveSession(this);
|
|
150
|
+
await sessionClaimHandler.claimHost(this);
|
|
151
|
+
this._hasClaimedHost = true;
|
|
152
|
+
const prerun = caps.prerun;
|
|
153
|
+
if (prerun) {
|
|
154
|
+
if (typeof prerun.command !== 'string' && typeof prerun.script !== 'string') {
|
|
155
|
+
throw new Error(`'prerun' capability value must either contain 'script' or 'command' entry of string type`);
|
|
156
|
+
}
|
|
157
|
+
log.info('Executing prerun AppleScript');
|
|
158
|
+
const output = await this.macosExecAppleScript(prerun.script, undefined, prerun.command);
|
|
159
|
+
if (output.trim()) {
|
|
160
|
+
log.info(`Prerun script output: ${output}`);
|
|
161
|
+
}
|
|
150
162
|
}
|
|
163
|
+
this._wdaSessionId = await this.wda.startSession(caps, {
|
|
164
|
+
reqBasePath: this.basePath,
|
|
165
|
+
});
|
|
151
166
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
throw e;
|
|
159
|
-
}
|
|
160
|
-
this.proxyReqRes = this.wda.proxy.proxyReqRes.bind(this._wda.proxy);
|
|
167
|
+
catch (e) {
|
|
168
|
+
await this.deleteSession();
|
|
169
|
+
throw e;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
this.proxyReqRes = (...args) => this.wda.proxy.proxyReqRes.apply(this.wda.proxy, args);
|
|
161
173
|
this.isProxyActive = true;
|
|
162
174
|
return [sessionId, caps];
|
|
163
175
|
}
|
|
164
176
|
async deleteSession() {
|
|
177
|
+
sessionClaimHandler.unregisterActiveSession(this);
|
|
178
|
+
// A new session waits for the teardown to complete before it starts
|
|
179
|
+
await sessionClaimHandler.trackTeardown(async () => await this.teardownSession());
|
|
180
|
+
}
|
|
181
|
+
async teardownSession() {
|
|
165
182
|
await this._screenRecorder?.stop(true);
|
|
166
183
|
if (this._videoChunksBroadcaster.hasPublishers) {
|
|
167
|
-
if (this._wda) {
|
|
184
|
+
if (this._wda?.isSessionActive(this._wdaSessionId)) {
|
|
168
185
|
try {
|
|
169
186
|
await this.wda.proxy.command('/wda/video/stop', 'POST', {});
|
|
170
187
|
}
|
|
@@ -173,9 +190,10 @@ export class Mac2Driver extends BaseDriver {
|
|
|
173
190
|
await this._videoChunksBroadcaster.shutdown(5000);
|
|
174
191
|
}
|
|
175
192
|
if (this._wda) {
|
|
176
|
-
await this.
|
|
193
|
+
await this._wda.stopSession(this._wdaSessionId);
|
|
177
194
|
}
|
|
178
|
-
|
|
195
|
+
// Skip postrun if the host was never acquired, as the previous session might still be using it
|
|
196
|
+
const postrun = this._hasClaimedHost ? this.opts.postrun : undefined;
|
|
179
197
|
if (postrun) {
|
|
180
198
|
if (typeof postrun.command !== 'string' && typeof postrun.script !== 'string') {
|
|
181
199
|
log.error(`'postrun' capability value must either contain 'script' or 'command' entry of string type`);
|
|
@@ -198,6 +216,8 @@ export class Mac2Driver extends BaseDriver {
|
|
|
198
216
|
}
|
|
199
217
|
resetState() {
|
|
200
218
|
this._wda = null;
|
|
219
|
+
this._wdaSessionId = null;
|
|
220
|
+
this._hasClaimedHost = false;
|
|
201
221
|
this.isProxyActive = false;
|
|
202
222
|
this._videoChunksBroadcaster = new nativeScreenRecordingCommands.NativeVideoChunksBroadcaster(this.eventEmitter, this.log);
|
|
203
223
|
this._screenRecorder = null;
|
package/build/lib/driver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../lib/driver.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"driver.js","sourceRoot":"","sources":["../../lib/driver.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAEpE,OAAO,KAAK,sBAAsB,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,mBAAmB,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,6BAA6B,MAAM,oCAAoC,CAAC;AACpF,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,gBAAwC,MAAM,kBAAkB,CAAC;AAC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C,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,uBAAuB,GAAG,IAAI,6BAA6B,CAAC,4BAA4B,CAC3F,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,GAAG,CACT,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;;AAGH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IAppiumIpc } from '@appium/types';
|
|
2
|
+
import type { Mac2Driver } from './driver.js';
|
|
3
|
+
export type SessionIpcMessage = {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
};
|
|
6
|
+
type IpcProvider = () => Promise<IAppiumIpc | undefined>;
|
|
7
|
+
/** Lets a new session make the previous one quit, over a driver-wide IPC (per-session IPCs are isolated). */
|
|
8
|
+
export declare class SessionClaimHandler {
|
|
9
|
+
private readonly getIpc;
|
|
10
|
+
private readonly releaseWaitMs;
|
|
11
|
+
static readonly CLAIMED_TOPIC = "mac2:sessionClaimed";
|
|
12
|
+
static readonly CONTENDED_TOPIC = "mac2:sessionContended";
|
|
13
|
+
static readonly RELEASED_TOPIC = "mac2:sessionReleased";
|
|
14
|
+
private static readonly STARTUP_LOCK_KEY;
|
|
15
|
+
private static readonly CONTENTION_PROBE_MS;
|
|
16
|
+
private static readonly DEFAULT_RELEASE_WAIT_MS;
|
|
17
|
+
private readonly startupLock;
|
|
18
|
+
private readonly pendingTeardowns;
|
|
19
|
+
private readonly subscriptionsBySessionId;
|
|
20
|
+
constructor(getIpc: IpcProvider, releaseWaitMs?: number);
|
|
21
|
+
/** Serializes session startups so the newest wins. Enter before registering the session. */
|
|
22
|
+
runExclusive<T>(fn: () => Promise<T>): Promise<T>;
|
|
23
|
+
/** Subscribe the session to claim messages from newer sessions. */
|
|
24
|
+
registerActiveSession(driver: Mac2Driver): Promise<void>;
|
|
25
|
+
/** Unsubscribe the session from claim messages. */
|
|
26
|
+
unregisterActiveSession(driver: Mac2Driver): void;
|
|
27
|
+
/** Tracks a session teardown, so that a new session does not start before it is complete. */
|
|
28
|
+
trackTeardown(teardown: () => Promise<void>): Promise<void>;
|
|
29
|
+
/** Make any other active session quit and wait until it has released the host. */
|
|
30
|
+
claimHost(driver: Mac2Driver): Promise<void>;
|
|
31
|
+
private waitForPendingTeardowns;
|
|
32
|
+
private requestRelease;
|
|
33
|
+
private dispatchClaimMessage;
|
|
34
|
+
private handleClaimMessage;
|
|
35
|
+
private terminateSession;
|
|
36
|
+
private publish;
|
|
37
|
+
private getPublisherId;
|
|
38
|
+
}
|
|
39
|
+
export declare const sessionClaimHandler: SessionClaimHandler;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=session-claim-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-claim-handler.d.ts","sourceRoot":"","sources":["../../lib/session-claim-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,UAAU,EAA+B,MAAM,eAAe,CAAC;AAM1F,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,KAAK,WAAW,GAAG,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;AAEzD,6GAA6G;AAC7G,qBAAa,mBAAmB;IAe5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAfhC,MAAM,CAAC,QAAQ,CAAC,aAAa,yBAAyB;IACtD,MAAM,CAAC,QAAQ,CAAC,eAAe,2BAA2B;IAC1D,MAAM,CAAC,QAAQ,CAAC,cAAc,0BAA0B;IAExD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAyB;IAEjE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAM;IACjD,OAAO,CAAC,MAAM,CAAC,QAA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