spana-test 0.11.0 → 0.13.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/.agents/skills/spana-testing/SKILL.md +0 -0
- package/LICENSE +0 -0
- package/README.md +5 -2
- package/dist/{accessibility-audit-YZOPUY3D.js → accessibility-audit-MHQ65DUD.js} +61 -12
- package/dist/accessibility-audit-MHQ65DUD.js.map +1 -0
- package/dist/agent/index.d.ts +3 -11
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +38 -15
- package/dist/agent/index.js.map +1 -1
- package/dist/{session-uT8xL03K.d.ts → agent/session.d.ts} +14 -46
- package/dist/agent/session.d.ts.map +1 -0
- package/dist/{agent-fixture-5C4MCWRD.js → agent-fixture-H6GOUHNX.js} +3 -3
- package/dist/{agent-fixture-5C4MCWRD.js.map → agent-fixture-H6GOUHNX.js.map} +0 -0
- package/dist/{allure-FGVR5LND.js → allure-XOM7BXL5.js} +5 -2
- package/dist/{allure-FGVR5LND.js.map → allure-XOM7BXL5.js.map} +1 -1
- package/dist/{android-6BOQTMM3.js → android-C2S4B4TH.js} +3 -3
- package/dist/{android-6BOQTMM3.js.map → android-C2S4B4TH.js.map} +0 -0
- package/dist/api/agent-fixture.d.ts +119 -0
- package/dist/api/agent-fixture.d.ts.map +1 -0
- package/dist/api/app.d.ts +399 -0
- package/dist/api/app.d.ts.map +1 -0
- package/dist/api/expect.d.ts +180 -0
- package/dist/api/expect.d.ts.map +1 -0
- package/dist/api/fixtures.d.ts +165 -0
- package/dist/api/fixtures.d.ts.map +1 -0
- package/dist/api/flow.d.ts +123 -0
- package/dist/api/flow.d.ts.map +1 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/snapshots.d.ts +26 -0
- package/dist/api/snapshots.d.ts.map +1 -0
- package/dist/api/storybook.d.ts +18 -0
- package/dist/api/storybook.d.ts.map +1 -0
- package/dist/api/suite.d.ts +46 -0
- package/dist/api/suite.d.ts.map +1 -0
- package/dist/app-W6PRRBMD.js +13 -0
- package/dist/{app-RSDPDTKT.js.map → app-W6PRRBMD.js.map} +0 -0
- package/dist/appium-CC77BJNK.js +935 -0
- package/dist/appium-CC77BJNK.js.map +1 -0
- package/dist/{appium-server-66GVUL24.js → appium-server-M6CWWUWF.js} +5 -2
- package/dist/{appium-server-66GVUL24.js.map → appium-server-M6CWWUWF.js.map} +1 -1
- package/dist/{baseline-manager-5TIUCNP5.js → baseline-manager-LVUVH2MJ.js} +5 -2
- package/dist/{baseline-manager-5TIUCNP5.js.map → baseline-manager-LVUVH2MJ.js.map} +1 -1
- package/dist/bridge-server-S3DHK7XE.js +12 -0
- package/dist/{cache-command-PANUAEMZ.js.map → bridge-server-S3DHK7XE.js.map} +0 -0
- package/dist/{cache-command-PANUAEMZ.js → cache-command-OL7HUK2K.js} +3 -3
- package/dist/{chunk-DGUM43GV.js.map → cache-command-OL7HUK2K.js.map} +0 -0
- package/dist/channels/android-cdp.d.ts +71 -0
- package/dist/channels/android-cdp.d.ts.map +1 -0
- package/dist/channels/apple-webinspector.d.ts +85 -0
- package/dist/channels/apple-webinspector.d.ts.map +1 -0
- package/dist/channels/bidi-client.d.ts +79 -0
- package/dist/channels/bidi-client.d.ts.map +1 -0
- package/dist/channels/bridge-server.d.ts +69 -0
- package/dist/channels/bridge-server.d.ts.map +1 -0
- package/dist/channels/cdp-client.d.ts +115 -0
- package/dist/channels/cdp-client.d.ts.map +1 -0
- package/dist/channels/dom-channel.d.ts +246 -0
- package/dist/channels/dom-channel.d.ts.map +1 -0
- package/dist/channels/index.d.ts +8 -0
- package/dist/channels/index.d.ts.map +1 -0
- package/dist/channels/webkit-inspector.d.ts +85 -0
- package/dist/channels/webkit-inspector.d.ts.map +1 -0
- package/dist/channels/ws-server.d.ts +21 -0
- package/dist/channels/ws-server.d.ts.map +1 -0
- package/dist/chunk-27H6NDA5.js +845 -0
- package/dist/chunk-27H6NDA5.js.map +1 -0
- package/dist/{chunk-WV3ALL3H.js → chunk-2MA5G2VH.js} +6 -2
- package/dist/{chunk-WV3ALL3H.js.map → chunk-2MA5G2VH.js.map} +1 -1
- package/dist/chunk-4LJ3KYCX.js +94 -0
- package/dist/chunk-4LJ3KYCX.js.map +1 -0
- package/dist/chunk-5SDVP53E.js +1046 -0
- package/dist/chunk-5SDVP53E.js.map +1 -0
- package/dist/{chunk-FPQAJNE3.js → chunk-5T7LSBDM.js} +288 -101
- package/dist/chunk-5T7LSBDM.js.map +1 -0
- package/dist/chunk-6C2EILMC.js +2589 -0
- package/dist/chunk-6C2EILMC.js.map +1 -0
- package/dist/{chunk-3IZMPNE7.js → chunk-7IUD55GY.js} +1333 -941
- package/dist/chunk-7IUD55GY.js.map +1 -0
- package/dist/{chunk-JPZCZHL4.js → chunk-7Q7TSUNL.js} +6 -1
- package/dist/{chunk-JPZCZHL4.js.map → chunk-7Q7TSUNL.js.map} +1 -1
- package/dist/{chunk-X2TJP7LB.js → chunk-7WHQIQPM.js} +11 -1
- package/dist/chunk-7WHQIQPM.js.map +1 -0
- package/dist/chunk-A7Z52TDQ.js +97 -0
- package/dist/chunk-A7Z52TDQ.js.map +1 -0
- package/dist/{chunk-WZAQANN6.js → chunk-BUNMIMGA.js} +9 -3
- package/dist/{chunk-WZAQANN6.js.map → chunk-BUNMIMGA.js.map} +1 -1
- package/dist/chunk-DMF2BPPA.js +547 -0
- package/dist/chunk-DMF2BPPA.js.map +1 -0
- package/dist/{chunk-Z6K4QQAR.js → chunk-FHCOPLYB.js} +36 -7
- package/dist/chunk-FHCOPLYB.js.map +1 -0
- package/dist/{chunk-3SH5JQF7.js → chunk-FSPMFRJO.js} +6 -1
- package/dist/{chunk-3SH5JQF7.js.map → chunk-FSPMFRJO.js.map} +1 -1
- package/dist/chunk-FTXUQMGH.js +56 -0
- package/dist/chunk-FTXUQMGH.js.map +1 -0
- package/dist/chunk-FUXFXFBM.js +1962 -0
- package/dist/chunk-FUXFXFBM.js.map +1 -0
- package/dist/{chunk-SIJJVN2D.js → chunk-FV7ONGQ7.js} +9 -3
- package/dist/{chunk-SIJJVN2D.js.map → chunk-FV7ONGQ7.js.map} +1 -1
- package/dist/{chunk-VUNH4AJD.js → chunk-GDVHJBR2.js} +9 -5
- package/dist/{chunk-VUNH4AJD.js.map → chunk-GDVHJBR2.js.map} +1 -1
- package/dist/chunk-GLNTGHR6.js +330 -0
- package/dist/chunk-GLNTGHR6.js.map +1 -0
- package/dist/{chunk-OPTNFLBL.js → chunk-HIGFQRWM.js} +7 -1
- package/dist/{chunk-OPTNFLBL.js.map → chunk-HIGFQRWM.js.map} +1 -1
- package/dist/chunk-HJY5YN4N.js +272 -0
- package/dist/chunk-HJY5YN4N.js.map +1 -0
- package/dist/chunk-HNQLWFHL.js +40 -0
- package/dist/chunk-HNQLWFHL.js.map +1 -0
- package/dist/chunk-HUYC4OAL.js +72 -0
- package/dist/chunk-HUYC4OAL.js.map +1 -0
- package/dist/chunk-HWS3XUEF.js +109 -0
- package/dist/chunk-HWS3XUEF.js.map +1 -0
- package/dist/chunk-IDIHDVGC.js +328 -0
- package/dist/chunk-IDIHDVGC.js.map +1 -0
- package/dist/{chunk-4SA7JK5D.js → chunk-IUK3RJ6W.js} +38 -20
- package/dist/{chunk-4SA7JK5D.js.map → chunk-IUK3RJ6W.js.map} +1 -1
- package/dist/chunk-K4K2ACT2.js +179 -0
- package/dist/chunk-K4K2ACT2.js.map +1 -0
- package/dist/chunk-LKGF75QJ.js +654 -0
- package/dist/chunk-LKGF75QJ.js.map +1 -0
- package/dist/chunk-MAKZK7GY.js +935 -0
- package/dist/chunk-MAKZK7GY.js.map +1 -0
- package/dist/chunk-MPJCUL2B.js +154 -0
- package/dist/chunk-MPJCUL2B.js.map +1 -0
- package/dist/chunk-MUMIMDRJ.js +24 -0
- package/dist/chunk-MUMIMDRJ.js.map +1 -0
- package/dist/{chunk-KJPHH2TW.js → chunk-NHT3XSX3.js} +6 -1
- package/dist/{chunk-KJPHH2TW.js.map → chunk-NHT3XSX3.js.map} +1 -1
- package/dist/{chunk-6PTUVG6A.js → chunk-NWGA3R2E.js} +7 -18
- package/dist/chunk-NWGA3R2E.js.map +1 -0
- package/dist/{chunk-3FSZNKEF.js → chunk-NXET4BFJ.js} +7 -1
- package/dist/{chunk-3FSZNKEF.js.map → chunk-NXET4BFJ.js.map} +1 -1
- package/dist/chunk-PPRNCRTS.js +1104 -0
- package/dist/chunk-PPRNCRTS.js.map +1 -0
- package/dist/{chunk-64UZQP7Z.js → chunk-PRQTAIYA.js} +30 -4
- package/dist/chunk-PRQTAIYA.js.map +1 -0
- package/dist/{chunk-4KK4E3N3.js → chunk-RHQJSPOS.js} +1289 -187
- package/dist/chunk-RHQJSPOS.js.map +1 -0
- package/dist/{chunk-CY3DKTBZ.js → chunk-RIXZISMX.js} +6 -1
- package/dist/{chunk-CY3DKTBZ.js.map → chunk-RIXZISMX.js.map} +1 -1
- package/dist/{chunk-S7MSBZ3F.js → chunk-TFEXYI6N.js} +6 -1
- package/dist/{chunk-S7MSBZ3F.js.map → chunk-TFEXYI6N.js.map} +1 -1
- package/dist/chunk-U56N5JCJ.js +19842 -0
- package/dist/chunk-U56N5JCJ.js.map +1 -0
- package/dist/{chunk-IHVZKQQW.js → chunk-UKUXNFQP.js} +6 -1
- package/dist/{chunk-IHVZKQQW.js.map → chunk-UKUXNFQP.js.map} +1 -1
- package/dist/{chunk-SGZMO456.js → chunk-VWJNINPX.js} +667 -123
- package/dist/chunk-VWJNINPX.js.map +1 -0
- package/dist/chunk-WFC4DCFF.js +529 -0
- package/dist/chunk-WFC4DCFF.js.map +1 -0
- package/dist/{chunk-26NJXP55.js → chunk-WJH5K42V.js} +6 -2
- package/dist/{chunk-26NJXP55.js.map → chunk-WJH5K42V.js.map} +1 -1
- package/dist/chunk-X5FRYDZ3.js +91 -0
- package/dist/chunk-X5FRYDZ3.js.map +1 -0
- package/dist/{chunk-VP6V4XEJ.js → chunk-XD6A3VXB.js} +10 -5
- package/dist/{chunk-VP6V4XEJ.js.map → chunk-XD6A3VXB.js.map} +1 -1
- package/dist/{chunk-2AFWVHQK.js → chunk-XVL4FHXA.js} +6 -1
- package/dist/{chunk-2AFWVHQK.js.map → chunk-XVL4FHXA.js.map} +1 -1
- package/dist/chunk-YFTHJRDO.js +37 -0
- package/dist/chunk-YFTHJRDO.js.map +1 -0
- package/dist/{chunk-LAMTF4LX.js → chunk-ZIETAMAD.js} +6 -1
- package/dist/{chunk-LAMTF4LX.js.map → chunk-ZIETAMAD.js.map} +1 -1
- package/dist/cli/cache-command.d.ts +29 -0
- package/dist/cli/cache-command.d.ts.map +1 -0
- package/dist/cli/command-errors.d.ts +7 -0
- package/dist/cli/command-errors.d.ts.map +1 -0
- package/dist/cli/config-loader.d.ts +11 -0
- package/dist/cli/config-loader.d.ts.map +1 -0
- package/dist/cli/doctor-command.d.ts +64 -0
- package/dist/cli/doctor-command.d.ts.map +1 -0
- package/dist/cli/gen-types-command.d.ts +2 -0
- package/dist/cli/gen-types-command.d.ts.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/init-command.d.ts +7 -0
- package/dist/cli/init-command.d.ts.map +1 -0
- package/dist/cli/init-flow-command.d.ts +11 -0
- package/dist/cli/init-flow-command.d.ts.map +1 -0
- package/dist/cli/iteration.d.ts +44 -0
- package/dist/cli/iteration.d.ts.map +1 -0
- package/dist/cli/scaffolds.d.ts +13 -0
- package/dist/cli/scaffolds.d.ts.map +1 -0
- package/dist/cli/studio-command.d.ts +8 -0
- package/dist/cli/studio-command.d.ts.map +1 -0
- package/dist/cli/test-command.d.ts +61 -0
- package/dist/cli/test-command.d.ts.map +1 -0
- package/dist/cli/watch-mode.d.ts +9 -0
- package/dist/cli/watch-mode.d.ts.map +1 -0
- package/dist/cli.js +86 -30
- package/dist/cli.js.map +1 -1
- package/dist/cloud/browserstack.d.ts +9 -0
- package/dist/cloud/browserstack.d.ts.map +1 -0
- package/dist/cloud/common.d.ts +26 -0
- package/dist/cloud/common.d.ts.map +1 -0
- package/dist/cloud/provider.d.ts +21 -0
- package/dist/cloud/provider.d.ts.map +1 -0
- package/dist/cloud/saucelabs.d.ts +9 -0
- package/dist/cloud/saucelabs.d.ts.map +1 -0
- package/dist/{compiler-X6WTFMYF.js → compiler-44UW2FID.js} +7 -3
- package/dist/{compiler-X6WTFMYF.js.map → compiler-44UW2FID.js.map} +1 -1
- package/dist/config-loader-7W7OEWRG.js +10 -0
- package/dist/{config-loader-CNGIW2XK.js.map → config-loader-7W7OEWRG.js.map} +0 -0
- package/dist/{console-DIYEJSSP.js → console-T6TVZ65G.js} +8 -2
- package/dist/console-T6TVZ65G.js.map +1 -0
- package/dist/core/accessibility-audit.d.ts +29 -0
- package/dist/core/accessibility-audit.d.ts.map +1 -0
- package/dist/core/artifacts.d.ts +27 -0
- package/dist/core/artifacts.d.ts.map +1 -0
- package/dist/core/baseline-manager.d.ts +18 -0
- package/dist/core/baseline-manager.d.ts.map +1 -0
- package/dist/core/benchmark.d.ts +21 -0
- package/dist/core/benchmark.d.ts.map +1 -0
- package/dist/core/debug-repl.d.ts +17 -0
- package/dist/core/debug-repl.d.ts.map +1 -0
- package/dist/core/engine.d.ts +51 -0
- package/dist/core/engine.d.ts.map +1 -0
- package/dist/core/filters.d.ts +248 -0
- package/dist/core/filters.d.ts.map +1 -0
- package/dist/core/flow-generator.d.ts +13 -0
- package/dist/core/flow-generator.d.ts.map +1 -0
- package/dist/core/graphemes.d.ts +2 -0
- package/dist/core/graphemes.d.ts.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/native-accel.d.ts +21 -0
- package/dist/core/native-accel.d.ts.map +1 -0
- package/dist/core/network-cache.d.ts +68 -0
- package/dist/core/network-cache.d.ts.map +1 -0
- package/dist/core/orchestrator.d.ts +44 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/parallel.d.ts +42 -0
- package/dist/core/parallel.d.ts.map +1 -0
- package/dist/core/port-allocator.d.ts +16 -0
- package/dist/core/port-allocator.d.ts.map +1 -0
- package/dist/core/projects.d.ts +60 -0
- package/dist/core/projects.d.ts.map +1 -0
- package/dist/core/replay-cache.d.ts +127 -0
- package/dist/core/replay-cache.d.ts.map +1 -0
- package/dist/core/runner.d.ts +50 -0
- package/dist/core/runner.d.ts.map +1 -0
- package/dist/core/screenshot-compare.d.ts +50 -0
- package/dist/core/screenshot-compare.d.ts.map +1 -0
- package/dist/core/session-manager.d.ts +35 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/step-recorder.d.ts +20 -0
- package/dist/core/step-recorder.d.ts.map +1 -0
- package/dist/core/target-matrix.d.ts +29 -0
- package/dist/core/target-matrix.d.ts.map +1 -0
- package/dist/core/trace-viewer.d.ts +91 -0
- package/dist/core/trace-viewer.d.ts.map +1 -0
- package/dist/core/validator.d.ts +18 -0
- package/dist/core/validator.d.ts.map +1 -0
- package/dist/core/video-recorder.d.ts +120 -0
- package/dist/core/video-recorder.d.ts.map +1 -0
- package/dist/core/worker-pool.d.ts +87 -0
- package/dist/core/worker-pool.d.ts.map +1 -0
- package/dist/{daemon-manager-2EQDVUVM.js → daemon-manager-2SK5PHJR.js} +3 -3
- package/dist/{daemon-manager-2EQDVUVM.js.map → daemon-manager-2SK5PHJR.js.map} +0 -0
- package/dist/device/android.d.ts +66 -0
- package/dist/device/android.d.ts.map +1 -0
- package/dist/device/discover.d.ts +15 -0
- package/dist/device/discover.d.ts.map +1 -0
- package/dist/device/index.d.ts +4 -0
- package/dist/device/index.d.ts.map +1 -0
- package/dist/device/ios.d.ts +126 -0
- package/dist/device/ios.d.ts.map +1 -0
- package/dist/diagnostics/live-inspector.d.ts +121 -0
- package/dist/diagnostics/live-inspector.d.ts.map +1 -0
- package/dist/diagnostics/native-logs.d.ts +38 -0
- package/dist/diagnostics/native-logs.d.ts.map +1 -0
- package/dist/discover-6ULCTB5T.js +15 -0
- package/dist/{discover-NKDMB4UI.js.map → discover-6ULCTB5T.js.map} +0 -0
- package/dist/{doctor-command-6ZVJWCW7.js → doctor-command-4CQQLB7M.js} +24 -14
- package/dist/{doctor-command-6ZVJWCW7.js.map → doctor-command-4CQQLB7M.js.map} +1 -1
- package/dist/driver-3MEIFYST.js +19 -0
- package/dist/{filters-MQG2RMPX.js.map → driver-3MEIFYST.js.map} +0 -0
- package/dist/driver-QTIAADUZ.js +19 -0
- package/dist/{github-pr-YMWIPCCZ.js.map → driver-QTIAADUZ.js.map} +0 -0
- package/dist/drivers/adapter-registry.d.ts +96 -0
- package/dist/drivers/adapter-registry.d.ts.map +1 -0
- package/dist/drivers/appium/android.d.ts +22 -0
- package/dist/drivers/appium/android.d.ts.map +1 -0
- package/dist/drivers/appium/client.d.ts +26 -0
- package/dist/drivers/appium/client.d.ts.map +1 -0
- package/dist/drivers/appium/ios.d.ts +28 -0
- package/dist/drivers/appium/ios.d.ts.map +1 -0
- package/dist/drivers/appium/window-size.d.ts +8 -0
- package/dist/drivers/appium/window-size.d.ts.map +1 -0
- package/dist/drivers/browser-extensions.d.ts +62 -0
- package/dist/drivers/browser-extensions.d.ts.map +1 -0
- package/dist/drivers/cdp-browser.d.ts +129 -0
- package/dist/drivers/cdp-browser.d.ts.map +1 -0
- package/dist/drivers/common/xml-tokenizer.d.ts +26 -0
- package/dist/drivers/common/xml-tokenizer.d.ts.map +1 -0
- package/dist/drivers/device-controls.d.ts +36 -0
- package/dist/drivers/device-controls.d.ts.map +1 -0
- package/dist/drivers/electrobun.d.ts +47 -0
- package/dist/drivers/electrobun.d.ts.map +1 -0
- package/dist/drivers/electron.d.ts +36 -0
- package/dist/drivers/electron.d.ts.map +1 -0
- package/dist/drivers/index.d.ts +2 -0
- package/dist/drivers/index.d.ts.map +1 -0
- package/dist/drivers/launch-options.d.ts +10 -0
- package/dist/drivers/launch-options.d.ts.map +1 -0
- package/dist/drivers/network-profiles.d.ts +9 -0
- package/dist/drivers/network-profiles.d.ts.map +1 -0
- package/dist/drivers/playwright-parser.d.ts +16 -0
- package/dist/drivers/playwright-parser.d.ts.map +1 -0
- package/dist/drivers/playwright.d.ts +65 -0
- package/dist/drivers/playwright.d.ts.map +1 -0
- package/dist/drivers/raw-driver.d.ts +403 -0
- package/dist/drivers/raw-driver.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/client.d.ts +77 -0
- package/dist/drivers/uiautomator2/client.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/driver.d.ts +20 -0
- package/dist/drivers/uiautomator2/driver.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/index.d.ts +5 -0
- package/dist/drivers/uiautomator2/index.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/installer.d.ts +20 -0
- package/dist/drivers/uiautomator2/installer.d.ts.map +1 -0
- package/dist/drivers/uiautomator2/pagesource.d.ts +12 -0
- package/dist/drivers/uiautomator2/pagesource.d.ts.map +1 -0
- package/dist/drivers/wasm-utils.d.ts +100 -0
- package/dist/drivers/wasm-utils.d.ts.map +1 -0
- package/dist/drivers/wasm.d.ts +57 -0
- package/dist/drivers/wasm.d.ts.map +1 -0
- package/dist/drivers/wda/client.d.ts +116 -0
- package/dist/drivers/wda/client.d.ts.map +1 -0
- package/dist/drivers/wda/driver.d.ts +26 -0
- package/dist/drivers/wda/driver.d.ts.map +1 -0
- package/dist/drivers/wda/index.d.ts +5 -0
- package/dist/drivers/wda/index.d.ts.map +1 -0
- package/dist/drivers/wda/installer.d.ts +51 -0
- package/dist/drivers/wda/installer.d.ts.map +1 -0
- package/dist/drivers/wda/pagesource.d.ts +12 -0
- package/dist/drivers/wda/pagesource.d.ts.map +1 -0
- package/dist/electrobun-MPAHMSI2.js +15 -0
- package/dist/{installer-5UHTYQTB.js.map → electrobun-MPAHMSI2.js.map} +0 -0
- package/dist/electron-SQACDON3.js +9 -0
- package/dist/{ios-Y4TO5MBR.js.map → electron-SQACDON3.js.map} +0 -0
- package/dist/errors.d.ts +82 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/{filters-MQG2RMPX.js → filters-5DCGGJRN.js} +3 -3
- package/dist/{local-DM3YBSV5.js.map → filters-5DCGGJRN.js.map} +0 -0
- package/dist/gherkin/compiler.d.ts +3 -0
- package/dist/gherkin/compiler.d.ts.map +1 -0
- package/dist/gherkin/index.d.ts +7 -0
- package/dist/gherkin/index.d.ts.map +1 -0
- package/dist/gherkin/matcher.d.ts +9 -0
- package/dist/gherkin/matcher.d.ts.map +1 -0
- package/dist/gherkin/registry.d.ts +28 -0
- package/dist/gherkin/registry.d.ts.map +1 -0
- package/dist/gherkin/steps.d.ts +13 -31
- package/dist/gherkin/steps.d.ts.map +1 -0
- package/dist/gherkin/steps.js +5 -2
- package/dist/gherkin/steps.js.map +1 -1
- package/dist/gherkin/world.d.ts +15 -0
- package/dist/gherkin/world.d.ts.map +1 -0
- package/dist/{github-pr-YMWIPCCZ.js → github-pr-RYO6IAKD.js} +3 -3
- package/dist/{machine-6H25TRTU.js.map → github-pr-RYO6IAKD.js.map} +0 -0
- package/dist/{html-FLMWPFQD.js → html-KJ2QAGF4.js} +6 -3
- package/dist/{html-FLMWPFQD.js.map → html-KJ2QAGF4.js.map} +1 -1
- package/dist/index.d.ts +57 -2267
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +460 -69
- package/dist/index.js.map +1 -1
- package/dist/{init-command-Z3QREABL.js → init-command-V5VGN3IS.js} +5 -2
- package/dist/{init-command-Z3QREABL.js.map → init-command-V5VGN3IS.js.map} +1 -1
- package/dist/{init-flow-command-4EKRVTNT.js → init-flow-command-INYUCC6N.js} +6 -3
- package/dist/{init-flow-command-4EKRVTNT.js.map → init-flow-command-INYUCC6N.js.map} +1 -1
- package/dist/{installer-5UHTYQTB.js → installer-DMTY47SI.js} +5 -5
- package/dist/{provider-YIPU5K42.js.map → installer-DMTY47SI.js.map} +0 -0
- package/dist/installer-KL2NCILK.js +17 -0
- package/dist/{runner-WOVZWUQR.js.map → installer-KL2NCILK.js.map} +0 -0
- package/dist/{ios-Y4TO5MBR.js → ios-SZ4RBI7Q.js} +4 -4
- package/dist/{server-ING5D5ZJ.js.map → ios-SZ4RBI7Q.js.map} +0 -0
- package/dist/json-57Z2YSES.js +39 -0
- package/dist/json-57Z2YSES.js.map +1 -0
- package/dist/{junit-CGB3LKHD.js → junit-MHD5AXBU.js} +26 -6
- package/dist/junit-MHD5AXBU.js.map +1 -0
- package/dist/{local-DM3YBSV5.js → local-SWHWINSA.js} +11 -12
- package/dist/{session-5TNWVGQQ.js.map → local-SWHWINSA.js.map} +0 -0
- package/dist/{machine-6H25TRTU.js → machine-NOOFRT45.js} +3 -3
- package/dist/{validator-WO5IL7IY.js.map → machine-NOOFRT45.js.map} +0 -0
- package/dist/machine.d.ts +20 -0
- package/dist/machine.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +73 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/pagesource-KIQ5T5MA.js +9 -0
- package/dist/pagesource-KIQ5T5MA.js.map +1 -0
- package/dist/pagesource-KKG7WMFJ.js +9 -0
- package/dist/pagesource-KKG7WMFJ.js.map +1 -0
- package/dist/playwright-42QYIZEE.js +28 -0
- package/dist/playwright-42QYIZEE.js.map +1 -0
- package/dist/{provider-YIPU5K42.js → provider-CBAXZ2VA.js} +3 -3
- package/dist/provider-CBAXZ2VA.js.map +1 -0
- package/dist/{redact-U72BUBBR.js → redact-OG4M3IEU.js} +5 -2
- package/dist/{redact-U72BUBBR.js.map → redact-OG4M3IEU.js.map} +1 -1
- package/dist/report/allure.d.ts +3 -0
- package/dist/report/allure.d.ts.map +1 -0
- package/dist/report/classify-error.d.ts +7 -0
- package/dist/report/classify-error.d.ts.map +1 -0
- package/dist/report/code-frame.d.ts +16 -0
- package/dist/report/code-frame.d.ts.map +1 -0
- package/dist/report/console.d.ts +7 -0
- package/dist/report/console.d.ts.map +1 -0
- package/dist/report/failure-bundle.d.ts +66 -0
- package/dist/report/failure-bundle.d.ts.map +1 -0
- package/dist/report/failure-diagnostics.d.ts +11 -0
- package/dist/report/failure-diagnostics.d.ts.map +1 -0
- package/dist/report/github-pr.d.ts +20 -0
- package/dist/report/github-pr.d.ts.map +1 -0
- package/dist/report/html.d.ts +3 -0
- package/dist/report/html.d.ts.map +1 -0
- package/dist/report/index.d.ts +8 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/report/json.d.ts +3 -0
- package/dist/report/json.d.ts.map +1 -0
- package/dist/report/junit.d.ts +3 -0
- package/dist/report/junit.d.ts.map +1 -0
- package/dist/report/redact.d.ts +29 -0
- package/dist/report/redact.d.ts.map +1 -0
- package/dist/report/selector-guardrails.d.ts +12 -0
- package/dist/report/selector-guardrails.d.ts.map +1 -0
- package/dist/report/types.d.ts +164 -0
- package/dist/report/types.d.ts.map +1 -0
- package/dist/{runner-WOVZWUQR.js → runner-ABGUVOJG.js} +5 -3
- package/dist/runner-ABGUVOJG.js.map +1 -0
- package/dist/runtime/appium-server.d.ts +34 -0
- package/dist/runtime/appium-server.d.ts.map +1 -0
- package/dist/runtime/appium.d.ts +5 -0
- package/dist/runtime/appium.d.ts.map +1 -0
- package/dist/runtime/capabilities.d.ts +19 -0
- package/dist/runtime/capabilities.d.ts.map +1 -0
- package/dist/runtime/daemon-manager.d.ts +83 -0
- package/dist/runtime/daemon-manager.d.ts.map +1 -0
- package/dist/runtime/local.d.ts +38 -0
- package/dist/runtime/local.d.ts.map +1 -0
- package/dist/runtime/types.d.ts +21 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/web-server.d.ts +57 -0
- package/dist/runtime/web-server.d.ts.map +1 -0
- package/dist/schemas/config.d.ts +812 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/device.d.ts +12 -0
- package/dist/schemas/device.d.ts.map +1 -0
- package/dist/schemas/element.d.ts +66 -0
- package/dist/schemas/element.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/selector.d.ts +193 -0
- package/dist/schemas/selector.d.ts.map +1 -0
- package/dist/screenshot-compare-BJRJHKNQ.js +12 -0
- package/dist/screenshot-compare-BJRJHKNQ.js.map +1 -0
- package/dist/server-2Y46CDVB.js +6749 -0
- package/dist/server-2Y46CDVB.js.map +1 -0
- package/dist/{server-ING5D5ZJ.js → server-ZCBZ4UYF.js} +3 -3
- package/dist/server-ZCBZ4UYF.js.map +1 -0
- package/dist/session-5XW6TKF4.js +39 -0
- package/dist/session-5XW6TKF4.js.map +1 -0
- package/dist/smart/auto-wait.d.ts +38 -0
- package/dist/smart/auto-wait.d.ts.map +1 -0
- package/dist/smart/channel-resolver.d.ts +90 -0
- package/dist/smart/channel-resolver.d.ts.map +1 -0
- package/dist/smart/coordinator.d.ts +162 -0
- package/dist/smart/coordinator.d.ts.map +1 -0
- package/dist/smart/diagnostics.d.ts +15 -0
- package/dist/smart/diagnostics.d.ts.map +1 -0
- package/dist/smart/element-matcher.d.ts +24 -0
- package/dist/smart/element-matcher.d.ts.map +1 -0
- package/dist/smart/hierarchy-cache.d.ts +16 -0
- package/dist/smart/hierarchy-cache.d.ts.map +1 -0
- package/dist/smart/index.d.ts +4 -0
- package/dist/smart/index.d.ts.map +1 -0
- package/dist/studio/api.d.ts +317 -0
- package/dist/studio/api.d.ts.map +1 -0
- package/dist/studio/context.d.ts +7 -0
- package/dist/studio/context.d.ts.map +1 -0
- package/dist/studio/core/element-tree.d.ts +15 -0
- package/dist/studio/core/element-tree.d.ts.map +1 -0
- package/dist/studio/effect-handler.d.ts +3 -0
- package/dist/studio/effect-handler.d.ts.map +1 -0
- package/dist/studio/procedures.d.ts +4 -0
- package/dist/studio/procedures.d.ts.map +1 -0
- package/dist/studio/recording-session.d.ts +31 -0
- package/dist/studio/recording-session.d.ts.map +1 -0
- package/dist/studio/routers/devices.d.ts +11 -0
- package/dist/studio/routers/devices.d.ts.map +1 -0
- package/dist/studio/routers/inspector.d.ts +104 -0
- package/dist/studio/routers/inspector.d.ts.map +1 -0
- package/dist/studio/routers/recording.d.ts +130 -0
- package/dist/studio/routers/recording.d.ts.map +1 -0
- package/dist/studio/routers/tests.d.ts +93 -0
- package/dist/studio/routers/tests.d.ts.map +1 -0
- package/dist/studio/server.d.ts +12 -0
- package/dist/studio/server.d.ts.map +1 -0
- package/dist/{studio-command-KK7A3KN6.js → studio-command-BNBOL424.js} +6 -3
- package/dist/{studio-command-KK7A3KN6.js.map → studio-command-BNBOL424.js.map} +1 -1
- package/dist/{test-command-QGIJBRH7.js → test-command-T4PLAZXU.js} +311 -1080
- package/dist/test-command-T4PLAZXU.js.map +1 -0
- package/dist/{validator-WO5IL7IY.js → validator-AJNOFBQM.js} +4 -4
- package/dist/validator-AJNOFBQM.js.map +1 -0
- package/dist/watch-mode-NR5MHNNL.js +10 -0
- package/dist/watch-mode-NR5MHNNL.js.map +1 -0
- package/native/darwin-arm64/libspana_native.dylib +0 -0
- package/native/darwin-x64/libspana_native.dylib +0 -0
- package/native/linux-arm64/libspana_native.so +0 -0
- package/native/linux-x64/libspana_native.so +0 -0
- package/native/win32-x64/spana_native.dll +0 -0
- package/package.json +16 -19
- package/studio-dist/assets/index-CHLA4F7b.css +2 -0
- package/studio-dist/assets/index-DXGUfzm3.js +23 -0
- package/studio-dist/index.html +2 -2
- package/dist/accessibility-audit-YZOPUY3D.js.map +0 -1
- package/dist/app-RSDPDTKT.js +0 -10
- package/dist/chunk-3IZMPNE7.js.map +0 -1
- package/dist/chunk-4KK4E3N3.js.map +0 -1
- package/dist/chunk-54ASKII6.js +0 -183
- package/dist/chunk-54ASKII6.js.map +0 -1
- package/dist/chunk-64UZQP7Z.js.map +0 -1
- package/dist/chunk-6PTUVG6A.js.map +0 -1
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-FPQAJNE3.js.map +0 -1
- package/dist/chunk-FXBWACUT.js +0 -4378
- package/dist/chunk-FXBWACUT.js.map +0 -1
- package/dist/chunk-SGZMO456.js.map +0 -1
- package/dist/chunk-WS2TVNMY.js +0 -2494
- package/dist/chunk-WS2TVNMY.js.map +0 -1
- package/dist/chunk-X2TJP7LB.js.map +0 -1
- package/dist/chunk-XA6LWLZQ.js +0 -310
- package/dist/chunk-XA6LWLZQ.js.map +0 -1
- package/dist/chunk-Z6K4QQAR.js.map +0 -1
- package/dist/config-loader-CNGIW2XK.js +0 -9
- package/dist/console-DIYEJSSP.js.map +0 -1
- package/dist/discover-NKDMB4UI.js +0 -15
- package/dist/flow-DddAj1xv.d.ts +0 -1913
- package/dist/json-JMRPUVY2.js +0 -20
- package/dist/json-JMRPUVY2.js.map +0 -1
- package/dist/junit-CGB3LKHD.js.map +0 -1
- package/dist/screenshot-compare-POTXVUTL.js +0 -136
- package/dist/screenshot-compare-POTXVUTL.js.map +0 -1
- package/dist/server-JNQ2PLCC.js +0 -855
- package/dist/server-JNQ2PLCC.js.map +0 -1
- package/dist/session-5TNWVGQQ.js +0 -21
- package/dist/test-command-QGIJBRH7.js.map +0 -1
- package/studio-dist/assets/index-CBFsOh-9.js +0 -193
- package/studio-dist/assets/index-DH_18EyL.css +0 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collectDiagnosticSections
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NHT3XSX3.js";
|
|
4
4
|
import {
|
|
5
5
|
loadConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BUNMIMGA.js";
|
|
7
|
+
import {
|
|
8
|
+
collectWatchRoots
|
|
9
|
+
} from "./chunk-HUYC4OAL.js";
|
|
7
10
|
import {
|
|
8
11
|
classifyError,
|
|
9
12
|
createRemoteFlowClaimer,
|
|
@@ -17,12 +20,9 @@ import {
|
|
|
17
20
|
startSharedFlowQueueServer,
|
|
18
21
|
startWebServers,
|
|
19
22
|
writeWorkerProcessReport
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
detectProvider
|
|
24
|
-
} from "./chunk-X2TJP7LB.js";
|
|
25
|
-
import "./chunk-XA6LWLZQ.js";
|
|
23
|
+
} from "./chunk-5T7LSBDM.js";
|
|
24
|
+
import "./chunk-IDIHDVGC.js";
|
|
25
|
+
import "./chunk-U56N5JCJ.js";
|
|
26
26
|
import {
|
|
27
27
|
buildElectrobunRuntime,
|
|
28
28
|
buildElectronRuntime,
|
|
@@ -31,20 +31,8 @@ import {
|
|
|
31
31
|
buildWebRuntime,
|
|
32
32
|
buildWebRuntimePool,
|
|
33
33
|
speculativelyPrelaunchWebBrowser
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import {
|
|
37
|
-
deviceEffect,
|
|
38
|
-
parseAndroidHierarchy,
|
|
39
|
-
parseIOSHierarchy,
|
|
40
|
-
resolveNetworkConditions
|
|
41
|
-
} from "./chunk-FXBWACUT.js";
|
|
42
|
-
import "./chunk-WS2TVNMY.js";
|
|
43
|
-
import "./chunk-2AFWVHQK.js";
|
|
44
|
-
import "./chunk-WV3ALL3H.js";
|
|
45
|
-
import "./chunk-VP6V4XEJ.js";
|
|
46
|
-
import "./chunk-Z6K4QQAR.js";
|
|
47
|
-
import "./chunk-JPZCZHL4.js";
|
|
34
|
+
} from "./chunk-PPRNCRTS.js";
|
|
35
|
+
import "./chunk-HIGFQRWM.js";
|
|
48
36
|
import {
|
|
49
37
|
applyShard,
|
|
50
38
|
discoverFlows,
|
|
@@ -54,26 +42,34 @@ import {
|
|
|
54
42
|
getFlowSkip,
|
|
55
43
|
loadStepFiles,
|
|
56
44
|
loadTestSource
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import "./chunk-
|
|
45
|
+
} from "./chunk-PRQTAIYA.js";
|
|
46
|
+
import "./chunk-YFTHJRDO.js";
|
|
47
|
+
import "./chunk-7IUD55GY.js";
|
|
48
|
+
import "./chunk-FHCOPLYB.js";
|
|
49
|
+
import "./chunk-HNQLWFHL.js";
|
|
50
|
+
import "./chunk-7Q7TSUNL.js";
|
|
51
|
+
import "./chunk-MAKZK7GY.js";
|
|
52
|
+
import "./chunk-RHQJSPOS.js";
|
|
53
|
+
import "./chunk-MUMIMDRJ.js";
|
|
59
54
|
import {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
deviceStateToAppiumCapabilities
|
|
56
|
+
} from "./chunk-NWGA3R2E.js";
|
|
57
|
+
import "./chunk-VWJNINPX.js";
|
|
58
|
+
import "./chunk-A7Z52TDQ.js";
|
|
59
|
+
import "./chunk-6C2EILMC.js";
|
|
65
60
|
import {
|
|
66
|
-
|
|
67
|
-
} from "./chunk-
|
|
68
|
-
import "./chunk-DGUM43GV.js";
|
|
61
|
+
init_esm_shims
|
|
62
|
+
} from "./chunk-FTXUQMGH.js";
|
|
69
63
|
|
|
70
64
|
// src/cli/test-command.ts
|
|
71
|
-
|
|
65
|
+
init_esm_shims();
|
|
66
|
+
import { resolve as resolve2, dirname as dirname2 } from "path";
|
|
72
67
|
|
|
73
68
|
// src/core/orchestrator.ts
|
|
69
|
+
init_esm_shims();
|
|
74
70
|
async function sleep(ms) {
|
|
75
71
|
if (ms <= 0) return;
|
|
76
|
-
return new Promise((
|
|
72
|
+
return new Promise((resolve3) => setTimeout(resolve3, ms));
|
|
77
73
|
}
|
|
78
74
|
async function runPlatform(flows, platformConfig, options, shouldBail, noteFailure) {
|
|
79
75
|
const { platform, driver, engineConfig } = platformConfig;
|
|
@@ -97,9 +93,13 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
97
93
|
return { results };
|
|
98
94
|
}
|
|
99
95
|
const hooks = engineConfig.hooks;
|
|
100
|
-
|
|
96
|
+
const isChildWorkerProcess = process.env.SPANA_WORKER_PROCESS === "1";
|
|
97
|
+
const workerOffset = Number.parseInt(process.env.SPANA_WORKER_INDEX_OFFSET ?? "0", 10) || 0;
|
|
98
|
+
const workerIndex = engineConfig.workerIndex ?? workerOffset;
|
|
99
|
+
const parallelIndex = engineConfig.parallelIndex ?? 0;
|
|
100
|
+
if (hooks?.beforeAll && !isChildWorkerProcess) {
|
|
101
101
|
try {
|
|
102
|
-
await hooks.beforeAll({ app: void 0, platform });
|
|
102
|
+
await hooks.beforeAll({ app: void 0, platform, workerIndex, parallelIndex });
|
|
103
103
|
} catch (error) {
|
|
104
104
|
for (const flow of platformFlows) {
|
|
105
105
|
const result = getFlowSkip(flow, platform) ?? {
|
|
@@ -107,7 +107,8 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
107
107
|
platform,
|
|
108
108
|
status: "failed",
|
|
109
109
|
durationMs: 0,
|
|
110
|
-
error: classifyError(error instanceof Error ? error : new Error(String(error)))
|
|
110
|
+
error: classifyError(error instanceof Error ? error : new Error(String(error))),
|
|
111
|
+
...flow.config.tags ? { tags: flow.config.tags } : {}
|
|
111
112
|
};
|
|
112
113
|
results.push(result);
|
|
113
114
|
options?.onResult?.(result);
|
|
@@ -143,11 +144,13 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
143
144
|
if (result.status === "failed") noteFailure();
|
|
144
145
|
}
|
|
145
146
|
});
|
|
146
|
-
if (hooks?.afterAll) {
|
|
147
|
+
if (hooks?.afterAll && !isChildWorkerProcess) {
|
|
147
148
|
try {
|
|
148
149
|
await hooks.afterAll({
|
|
149
150
|
app: void 0,
|
|
150
151
|
platform,
|
|
152
|
+
workerIndex,
|
|
153
|
+
parallelIndex,
|
|
151
154
|
summary: { results: parallelResult.results }
|
|
152
155
|
});
|
|
153
156
|
} catch (hookError) {
|
|
@@ -158,7 +161,28 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
158
161
|
}
|
|
159
162
|
return { results: parallelResult.results, workerStats: parallelResult.workerStats };
|
|
160
163
|
}
|
|
164
|
+
const singleEngineConfig = {
|
|
165
|
+
...engineConfig,
|
|
166
|
+
workerIndex,
|
|
167
|
+
parallelIndex
|
|
168
|
+
};
|
|
169
|
+
const failedSerialGroups = /* @__PURE__ */ new Set();
|
|
161
170
|
const runSingleFlow = async (flow) => {
|
|
171
|
+
const sg = flow.config.serialGroup;
|
|
172
|
+
if (sg && failedSerialGroups.has(sg)) {
|
|
173
|
+
const skipped = {
|
|
174
|
+
name: flow.name,
|
|
175
|
+
platform,
|
|
176
|
+
status: "skipped",
|
|
177
|
+
skipReason: "Skipped because an earlier flow in this serial suite failed",
|
|
178
|
+
durationMs: 0,
|
|
179
|
+
...flow.config.tags ? { tags: flow.config.tags } : {},
|
|
180
|
+
...flow.config.annotations ? { annotations: flow.config.annotations } : {}
|
|
181
|
+
};
|
|
182
|
+
results.push(skipped);
|
|
183
|
+
options?.onResult?.(skipped);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
162
186
|
const skip = getFlowSkip(flow, platform);
|
|
163
187
|
if (skip) {
|
|
164
188
|
results.push(skip);
|
|
@@ -167,13 +191,13 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
167
191
|
}
|
|
168
192
|
const retries = flow.config.retries ?? options?.retries ?? 0;
|
|
169
193
|
options?.onFlowStart?.(flow.name, platform);
|
|
170
|
-
let result = await executeFlow(flow, driver,
|
|
194
|
+
let result = await executeFlow(flow, driver, singleEngineConfig);
|
|
171
195
|
let attempts = 1;
|
|
172
196
|
if (result.status === "failed" && retries > 0) {
|
|
173
197
|
for (let retry = 0; retry < retries; retry++) {
|
|
174
198
|
if (shouldBail()) break;
|
|
175
199
|
await sleep(retryDelay);
|
|
176
|
-
const retryResult = await executeFlow(flow, driver,
|
|
200
|
+
const retryResult = await executeFlow(flow, driver, singleEngineConfig);
|
|
177
201
|
attempts++;
|
|
178
202
|
if (retryResult.status === "passed") {
|
|
179
203
|
result = { ...retryResult, flaky: true, attempts };
|
|
@@ -188,6 +212,7 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
188
212
|
results.push(result);
|
|
189
213
|
options?.onResult?.(result);
|
|
190
214
|
if (result.status === "failed") {
|
|
215
|
+
if (sg) failedSerialGroups.add(sg);
|
|
191
216
|
noteFailure();
|
|
192
217
|
}
|
|
193
218
|
};
|
|
@@ -209,7 +234,8 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
209
234
|
name: skippedFlow.name,
|
|
210
235
|
platform,
|
|
211
236
|
status: "skipped",
|
|
212
|
-
durationMs: 0
|
|
237
|
+
durationMs: 0,
|
|
238
|
+
...skippedFlow.config.tags ? { tags: skippedFlow.config.tags } : {}
|
|
213
239
|
}
|
|
214
240
|
);
|
|
215
241
|
}
|
|
@@ -218,9 +244,15 @@ async function runPlatform(flows, platformConfig, options, shouldBail, noteFailu
|
|
|
218
244
|
await runSingleFlow(flow);
|
|
219
245
|
}
|
|
220
246
|
}
|
|
221
|
-
if (hooks?.afterAll) {
|
|
247
|
+
if (hooks?.afterAll && !isChildWorkerProcess) {
|
|
222
248
|
try {
|
|
223
|
-
await hooks.afterAll({
|
|
249
|
+
await hooks.afterAll({
|
|
250
|
+
app: void 0,
|
|
251
|
+
platform,
|
|
252
|
+
workerIndex,
|
|
253
|
+
parallelIndex,
|
|
254
|
+
summary: { results }
|
|
255
|
+
});
|
|
224
256
|
} catch (hookError) {
|
|
225
257
|
console.warn(
|
|
226
258
|
`afterAll hook failed: ${hookError instanceof Error ? hookError.message : hookError}`
|
|
@@ -280,6 +312,7 @@ async function orchestrate(flows, platforms, options) {
|
|
|
280
312
|
}
|
|
281
313
|
|
|
282
314
|
// src/runtime/capabilities.ts
|
|
315
|
+
init_esm_shims();
|
|
283
316
|
import { readFile } from "fs/promises";
|
|
284
317
|
async function resolveCapabilities(config, opts) {
|
|
285
318
|
const configCaps = config.capabilities ?? {};
|
|
@@ -303,902 +336,8 @@ async function resolveCapabilities(config, opts) {
|
|
|
303
336
|
return { ...launchDeviceCaps, ...configCaps, ...platformCaps, ...fileCaps, ...cliCaps };
|
|
304
337
|
}
|
|
305
338
|
|
|
306
|
-
// src/runtime/appium.ts
|
|
307
|
-
import { Effect as Effect3 } from "effect";
|
|
308
|
-
|
|
309
|
-
// src/drivers/appium/client.ts
|
|
310
|
-
var AppiumClient = class {
|
|
311
|
-
baseUrl;
|
|
312
|
-
authHeader = null;
|
|
313
|
-
sessionId = null;
|
|
314
|
-
sessionCaps = {};
|
|
315
|
-
constructor(serverUrl) {
|
|
316
|
-
const parsed = new URL(serverUrl);
|
|
317
|
-
if (parsed.username || parsed.password) {
|
|
318
|
-
const username = decodeURIComponent(parsed.username);
|
|
319
|
-
const password = decodeURIComponent(parsed.password);
|
|
320
|
-
this.authHeader = `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`;
|
|
321
|
-
parsed.username = "";
|
|
322
|
-
parsed.password = "";
|
|
323
|
-
}
|
|
324
|
-
this.baseUrl = parsed.toString().replace(/\/+$/, "");
|
|
325
|
-
}
|
|
326
|
-
createHeaders() {
|
|
327
|
-
return {
|
|
328
|
-
"Content-Type": "application/json",
|
|
329
|
-
...this.authHeader ? { Authorization: this.authHeader } : {}
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
// ---------------------------------------------------------------------------
|
|
333
|
-
// HTTP helpers
|
|
334
|
-
// ---------------------------------------------------------------------------
|
|
335
|
-
async request(method, path, body) {
|
|
336
|
-
const url = `${this.baseUrl}${path}`;
|
|
337
|
-
const init = {
|
|
338
|
-
method,
|
|
339
|
-
headers: this.createHeaders()
|
|
340
|
-
};
|
|
341
|
-
if (body !== void 0) {
|
|
342
|
-
init.body = JSON.stringify(body);
|
|
343
|
-
}
|
|
344
|
-
const res = await fetch(url, init);
|
|
345
|
-
const text = await res.text();
|
|
346
|
-
let parsed;
|
|
347
|
-
try {
|
|
348
|
-
parsed = JSON.parse(text);
|
|
349
|
-
} catch {
|
|
350
|
-
throw new Error(`Appium: failed to parse response: ${text}`);
|
|
351
|
-
}
|
|
352
|
-
if (!res.ok) {
|
|
353
|
-
const val = parsed.value;
|
|
354
|
-
const msg = val?.message ?? val?.error ?? text;
|
|
355
|
-
throw new Error(`Appium ${method} ${path} -> ${res.status}: ${msg}`);
|
|
356
|
-
}
|
|
357
|
-
if (parsed.value !== null && typeof parsed.value === "object" && "error" in parsed.value) {
|
|
358
|
-
const val = parsed.value;
|
|
359
|
-
throw new Error(`Appium error: ${val.message ?? val.error}`);
|
|
360
|
-
}
|
|
361
|
-
return parsed.value;
|
|
362
|
-
}
|
|
363
|
-
sessionPath(suffix) {
|
|
364
|
-
if (this.sessionId === null) {
|
|
365
|
-
throw new Error("Appium: no active session");
|
|
366
|
-
}
|
|
367
|
-
return `/session/${this.sessionId}${suffix}`;
|
|
368
|
-
}
|
|
369
|
-
// ---------------------------------------------------------------------------
|
|
370
|
-
// Session management
|
|
371
|
-
// ---------------------------------------------------------------------------
|
|
372
|
-
async createSession(capabilities) {
|
|
373
|
-
const body = {
|
|
374
|
-
capabilities: {
|
|
375
|
-
alwaysMatch: capabilities
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
const res = await fetch(`${this.baseUrl}/session`, {
|
|
379
|
-
method: "POST",
|
|
380
|
-
headers: this.createHeaders(),
|
|
381
|
-
body: JSON.stringify(body)
|
|
382
|
-
});
|
|
383
|
-
const text = await res.text();
|
|
384
|
-
let parsed;
|
|
385
|
-
try {
|
|
386
|
-
parsed = JSON.parse(text);
|
|
387
|
-
} catch {
|
|
388
|
-
throw new Error(`Appium: failed to parse session response: ${text}`);
|
|
389
|
-
}
|
|
390
|
-
if (!res.ok) {
|
|
391
|
-
const val = parsed["value"];
|
|
392
|
-
throw new Error(`Appium: failed to create session: ${val?.message ?? text}`);
|
|
393
|
-
}
|
|
394
|
-
const value = parsed["value"];
|
|
395
|
-
const sessionId = value?.["sessionId"] ?? parsed["sessionId"];
|
|
396
|
-
if (!sessionId) {
|
|
397
|
-
throw new Error(`Appium: no sessionId in session response: ${text}`);
|
|
398
|
-
}
|
|
399
|
-
this.sessionId = sessionId;
|
|
400
|
-
this.sessionCaps = value?.["capabilities"] ?? {};
|
|
401
|
-
return sessionId;
|
|
402
|
-
}
|
|
403
|
-
async deleteSession() {
|
|
404
|
-
if (this.sessionId === null) return;
|
|
405
|
-
const path = `/session/${this.sessionId}`;
|
|
406
|
-
this.sessionId = null;
|
|
407
|
-
this.sessionCaps = {};
|
|
408
|
-
await fetch(`${this.baseUrl}${path}`, { method: "DELETE", headers: this.createHeaders() });
|
|
409
|
-
}
|
|
410
|
-
getSessionId() {
|
|
411
|
-
return this.sessionId;
|
|
412
|
-
}
|
|
413
|
-
getSessionCaps() {
|
|
414
|
-
return this.sessionCaps;
|
|
415
|
-
}
|
|
416
|
-
// ---------------------------------------------------------------------------
|
|
417
|
-
// WebView / hybrid context switching
|
|
418
|
-
// ---------------------------------------------------------------------------
|
|
419
|
-
async getContexts() {
|
|
420
|
-
return this.request("GET", this.sessionPath("/contexts"));
|
|
421
|
-
}
|
|
422
|
-
async getCurrentContext() {
|
|
423
|
-
return this.request("GET", this.sessionPath("/context"));
|
|
424
|
-
}
|
|
425
|
-
async setContext(contextId) {
|
|
426
|
-
await this.request("POST", this.sessionPath("/context"), { name: contextId });
|
|
427
|
-
}
|
|
428
|
-
// ---------------------------------------------------------------------------
|
|
429
|
-
// Scripting (execute in current context — works in WebView contexts)
|
|
430
|
-
// ---------------------------------------------------------------------------
|
|
431
|
-
async executeScript(script, args = []) {
|
|
432
|
-
return this.request("POST", this.sessionPath("/execute/sync"), { script, args });
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
// src/drivers/appium/android.ts
|
|
437
|
-
import { Effect } from "effect";
|
|
438
|
-
|
|
439
|
-
// src/drivers/appium/window-size.ts
|
|
440
|
-
async function getAppiumWindowSize(client) {
|
|
441
|
-
try {
|
|
442
|
-
return await client.request("GET", client.sessionPath("/window/size"));
|
|
443
|
-
} catch (error) {
|
|
444
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
445
|
-
if (!message.includes("/window/size") || !message.includes("-> 404:")) {
|
|
446
|
-
throw error;
|
|
447
|
-
}
|
|
448
|
-
const rect = await client.request("GET", client.sessionPath("/window/rect"));
|
|
449
|
-
return { width: rect.width, height: rect.height };
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
// src/drivers/appium/android.ts
|
|
454
|
-
function createAppiumAndroidDriver(client, defaultBundleId) {
|
|
455
|
-
const mobile = async (command, params) => {
|
|
456
|
-
await client.request("POST", client.sessionPath("/execute/sync"), {
|
|
457
|
-
script: `mobile: ${command}`,
|
|
458
|
-
args: [params]
|
|
459
|
-
});
|
|
460
|
-
};
|
|
461
|
-
const service = {
|
|
462
|
-
setGeolocation: (point) => deviceEffect("setGeolocation", () => mobile("setGeolocation", { ...point })),
|
|
463
|
-
setPermission: (appPackage, permission, state) => deviceEffect(
|
|
464
|
-
"setPermission",
|
|
465
|
-
() => mobile("changePermissions", {
|
|
466
|
-
appPackage,
|
|
467
|
-
permissions: [permission],
|
|
468
|
-
action: state === "grant" ? "grant" : "revoke",
|
|
469
|
-
target: "pm"
|
|
470
|
-
})
|
|
471
|
-
),
|
|
472
|
-
simulateBiometric: (options) => deviceEffect("simulateBiometric", () => {
|
|
473
|
-
if (options.type !== "fingerprint")
|
|
474
|
-
throw new Error("Only fingerprint simulation is supported on Android");
|
|
475
|
-
return mobile("fingerprint", { fingerprintId: options.fingerId });
|
|
476
|
-
}),
|
|
477
|
-
setOrientation: (orientation) => deviceEffect("setOrientation", async () => {
|
|
478
|
-
await client.request("POST", client.sessionPath("/orientation"), {
|
|
479
|
-
orientation: orientation.toUpperCase()
|
|
480
|
-
});
|
|
481
|
-
}),
|
|
482
|
-
// -----------------------------------------------------------------------
|
|
483
|
-
// Hierarchy
|
|
484
|
-
// -----------------------------------------------------------------------
|
|
485
|
-
dumpHierarchy: () => Effect.tryPromise({
|
|
486
|
-
try: () => client.request("GET", client.sessionPath("/source")),
|
|
487
|
-
catch: (e) => new DriverError({ message: `Failed to get page source: ${e}` })
|
|
488
|
-
}),
|
|
489
|
-
// -----------------------------------------------------------------------
|
|
490
|
-
// Coordinate-level actions
|
|
491
|
-
// -----------------------------------------------------------------------
|
|
492
|
-
tapAtCoordinate: (x, y) => Effect.tryPromise({
|
|
493
|
-
try: () => client.request("POST", client.sessionPath("/actions"), {
|
|
494
|
-
actions: [
|
|
495
|
-
{
|
|
496
|
-
type: "pointer",
|
|
497
|
-
id: "finger1",
|
|
498
|
-
parameters: { pointerType: "touch" },
|
|
499
|
-
actions: [
|
|
500
|
-
{ type: "pointerMove", duration: 0, x, y },
|
|
501
|
-
{ type: "pointerDown", button: 0 },
|
|
502
|
-
{ type: "pointerUp", button: 0 }
|
|
503
|
-
]
|
|
504
|
-
}
|
|
505
|
-
]
|
|
506
|
-
}),
|
|
507
|
-
catch: (e) => new DriverError({ message: `Tap failed: ${e}` })
|
|
508
|
-
}),
|
|
509
|
-
doubleTapAtCoordinate: (x, y) => Effect.tryPromise({
|
|
510
|
-
try: async () => {
|
|
511
|
-
const tapSequence = [
|
|
512
|
-
{
|
|
513
|
-
type: "pointer",
|
|
514
|
-
id: "finger1",
|
|
515
|
-
parameters: { pointerType: "touch" },
|
|
516
|
-
actions: [
|
|
517
|
-
{ type: "pointerMove", duration: 0, x, y },
|
|
518
|
-
{ type: "pointerDown", button: 0 },
|
|
519
|
-
{ type: "pointerUp", button: 0 }
|
|
520
|
-
]
|
|
521
|
-
}
|
|
522
|
-
];
|
|
523
|
-
await client.request("POST", client.sessionPath("/actions"), { actions: tapSequence });
|
|
524
|
-
await new Promise((resolve4) => setTimeout(resolve4, 100));
|
|
525
|
-
await client.request("POST", client.sessionPath("/actions"), { actions: tapSequence });
|
|
526
|
-
},
|
|
527
|
-
catch: (e) => new DriverError({ message: `Double tap failed: ${e}` })
|
|
528
|
-
}),
|
|
529
|
-
longPressAtCoordinate: (x, y, duration) => Effect.tryPromise({
|
|
530
|
-
try: () => client.request("POST", client.sessionPath("/actions"), {
|
|
531
|
-
actions: [
|
|
532
|
-
{
|
|
533
|
-
type: "pointer",
|
|
534
|
-
id: "finger1",
|
|
535
|
-
parameters: { pointerType: "touch" },
|
|
536
|
-
actions: [
|
|
537
|
-
{ type: "pointerMove", duration: 0, x, y },
|
|
538
|
-
{ type: "pointerDown", button: 0 },
|
|
539
|
-
{ type: "pause", duration },
|
|
540
|
-
{ type: "pointerUp", button: 0 }
|
|
541
|
-
]
|
|
542
|
-
}
|
|
543
|
-
]
|
|
544
|
-
}),
|
|
545
|
-
catch: (e) => new DriverError({ message: `Long press failed: ${e}` })
|
|
546
|
-
}),
|
|
547
|
-
swipe: (sx, sy, ex, ey, dur) => Effect.tryPromise({
|
|
548
|
-
try: () => client.request("POST", client.sessionPath("/actions"), {
|
|
549
|
-
actions: [
|
|
550
|
-
{
|
|
551
|
-
type: "pointer",
|
|
552
|
-
id: "finger1",
|
|
553
|
-
parameters: { pointerType: "touch" },
|
|
554
|
-
actions: [
|
|
555
|
-
{ type: "pointerMove", duration: 0, x: sx, y: sy },
|
|
556
|
-
{ type: "pointerDown", button: 0 },
|
|
557
|
-
{ type: "pointerMove", duration: dur, x: ex, y: ey },
|
|
558
|
-
{ type: "pointerUp", button: 0 }
|
|
559
|
-
]
|
|
560
|
-
}
|
|
561
|
-
]
|
|
562
|
-
}),
|
|
563
|
-
catch: (e) => new DriverError({ message: `Swipe failed: ${e}` })
|
|
564
|
-
}),
|
|
565
|
-
// -----------------------------------------------------------------------
|
|
566
|
-
// Text input
|
|
567
|
-
// -----------------------------------------------------------------------
|
|
568
|
-
inputText: (text) => Effect.tryPromise({
|
|
569
|
-
try: () => {
|
|
570
|
-
const keyActions = [];
|
|
571
|
-
for (const segment of splitGraphemes(text)) {
|
|
572
|
-
keyActions.push({ type: "keyDown", value: segment });
|
|
573
|
-
keyActions.push({ type: "keyUp", value: segment });
|
|
574
|
-
}
|
|
575
|
-
return client.request("POST", client.sessionPath("/actions"), {
|
|
576
|
-
actions: [
|
|
577
|
-
{
|
|
578
|
-
type: "key",
|
|
579
|
-
id: "keyboard",
|
|
580
|
-
actions: keyActions
|
|
581
|
-
}
|
|
582
|
-
]
|
|
583
|
-
});
|
|
584
|
-
},
|
|
585
|
-
catch: (e) => new DriverError({ message: `Input text failed: ${e}` })
|
|
586
|
-
}),
|
|
587
|
-
pressKey: (key) => Effect.tryPromise({
|
|
588
|
-
try: () => client.request("POST", client.sessionPath("/appium/device/press_keycode"), {
|
|
589
|
-
keycode: parseInt(key, 10) || 0
|
|
590
|
-
}),
|
|
591
|
-
catch: (e) => new DriverError({ message: `Press key failed: ${e}` })
|
|
592
|
-
}),
|
|
593
|
-
hideKeyboard: () => Effect.tryPromise({
|
|
594
|
-
try: () => client.request("POST", client.sessionPath("/appium/device/hide_keyboard")),
|
|
595
|
-
catch: (e) => new DriverError({ message: `Hide keyboard failed: ${e}` })
|
|
596
|
-
}),
|
|
597
|
-
// -----------------------------------------------------------------------
|
|
598
|
-
// Queries
|
|
599
|
-
// -----------------------------------------------------------------------
|
|
600
|
-
takeScreenshot: () => Effect.tryPromise({
|
|
601
|
-
try: async () => {
|
|
602
|
-
const base64 = await client.request("GET", client.sessionPath("/screenshot"));
|
|
603
|
-
return Uint8Array.from(atob(base64), (c) => c.charCodeAt(0));
|
|
604
|
-
},
|
|
605
|
-
catch: (e) => new DriverError({ message: `Screenshot failed: ${e}` })
|
|
606
|
-
}),
|
|
607
|
-
getDeviceInfo: () => Effect.tryPromise({
|
|
608
|
-
try: async () => {
|
|
609
|
-
const size = await getAppiumWindowSize(client);
|
|
610
|
-
const caps = client.getSessionCaps();
|
|
611
|
-
return {
|
|
612
|
-
platform: "android",
|
|
613
|
-
deviceId: client.getSessionId() ?? "appium",
|
|
614
|
-
name: caps["deviceName"] ?? "Android Device (Appium)",
|
|
615
|
-
isEmulator: false,
|
|
616
|
-
screenWidth: size.width,
|
|
617
|
-
screenHeight: size.height,
|
|
618
|
-
driverType: "appium"
|
|
619
|
-
};
|
|
620
|
-
},
|
|
621
|
-
catch: (e) => new DriverError({ message: `Get device info failed: ${e}` })
|
|
622
|
-
}),
|
|
623
|
-
// -----------------------------------------------------------------------
|
|
624
|
-
// App lifecycle
|
|
625
|
-
// -----------------------------------------------------------------------
|
|
626
|
-
launchApp: (bundleId, opts) => Effect.tryPromise({
|
|
627
|
-
try: async () => {
|
|
628
|
-
if (opts?.clearState) {
|
|
629
|
-
try {
|
|
630
|
-
await client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
631
|
-
appId: bundleId
|
|
632
|
-
});
|
|
633
|
-
} catch {
|
|
634
|
-
}
|
|
635
|
-
await client.executeScript("mobile: clearApp", [{ appId: bundleId }]);
|
|
636
|
-
}
|
|
637
|
-
if (opts?.clearKeychain) {
|
|
638
|
-
console.warn("clearKeychain is not supported on Android, skipping.");
|
|
639
|
-
}
|
|
640
|
-
if (opts?.launchArguments && Object.keys(opts.launchArguments).length > 0) {
|
|
641
|
-
throw new DriverError({
|
|
642
|
-
message: "launchArguments are not supported in Appium Android mode. Remove launchArguments from your config or use local mode."
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
if (hasLaunchDeviceState(opts?.deviceState)) {
|
|
646
|
-
console.warn(
|
|
647
|
-
"deviceState launch overrides are not supported during Appium Android relaunches. Set launchOptions.deviceState in config to apply Android language/locale/timeZone at session start."
|
|
648
|
-
);
|
|
649
|
-
}
|
|
650
|
-
if (opts?.deepLink) {
|
|
651
|
-
await client.executeScript("mobile: deepLink", [
|
|
652
|
-
{ url: opts.deepLink, package: bundleId }
|
|
653
|
-
]);
|
|
654
|
-
} else {
|
|
655
|
-
await client.request("POST", client.sessionPath("/appium/device/activate_app"), {
|
|
656
|
-
appId: bundleId
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
},
|
|
660
|
-
catch: (e) => new DriverError({ message: `Launch app failed: ${e}` })
|
|
661
|
-
}),
|
|
662
|
-
stopApp: (bundleId) => Effect.tryPromise({
|
|
663
|
-
try: () => client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
664
|
-
appId: bundleId
|
|
665
|
-
}),
|
|
666
|
-
catch: (e) => new DriverError({ message: `Stop app failed: ${e}` })
|
|
667
|
-
}),
|
|
668
|
-
killApp: (bundleId) => Effect.tryPromise({
|
|
669
|
-
try: () => client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
670
|
-
appId: bundleId
|
|
671
|
-
}),
|
|
672
|
-
catch: (e) => new DriverError({ message: `Kill app failed: ${e}` })
|
|
673
|
-
}),
|
|
674
|
-
clearAppState: (bundleId) => Effect.tryPromise({
|
|
675
|
-
try: async () => {
|
|
676
|
-
try {
|
|
677
|
-
await client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
678
|
-
appId: bundleId
|
|
679
|
-
});
|
|
680
|
-
} catch {
|
|
681
|
-
}
|
|
682
|
-
await client.executeScript("mobile: clearApp", [{ appId: bundleId }]);
|
|
683
|
-
},
|
|
684
|
-
catch: (e) => new DriverError({ message: `Clear app state failed: ${e}` })
|
|
685
|
-
}),
|
|
686
|
-
// -----------------------------------------------------------------------
|
|
687
|
-
// Navigation
|
|
688
|
-
// -----------------------------------------------------------------------
|
|
689
|
-
openLink: (url) => Effect.tryPromise({
|
|
690
|
-
try: () => {
|
|
691
|
-
const args = { url };
|
|
692
|
-
if (defaultBundleId) args.package = defaultBundleId;
|
|
693
|
-
return client.executeScript("mobile: deepLink", [args]);
|
|
694
|
-
},
|
|
695
|
-
catch: (e) => new DriverError({ message: `Open link failed: ${e}` })
|
|
696
|
-
}),
|
|
697
|
-
back: () => Effect.tryPromise({
|
|
698
|
-
try: () => client.request("POST", client.sessionPath("/back")),
|
|
699
|
-
catch: (e) => new DriverError({ message: `Back failed: ${e}` })
|
|
700
|
-
}),
|
|
701
|
-
// -----------------------------------------------------------------------
|
|
702
|
-
// Scripting (works when switched to a WebView context)
|
|
703
|
-
// -----------------------------------------------------------------------
|
|
704
|
-
evaluate: (script, ...args) => Effect.tryPromise({
|
|
705
|
-
try: () => client.executeScript(
|
|
706
|
-
typeof script === "function" ? `return (${script})(...arguments)` : script,
|
|
707
|
-
args
|
|
708
|
-
),
|
|
709
|
-
catch: (e) => new DriverError({ message: `evaluate() failed: ${e}` })
|
|
710
|
-
}),
|
|
711
|
-
// -----------------------------------------------------------------------
|
|
712
|
-
// WebView / hybrid context switching
|
|
713
|
-
// -----------------------------------------------------------------------
|
|
714
|
-
getContexts: () => Effect.tryPromise({
|
|
715
|
-
try: () => client.getContexts(),
|
|
716
|
-
catch: (e) => new DriverError({ message: `getContexts failed: ${e}` })
|
|
717
|
-
}),
|
|
718
|
-
getCurrentContext: () => Effect.tryPromise({
|
|
719
|
-
try: () => client.getCurrentContext(),
|
|
720
|
-
catch: (e) => new DriverError({ message: `getCurrentContext failed: ${e}` })
|
|
721
|
-
}),
|
|
722
|
-
setContext: (contextId) => Effect.tryPromise({
|
|
723
|
-
try: () => client.setContext(contextId),
|
|
724
|
-
catch: (e) => new DriverError({ message: `setContext failed: ${e}` })
|
|
725
|
-
}),
|
|
726
|
-
// -----------------------------------------------------------------------
|
|
727
|
-
// Network conditions
|
|
728
|
-
// -----------------------------------------------------------------------
|
|
729
|
-
setNetworkConditions: (conditions) => Effect.tryPromise({
|
|
730
|
-
try: () => {
|
|
731
|
-
const resolved = resolveNetworkConditions(conditions);
|
|
732
|
-
const hasAnyValue = conditions.profile !== void 0 || conditions.offline !== void 0 || conditions.latencyMs !== void 0 || conditions.downloadThroughputKbps !== void 0 || conditions.uploadThroughputKbps !== void 0;
|
|
733
|
-
if (!hasAnyValue) {
|
|
734
|
-
return client.executeScript("mobile: setConnectivity", [
|
|
735
|
-
{ wifi: true, data: true, airplaneMode: false }
|
|
736
|
-
]);
|
|
737
|
-
}
|
|
738
|
-
if (resolved.offline) {
|
|
739
|
-
return client.executeScript("mobile: setConnectivity", [
|
|
740
|
-
{ wifi: false, data: false, airplaneMode: true }
|
|
741
|
-
]);
|
|
742
|
-
}
|
|
743
|
-
return client.executeScript("mobile: setConnectivity", [
|
|
744
|
-
{ wifi: true, data: true, airplaneMode: false }
|
|
745
|
-
]);
|
|
746
|
-
},
|
|
747
|
-
catch: (e) => new DriverError({ message: `setNetworkConditions failed: ${e}` })
|
|
748
|
-
})
|
|
749
|
-
};
|
|
750
|
-
return Effect.succeed(service);
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
// src/drivers/appium/ios.ts
|
|
754
|
-
import { Effect as Effect2 } from "effect";
|
|
755
|
-
function createAppiumIOSDriver(client) {
|
|
756
|
-
const mobile = async (command, params) => {
|
|
757
|
-
await client.request("POST", client.sessionPath("/execute/sync"), {
|
|
758
|
-
script: `mobile: ${command}`,
|
|
759
|
-
args: [params]
|
|
760
|
-
});
|
|
761
|
-
};
|
|
762
|
-
const service = {
|
|
763
|
-
setOrientation: (orientation) => deviceEffect("setOrientation", async () => {
|
|
764
|
-
await client.request("POST", client.sessionPath("/orientation"), {
|
|
765
|
-
orientation: orientation.toUpperCase()
|
|
766
|
-
});
|
|
767
|
-
}),
|
|
768
|
-
setGeolocation: ({ latitude, longitude }) => deviceEffect("setGeolocation", () => mobile("setSimulatedLocation", { latitude, longitude })),
|
|
769
|
-
setPermission: (bundleId, permission, state) => deviceEffect(
|
|
770
|
-
"setPermission",
|
|
771
|
-
() => mobile("setPermission", {
|
|
772
|
-
bundleId,
|
|
773
|
-
access: { [permission]: state === "grant" ? "yes" : "no" }
|
|
774
|
-
})
|
|
775
|
-
),
|
|
776
|
-
setBiometricEnrollment: (isEnabled) => deviceEffect("setBiometricEnrollment", () => mobile("enrollBiometric", { isEnabled })),
|
|
777
|
-
simulateBiometric: (options) => deviceEffect("simulateBiometric", () => {
|
|
778
|
-
if (options.type === "fingerprint") throw new Error("Use touchId or faceId on iOS");
|
|
779
|
-
return mobile("sendBiometricMatch", { type: options.type, match: options.match ?? true });
|
|
780
|
-
}),
|
|
781
|
-
sendPushNotification: (bundleId, payload) => deviceEffect("sendPushNotification", () => mobile("pushNotification", { bundleId, payload })),
|
|
782
|
-
// -----------------------------------------------------------------------
|
|
783
|
-
// Hierarchy
|
|
784
|
-
// -----------------------------------------------------------------------
|
|
785
|
-
dumpHierarchy: () => Effect2.tryPromise({
|
|
786
|
-
try: () => client.request("GET", client.sessionPath("/source")),
|
|
787
|
-
catch: (e) => new DriverError({ message: `Failed to get page source: ${e}` })
|
|
788
|
-
}),
|
|
789
|
-
// -----------------------------------------------------------------------
|
|
790
|
-
// Coordinate-level actions (W3C touch pointer actions for iOS)
|
|
791
|
-
// -----------------------------------------------------------------------
|
|
792
|
-
tapAtCoordinate: (x, y) => Effect2.tryPromise({
|
|
793
|
-
try: () => client.request("POST", client.sessionPath("/actions"), {
|
|
794
|
-
actions: [
|
|
795
|
-
{
|
|
796
|
-
type: "pointer",
|
|
797
|
-
id: "finger1",
|
|
798
|
-
parameters: { pointerType: "touch" },
|
|
799
|
-
actions: [
|
|
800
|
-
{ type: "pointerMove", duration: 0, x, y },
|
|
801
|
-
{ type: "pointerDown", button: 0 },
|
|
802
|
-
{ type: "pointerUp", button: 0 }
|
|
803
|
-
]
|
|
804
|
-
}
|
|
805
|
-
]
|
|
806
|
-
}),
|
|
807
|
-
catch: (e) => new DriverError({ message: `Tap failed: ${e}` })
|
|
808
|
-
}),
|
|
809
|
-
doubleTapAtCoordinate: (x, y) => Effect2.tryPromise({
|
|
810
|
-
try: () => client.request("POST", client.sessionPath("/actions"), {
|
|
811
|
-
actions: [
|
|
812
|
-
{
|
|
813
|
-
type: "pointer",
|
|
814
|
-
id: "finger1",
|
|
815
|
-
parameters: { pointerType: "touch" },
|
|
816
|
-
actions: [
|
|
817
|
-
{ type: "pointerMove", duration: 0, x, y },
|
|
818
|
-
{ type: "pointerDown", button: 0 },
|
|
819
|
-
{ type: "pointerUp", button: 0 },
|
|
820
|
-
{ type: "pause", duration: 40 },
|
|
821
|
-
{ type: "pointerDown", button: 0 },
|
|
822
|
-
{ type: "pointerUp", button: 0 }
|
|
823
|
-
]
|
|
824
|
-
}
|
|
825
|
-
]
|
|
826
|
-
}),
|
|
827
|
-
catch: (e) => new DriverError({ message: `Double tap failed: ${e}` })
|
|
828
|
-
}),
|
|
829
|
-
longPressAtCoordinate: (x, y, duration) => Effect2.tryPromise({
|
|
830
|
-
try: () => client.request("POST", client.sessionPath("/actions"), {
|
|
831
|
-
actions: [
|
|
832
|
-
{
|
|
833
|
-
type: "pointer",
|
|
834
|
-
id: "finger1",
|
|
835
|
-
parameters: { pointerType: "touch" },
|
|
836
|
-
actions: [
|
|
837
|
-
{ type: "pointerMove", duration: 0, x, y },
|
|
838
|
-
{ type: "pointerDown", button: 0 },
|
|
839
|
-
{ type: "pause", duration },
|
|
840
|
-
{ type: "pointerUp", button: 0 }
|
|
841
|
-
]
|
|
842
|
-
}
|
|
843
|
-
]
|
|
844
|
-
}),
|
|
845
|
-
catch: (e) => new DriverError({ message: `Long press failed: ${e}` })
|
|
846
|
-
}),
|
|
847
|
-
swipe: (sx, sy, ex, ey, dur) => Effect2.tryPromise({
|
|
848
|
-
try: () => client.request("POST", client.sessionPath("/actions"), {
|
|
849
|
-
actions: [
|
|
850
|
-
{
|
|
851
|
-
type: "pointer",
|
|
852
|
-
id: "finger1",
|
|
853
|
-
parameters: { pointerType: "touch" },
|
|
854
|
-
actions: [
|
|
855
|
-
{ type: "pointerMove", duration: 0, x: sx, y: sy },
|
|
856
|
-
{ type: "pointerDown", button: 0 },
|
|
857
|
-
{ type: "pointerMove", duration: dur, x: ex, y: ey },
|
|
858
|
-
{ type: "pointerUp", button: 0 }
|
|
859
|
-
]
|
|
860
|
-
}
|
|
861
|
-
]
|
|
862
|
-
}),
|
|
863
|
-
catch: (e) => new DriverError({ message: `Swipe failed: ${e}` })
|
|
864
|
-
}),
|
|
865
|
-
// -----------------------------------------------------------------------
|
|
866
|
-
// Text input
|
|
867
|
-
// -----------------------------------------------------------------------
|
|
868
|
-
inputText: (text) => Effect2.tryPromise({
|
|
869
|
-
try: () => {
|
|
870
|
-
const keyActions = [];
|
|
871
|
-
for (const segment of splitGraphemes(text)) {
|
|
872
|
-
keyActions.push({ type: "keyDown", value: segment });
|
|
873
|
-
keyActions.push({ type: "keyUp", value: segment });
|
|
874
|
-
}
|
|
875
|
-
return client.request("POST", client.sessionPath("/actions"), {
|
|
876
|
-
actions: [
|
|
877
|
-
{
|
|
878
|
-
type: "key",
|
|
879
|
-
id: "keyboard",
|
|
880
|
-
actions: keyActions
|
|
881
|
-
}
|
|
882
|
-
]
|
|
883
|
-
});
|
|
884
|
-
},
|
|
885
|
-
catch: (e) => new DriverError({ message: `Input text failed: ${e}` })
|
|
886
|
-
}),
|
|
887
|
-
pressKey: (key) => Effect2.tryPromise({
|
|
888
|
-
try: () => client.request("POST", client.sessionPath("/actions"), {
|
|
889
|
-
actions: [
|
|
890
|
-
{
|
|
891
|
-
type: "key",
|
|
892
|
-
id: "keyboard",
|
|
893
|
-
actions: [
|
|
894
|
-
{ type: "keyDown", value: key },
|
|
895
|
-
{ type: "keyUp", value: key }
|
|
896
|
-
]
|
|
897
|
-
}
|
|
898
|
-
]
|
|
899
|
-
}),
|
|
900
|
-
catch: (e) => new DriverError({ message: `Press key failed: ${e}` })
|
|
901
|
-
}),
|
|
902
|
-
hideKeyboard: () => Effect2.tryPromise({
|
|
903
|
-
try: () => client.request("POST", client.sessionPath("/appium/device/hide_keyboard")),
|
|
904
|
-
catch: (e) => new DriverError({ message: `Hide keyboard failed: ${e}` })
|
|
905
|
-
}),
|
|
906
|
-
// -----------------------------------------------------------------------
|
|
907
|
-
// Queries
|
|
908
|
-
// -----------------------------------------------------------------------
|
|
909
|
-
takeScreenshot: () => Effect2.tryPromise({
|
|
910
|
-
try: async () => {
|
|
911
|
-
const base64 = await client.request("GET", client.sessionPath("/screenshot"));
|
|
912
|
-
return Uint8Array.from(atob(base64), (c) => c.charCodeAt(0));
|
|
913
|
-
},
|
|
914
|
-
catch: (e) => new DriverError({ message: `Screenshot failed: ${e}` })
|
|
915
|
-
}),
|
|
916
|
-
getDeviceInfo: () => Effect2.tryPromise({
|
|
917
|
-
try: async () => {
|
|
918
|
-
const size = await getAppiumWindowSize(client);
|
|
919
|
-
const caps = client.getSessionCaps();
|
|
920
|
-
return {
|
|
921
|
-
platform: "ios",
|
|
922
|
-
deviceId: client.getSessionId() ?? "appium",
|
|
923
|
-
name: caps["deviceName"] ?? "iOS Device (Appium)",
|
|
924
|
-
isEmulator: false,
|
|
925
|
-
screenWidth: size.width,
|
|
926
|
-
screenHeight: size.height,
|
|
927
|
-
driverType: "appium"
|
|
928
|
-
};
|
|
929
|
-
},
|
|
930
|
-
catch: (e) => new DriverError({ message: `Get device info failed: ${e}` })
|
|
931
|
-
}),
|
|
932
|
-
// -----------------------------------------------------------------------
|
|
933
|
-
// App lifecycle
|
|
934
|
-
// -----------------------------------------------------------------------
|
|
935
|
-
launchApp: (bundleId, opts) => Effect2.tryPromise({
|
|
936
|
-
try: async () => {
|
|
937
|
-
const launchConfig = buildIOSLaunchConfiguration(opts);
|
|
938
|
-
if (opts?.clearState) {
|
|
939
|
-
try {
|
|
940
|
-
await client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
941
|
-
appId: bundleId
|
|
942
|
-
});
|
|
943
|
-
} catch {
|
|
944
|
-
}
|
|
945
|
-
try {
|
|
946
|
-
await client.executeScript("mobile: clearApp", [{ bundleId }]);
|
|
947
|
-
} catch (e) {
|
|
948
|
-
console.warn(
|
|
949
|
-
`mobile: clearApp unavailable on this provider; falling back to terminate-only. In-memory state will still be reset. (${e})`
|
|
950
|
-
);
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
if (!launchConfig) {
|
|
954
|
-
await client.request("POST", client.sessionPath("/appium/device/activate_app"), {
|
|
955
|
-
appId: bundleId
|
|
956
|
-
});
|
|
957
|
-
}
|
|
958
|
-
if (opts?.clearKeychain) {
|
|
959
|
-
console.warn(
|
|
960
|
-
"clearKeychain is not available via Appium on iOS. Use local mode with xcrun simctl for keychain operations."
|
|
961
|
-
);
|
|
962
|
-
}
|
|
963
|
-
if (launchConfig) {
|
|
964
|
-
try {
|
|
965
|
-
await client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
966
|
-
appId: bundleId
|
|
967
|
-
});
|
|
968
|
-
} catch {
|
|
969
|
-
}
|
|
970
|
-
await client.executeScript("mobile: launchApp", [
|
|
971
|
-
{
|
|
972
|
-
bundleId,
|
|
973
|
-
arguments: launchConfig.arguments,
|
|
974
|
-
environment: launchConfig.environment
|
|
975
|
-
}
|
|
976
|
-
]);
|
|
977
|
-
}
|
|
978
|
-
if (opts?.deepLink) {
|
|
979
|
-
await client.request("POST", client.sessionPath("/url"), {
|
|
980
|
-
url: opts.deepLink
|
|
981
|
-
});
|
|
982
|
-
}
|
|
983
|
-
},
|
|
984
|
-
catch: (e) => new DriverError({ message: `Launch app failed: ${e}` })
|
|
985
|
-
}),
|
|
986
|
-
stopApp: (bundleId) => Effect2.tryPromise({
|
|
987
|
-
try: () => client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
988
|
-
appId: bundleId
|
|
989
|
-
}),
|
|
990
|
-
catch: (e) => new DriverError({ message: `Stop app failed: ${e}` })
|
|
991
|
-
}),
|
|
992
|
-
killApp: (bundleId) => Effect2.tryPromise({
|
|
993
|
-
try: () => client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
994
|
-
appId: bundleId
|
|
995
|
-
}),
|
|
996
|
-
catch: (e) => new DriverError({ message: `Kill app failed: ${e}` })
|
|
997
|
-
}),
|
|
998
|
-
clearAppState: (bundleId) => Effect2.tryPromise({
|
|
999
|
-
try: async () => {
|
|
1000
|
-
try {
|
|
1001
|
-
await client.request("POST", client.sessionPath("/appium/device/terminate_app"), {
|
|
1002
|
-
appId: bundleId
|
|
1003
|
-
});
|
|
1004
|
-
} catch {
|
|
1005
|
-
}
|
|
1006
|
-
await client.executeScript("mobile: clearApp", [{ bundleId }]);
|
|
1007
|
-
},
|
|
1008
|
-
catch: (e) => new DriverError({
|
|
1009
|
-
message: `Clear app state failed: ${e}. Note: clearApp may not be available on all iOS Appium providers. If this persists, consider using terminate + uninstall + install instead.`
|
|
1010
|
-
})
|
|
1011
|
-
}),
|
|
1012
|
-
// -----------------------------------------------------------------------
|
|
1013
|
-
// Navigation
|
|
1014
|
-
// -----------------------------------------------------------------------
|
|
1015
|
-
openLink: (url) => Effect2.tryPromise({
|
|
1016
|
-
try: () => client.request("POST", client.sessionPath("/url"), { url }),
|
|
1017
|
-
catch: (e) => new DriverError({ message: `Open link failed: ${e}` })
|
|
1018
|
-
}),
|
|
1019
|
-
back: () => Effect2.fail(
|
|
1020
|
-
new DriverError({
|
|
1021
|
-
message: "back() is not supported on iOS. Use navigation within the app or swipe gestures."
|
|
1022
|
-
})
|
|
1023
|
-
),
|
|
1024
|
-
// -----------------------------------------------------------------------
|
|
1025
|
-
// Scripting (works when switched to a WebView context)
|
|
1026
|
-
// -----------------------------------------------------------------------
|
|
1027
|
-
evaluate: (script, ...args) => Effect2.tryPromise({
|
|
1028
|
-
try: () => client.executeScript(
|
|
1029
|
-
typeof script === "function" ? `return (${script})(...arguments)` : script,
|
|
1030
|
-
args
|
|
1031
|
-
),
|
|
1032
|
-
catch: (e) => new DriverError({ message: `evaluate() failed: ${e}` })
|
|
1033
|
-
}),
|
|
1034
|
-
// -----------------------------------------------------------------------
|
|
1035
|
-
// WebView / hybrid context switching
|
|
1036
|
-
// -----------------------------------------------------------------------
|
|
1037
|
-
getContexts: () => Effect2.tryPromise({
|
|
1038
|
-
try: () => client.getContexts(),
|
|
1039
|
-
catch: (e) => new DriverError({ message: `getContexts failed: ${e}` })
|
|
1040
|
-
}),
|
|
1041
|
-
getCurrentContext: () => Effect2.tryPromise({
|
|
1042
|
-
try: () => client.getCurrentContext(),
|
|
1043
|
-
catch: (e) => new DriverError({ message: `getCurrentContext failed: ${e}` })
|
|
1044
|
-
}),
|
|
1045
|
-
setContext: (contextId) => Effect2.tryPromise({
|
|
1046
|
-
try: () => client.setContext(contextId),
|
|
1047
|
-
catch: (e) => new DriverError({ message: `setContext failed: ${e}` })
|
|
1048
|
-
}),
|
|
1049
|
-
// -----------------------------------------------------------------------
|
|
1050
|
-
// Network conditions
|
|
1051
|
-
// -----------------------------------------------------------------------
|
|
1052
|
-
setNetworkConditions: (conditions) => Effect2.tryPromise({
|
|
1053
|
-
try: () => {
|
|
1054
|
-
const resolved = resolveNetworkConditions(conditions);
|
|
1055
|
-
const hasAnyValue = conditions.profile !== void 0 || conditions.offline !== void 0 || conditions.latencyMs !== void 0 || conditions.downloadThroughputKbps !== void 0 || conditions.uploadThroughputKbps !== void 0;
|
|
1056
|
-
if (!hasAnyValue) {
|
|
1057
|
-
return client.executeScript("mobile: setConnectivity", [
|
|
1058
|
-
{ wifi: true, data: true, airplaneMode: false }
|
|
1059
|
-
]);
|
|
1060
|
-
}
|
|
1061
|
-
if (resolved.offline) {
|
|
1062
|
-
return client.executeScript("mobile: setConnectivity", [
|
|
1063
|
-
{ wifi: false, data: false, airplaneMode: true }
|
|
1064
|
-
]);
|
|
1065
|
-
}
|
|
1066
|
-
return client.executeScript("mobile: setConnectivity", [
|
|
1067
|
-
{ wifi: true, data: true, airplaneMode: false }
|
|
1068
|
-
]);
|
|
1069
|
-
},
|
|
1070
|
-
catch: (e) => new DriverError({ message: `setNetworkConditions failed: ${e}` })
|
|
1071
|
-
})
|
|
1072
|
-
};
|
|
1073
|
-
return Effect2.succeed(service);
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
// src/runtime/appium.ts
|
|
1077
|
-
async function buildAppiumAndroidRuntime(config, appiumUrl, caps) {
|
|
1078
|
-
const appId = caps["appium:appPackage"] ?? config.apps?.android?.packageName ?? "";
|
|
1079
|
-
const client = new AppiumClient(appiumUrl);
|
|
1080
|
-
await client.createSession({
|
|
1081
|
-
platformName: "Android",
|
|
1082
|
-
...caps
|
|
1083
|
-
});
|
|
1084
|
-
const driver = await Effect3.runPromise(createAppiumAndroidDriver(client, appId || void 0));
|
|
1085
|
-
const deviceInfo = await Effect3.runPromise(driver.getDeviceInfo());
|
|
1086
|
-
const sessionId = client.getSessionId() ?? void 0;
|
|
1087
|
-
const sessionCaps = client.getSessionCaps();
|
|
1088
|
-
const detectedProvider = detectProvider(appiumUrl);
|
|
1089
|
-
const providerName = detectedProvider?.name();
|
|
1090
|
-
return {
|
|
1091
|
-
runtime: {
|
|
1092
|
-
driver,
|
|
1093
|
-
cleanup: async () => {
|
|
1094
|
-
try {
|
|
1095
|
-
await client.deleteSession();
|
|
1096
|
-
} catch {
|
|
1097
|
-
}
|
|
1098
|
-
},
|
|
1099
|
-
metadata: {
|
|
1100
|
-
platform: "android",
|
|
1101
|
-
mode: "appium",
|
|
1102
|
-
sessionId,
|
|
1103
|
-
sessionCaps,
|
|
1104
|
-
provider: providerName
|
|
1105
|
-
}
|
|
1106
|
-
},
|
|
1107
|
-
engineConfig: {
|
|
1108
|
-
appId,
|
|
1109
|
-
platform: "android",
|
|
1110
|
-
coordinatorConfig: {
|
|
1111
|
-
parse: parseAndroidHierarchy,
|
|
1112
|
-
defaults: {
|
|
1113
|
-
timeout: config.defaults?.waitTimeout,
|
|
1114
|
-
pollInterval: config.defaults?.pollInterval,
|
|
1115
|
-
settleTimeout: config.defaults?.settleTimeout,
|
|
1116
|
-
initialPollInterval: config.defaults?.initialPollInterval
|
|
1117
|
-
},
|
|
1118
|
-
waitForIdleTimeout: config.defaults?.waitForIdleTimeout,
|
|
1119
|
-
typingDelay: config.defaults?.typingDelay,
|
|
1120
|
-
hierarchyCacheTtl: config.defaults?.hierarchyCacheTtl,
|
|
1121
|
-
screenWidth: deviceInfo.screenWidth,
|
|
1122
|
-
screenHeight: deviceInfo.screenHeight
|
|
1123
|
-
},
|
|
1124
|
-
autoLaunch: false,
|
|
1125
|
-
// Appium manages app lifecycle
|
|
1126
|
-
flowTimeout: config.defaults?.waitTimeout ? config.defaults.waitTimeout * 10 : 6e4,
|
|
1127
|
-
artifactConfig: config.artifacts,
|
|
1128
|
-
launchOptions: config.launchOptions,
|
|
1129
|
-
hooks: config.hooks,
|
|
1130
|
-
visualRegression: config.visualRegression
|
|
1131
|
-
}
|
|
1132
|
-
};
|
|
1133
|
-
}
|
|
1134
|
-
async function buildAppiumIOSRuntime(config, appiumUrl, caps) {
|
|
1135
|
-
const appId = caps["appium:bundleId"] ?? config.apps?.ios?.bundleId ?? "";
|
|
1136
|
-
const client = new AppiumClient(appiumUrl);
|
|
1137
|
-
await client.createSession({
|
|
1138
|
-
platformName: "iOS",
|
|
1139
|
-
"appium:automationName": "XCUITest",
|
|
1140
|
-
...caps
|
|
1141
|
-
});
|
|
1142
|
-
const snapshotMaxDepth = config.defaults?.snapshotMaxDepth ?? 100;
|
|
1143
|
-
try {
|
|
1144
|
-
await client.request("POST", client.sessionPath("/appium/settings"), {
|
|
1145
|
-
settings: { snapshotMaxDepth }
|
|
1146
|
-
});
|
|
1147
|
-
} catch (e) {
|
|
1148
|
-
console.warn(`Failed to set snapshotMaxDepth (continuing): ${e}`);
|
|
1149
|
-
}
|
|
1150
|
-
const driver = await Effect3.runPromise(createAppiumIOSDriver(client));
|
|
1151
|
-
const deviceInfo = await Effect3.runPromise(driver.getDeviceInfo());
|
|
1152
|
-
const sessionId = client.getSessionId() ?? void 0;
|
|
1153
|
-
const sessionCaps = client.getSessionCaps();
|
|
1154
|
-
const detectedProvider = detectProvider(appiumUrl);
|
|
1155
|
-
const providerName = detectedProvider?.name();
|
|
1156
|
-
return {
|
|
1157
|
-
runtime: {
|
|
1158
|
-
driver,
|
|
1159
|
-
cleanup: async () => {
|
|
1160
|
-
try {
|
|
1161
|
-
await client.deleteSession();
|
|
1162
|
-
} catch {
|
|
1163
|
-
}
|
|
1164
|
-
},
|
|
1165
|
-
metadata: {
|
|
1166
|
-
platform: "ios",
|
|
1167
|
-
mode: "appium",
|
|
1168
|
-
sessionId,
|
|
1169
|
-
sessionCaps,
|
|
1170
|
-
provider: providerName
|
|
1171
|
-
}
|
|
1172
|
-
},
|
|
1173
|
-
engineConfig: {
|
|
1174
|
-
appId,
|
|
1175
|
-
platform: "ios",
|
|
1176
|
-
coordinatorConfig: {
|
|
1177
|
-
parse: parseIOSHierarchy,
|
|
1178
|
-
defaults: {
|
|
1179
|
-
timeout: config.defaults?.waitTimeout,
|
|
1180
|
-
pollInterval: config.defaults?.pollInterval,
|
|
1181
|
-
settleTimeout: config.defaults?.settleTimeout,
|
|
1182
|
-
initialPollInterval: config.defaults?.initialPollInterval
|
|
1183
|
-
},
|
|
1184
|
-
waitForIdleTimeout: config.defaults?.waitForIdleTimeout,
|
|
1185
|
-
typingDelay: config.defaults?.typingDelay,
|
|
1186
|
-
hierarchyCacheTtl: config.defaults?.hierarchyCacheTtl,
|
|
1187
|
-
screenWidth: deviceInfo.screenWidth,
|
|
1188
|
-
screenHeight: deviceInfo.screenHeight
|
|
1189
|
-
},
|
|
1190
|
-
autoLaunch: false,
|
|
1191
|
-
// Appium manages app lifecycle
|
|
1192
|
-
flowTimeout: config.defaults?.waitTimeout ? config.defaults.waitTimeout * 10 : 6e4,
|
|
1193
|
-
artifactConfig: config.artifacts,
|
|
1194
|
-
launchOptions: config.launchOptions,
|
|
1195
|
-
hooks: config.hooks,
|
|
1196
|
-
visualRegression: config.visualRegression
|
|
1197
|
-
}
|
|
1198
|
-
};
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
339
|
// src/cli/iteration.ts
|
|
340
|
+
init_esm_shims();
|
|
1202
341
|
import { execFileSync } from "child_process";
|
|
1203
342
|
import { readFile as readFile2, writeFile } from "fs/promises";
|
|
1204
343
|
import { dirname, join, resolve } from "path";
|
|
@@ -1300,68 +439,6 @@ function createLastRunStatePath(outputDir) {
|
|
|
1300
439
|
return join(outputDir, ".spana", "last-run.json");
|
|
1301
440
|
}
|
|
1302
441
|
|
|
1303
|
-
// src/cli/watch-mode.ts
|
|
1304
|
-
import { readdir, stat } from "fs/promises";
|
|
1305
|
-
import { dirname as dirname2, extname, resolve as resolve2 } from "path";
|
|
1306
|
-
var WATCH_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".json", ".feature"]);
|
|
1307
|
-
var IGNORE_DIRS = /* @__PURE__ */ new Set([".git", "node_modules", "spana-output", "dist", "coverage"]);
|
|
1308
|
-
function collectWatchRoots(flowDir, configPath) {
|
|
1309
|
-
const roots = [resolve2(flowDir)];
|
|
1310
|
-
if (configPath) {
|
|
1311
|
-
const configDir = dirname2(resolve2(configPath));
|
|
1312
|
-
if (!roots.includes(configDir)) roots.push(configDir);
|
|
1313
|
-
}
|
|
1314
|
-
return roots;
|
|
1315
|
-
}
|
|
1316
|
-
async function snapshotDir(dir) {
|
|
1317
|
-
const snapshots = [];
|
|
1318
|
-
try {
|
|
1319
|
-
const entries = await readdir(dir, { withFileTypes: true });
|
|
1320
|
-
for (const entry of entries) {
|
|
1321
|
-
if (IGNORE_DIRS.has(entry.name)) continue;
|
|
1322
|
-
const fullPath = resolve2(dir, entry.name);
|
|
1323
|
-
if (entry.isDirectory()) {
|
|
1324
|
-
snapshots.push(...await snapshotDir(fullPath));
|
|
1325
|
-
} else if (WATCH_EXTENSIONS.has(extname(entry.name))) {
|
|
1326
|
-
const info = await stat(fullPath);
|
|
1327
|
-
snapshots.push({ path: fullPath, mtime: info.mtimeMs, size: info.size });
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
} catch {
|
|
1331
|
-
}
|
|
1332
|
-
return snapshots;
|
|
1333
|
-
}
|
|
1334
|
-
function diffSnapshots(previous, next) {
|
|
1335
|
-
const prevMap = new Map(previous.map((s) => [s.path, s]));
|
|
1336
|
-
const changed = [];
|
|
1337
|
-
for (const snap of next) {
|
|
1338
|
-
const prev = prevMap.get(snap.path);
|
|
1339
|
-
if (!prev || prev.mtime !== snap.mtime || prev.size !== snap.size) {
|
|
1340
|
-
changed.push(snap.path);
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
return changed;
|
|
1344
|
-
}
|
|
1345
|
-
async function runWatchLoop(options) {
|
|
1346
|
-
const interval = options.interval ?? 500;
|
|
1347
|
-
let previous = [];
|
|
1348
|
-
for (const root of options.roots) {
|
|
1349
|
-
previous.push(...await snapshotDir(root));
|
|
1350
|
-
}
|
|
1351
|
-
while (true) {
|
|
1352
|
-
await new Promise((r) => setTimeout(r, interval));
|
|
1353
|
-
const next = [];
|
|
1354
|
-
for (const root of options.roots) {
|
|
1355
|
-
next.push(...await snapshotDir(root));
|
|
1356
|
-
}
|
|
1357
|
-
const changed = diffSnapshots(previous, next);
|
|
1358
|
-
if (changed.length > 0) {
|
|
1359
|
-
await options.onChange(changed);
|
|
1360
|
-
}
|
|
1361
|
-
previous = next;
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
442
|
// src/cli/test-command.ts
|
|
1366
443
|
import { tmpdir } from "os";
|
|
1367
444
|
import { join as join2 } from "path";
|
|
@@ -1399,25 +476,27 @@ function validateOptions(opts) {
|
|
|
1399
476
|
return null;
|
|
1400
477
|
}
|
|
1401
478
|
async function buildParallelPlatformConfigs(platforms, opts, config, runtimes, resolveFromConfig, prelaunchedWeb) {
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
if (
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
const
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
479
|
+
let allDevices = [];
|
|
480
|
+
const needsMobileDiscovery = Boolean(opts.devices && opts.devices.length > 0) || platforms.some((p) => p === "android" || p === "ios");
|
|
481
|
+
if (needsMobileDiscovery) {
|
|
482
|
+
const { discoverDevices, findDeviceById } = await import("./discover-6ULCTB5T.js");
|
|
483
|
+
if (opts.devices) {
|
|
484
|
+
for (const id of opts.devices) {
|
|
485
|
+
const found = findDeviceById(id);
|
|
486
|
+
if (found) {
|
|
487
|
+
allDevices.push(found);
|
|
488
|
+
} else {
|
|
489
|
+
console.log(`Warning: Device "${id}" not found, skipping.`);
|
|
490
|
+
}
|
|
1412
491
|
}
|
|
492
|
+
if (opts.platforms.length === 0) {
|
|
493
|
+
const inferredPlatforms = [...new Set(allDevices.map((d) => d.platform))];
|
|
494
|
+
platforms.length = 0;
|
|
495
|
+
platforms.push(...inferredPlatforms);
|
|
496
|
+
}
|
|
497
|
+
} else {
|
|
498
|
+
allDevices = discoverDevices(platforms);
|
|
1413
499
|
}
|
|
1414
|
-
if (opts.platforms.length === 0) {
|
|
1415
|
-
const inferredPlatforms = [...new Set(allDevices.map((d) => d.platform))];
|
|
1416
|
-
platforms.length = 0;
|
|
1417
|
-
platforms.push(...inferredPlatforms);
|
|
1418
|
-
}
|
|
1419
|
-
} else {
|
|
1420
|
-
allDevices = discoverDevices(platforms);
|
|
1421
500
|
}
|
|
1422
501
|
const maxWorkers = opts.workers ?? config.defaults?.workers;
|
|
1423
502
|
const platformConfigs = [];
|
|
@@ -1547,6 +626,7 @@ async function buildSerialPlatformConfigs(platforms, opts, config, runtimes, exe
|
|
|
1547
626
|
const platformConfigs = [];
|
|
1548
627
|
for (const platform of platforms) {
|
|
1549
628
|
if (executionMode === "appium" && (platform === "android" || platform === "ios")) {
|
|
629
|
+
const { buildAppiumAndroidRuntime, buildAppiumIOSRuntime } = await import("./appium-CC77BJNK.js");
|
|
1550
630
|
const builder = platform === "android" ? buildAppiumAndroidRuntime : buildAppiumIOSRuntime;
|
|
1551
631
|
const resolvedCaps = appiumConfig ? await resolveCapabilities(appiumConfig, {
|
|
1552
632
|
capsPath: opts.capsPath,
|
|
@@ -1638,7 +718,7 @@ async function buildSerialPlatformConfigs(platforms, opts, config, runtimes, exe
|
|
|
1638
718
|
}
|
|
1639
719
|
var BUILTIN_REPORTERS = /* @__PURE__ */ new Set(["console", "json", "junit", "html", "allure", "github"]);
|
|
1640
720
|
async function loadCustomReporter(modulePath, configDir) {
|
|
1641
|
-
const resolvedPath = modulePath.startsWith(".") ?
|
|
721
|
+
const resolvedPath = modulePath.startsWith(".") ? resolve2(configDir, modulePath) : modulePath;
|
|
1642
722
|
let mod;
|
|
1643
723
|
try {
|
|
1644
724
|
mod = await import(resolvedPath);
|
|
@@ -1665,30 +745,43 @@ async function loadCustomReporter(modulePath, configDir) {
|
|
|
1665
745
|
);
|
|
1666
746
|
}
|
|
1667
747
|
async function setupReporters(reporterNames, config, resolveFromConfig, appiumUrl, opts, filterSummaries = []) {
|
|
1668
|
-
const { createRedactor, registerUrlSecrets } = await import("./redact-
|
|
748
|
+
const { createRedactor, registerUrlSecrets } = await import("./redact-OG4M3IEU.js");
|
|
1669
749
|
const redactor = createRedactor();
|
|
1670
750
|
if (appiumUrl) registerUrlSecrets(redactor, appiumUrl);
|
|
1671
|
-
const { createConsoleReporter } = await import("./console-
|
|
1672
|
-
const { createJsonReporter } = await import("./json-
|
|
1673
|
-
const { createJUnitReporter } = await import("./junit-
|
|
1674
|
-
const { createHtmlReporter } = await import("./html-
|
|
1675
|
-
const { createAllureReporter } = await import("./allure-
|
|
1676
|
-
const { createGitHubPrReporter } = await import("./github-pr-
|
|
751
|
+
const { createConsoleReporter } = await import("./console-T6TVZ65G.js");
|
|
752
|
+
const { createJsonReporter } = await import("./json-57Z2YSES.js");
|
|
753
|
+
const { createJUnitReporter } = await import("./junit-MHD5AXBU.js");
|
|
754
|
+
const { createHtmlReporter } = await import("./html-KJ2QAGF4.js");
|
|
755
|
+
const { createAllureReporter } = await import("./allure-XOM7BXL5.js");
|
|
756
|
+
const { createGitHubPrReporter } = await import("./github-pr-RYO6IAKD.js");
|
|
1677
757
|
const resolvedOutputDir = config.artifacts?.outputDir ?? resolveFromConfig("./spana-output");
|
|
1678
758
|
const reporters = [];
|
|
1679
759
|
for (const name of reporterNames.split(",")) {
|
|
1680
760
|
const trimmed = name.trim();
|
|
1681
761
|
if (!trimmed) continue;
|
|
1682
|
-
|
|
1683
|
-
|
|
762
|
+
const colonIdx = trimmed.indexOf(":");
|
|
763
|
+
const reporterKind = colonIdx > 0 ? trimmed.slice(0, colonIdx) : trimmed;
|
|
764
|
+
const reporterTarget = colonIdx > 0 ? trimmed.slice(colonIdx + 1) : void 0;
|
|
765
|
+
if (BUILTIN_REPORTERS.has(reporterKind)) {
|
|
766
|
+
switch (reporterKind) {
|
|
1684
767
|
case "json":
|
|
1685
|
-
reporters.push(
|
|
768
|
+
reporters.push(
|
|
769
|
+
createJsonReporter(reporterTarget ? resolve2(process.cwd(), reporterTarget) : void 0)
|
|
770
|
+
);
|
|
1686
771
|
break;
|
|
1687
772
|
case "junit":
|
|
1688
|
-
reporters.push(
|
|
773
|
+
reporters.push(
|
|
774
|
+
createJUnitReporter(
|
|
775
|
+
reporterTarget ? resolve2(process.cwd(), reporterTarget) : resolvedOutputDir
|
|
776
|
+
)
|
|
777
|
+
);
|
|
1689
778
|
break;
|
|
1690
779
|
case "html":
|
|
1691
|
-
reporters.push(
|
|
780
|
+
reporters.push(
|
|
781
|
+
createHtmlReporter(
|
|
782
|
+
reporterTarget ? resolve2(process.cwd(), reporterTarget) : resolvedOutputDir
|
|
783
|
+
)
|
|
784
|
+
);
|
|
1692
785
|
break;
|
|
1693
786
|
case "allure":
|
|
1694
787
|
reporters.push(createAllureReporter());
|
|
@@ -1701,7 +794,7 @@ async function setupReporters(reporterNames, config, resolveFromConfig, appiumUr
|
|
|
1701
794
|
break;
|
|
1702
795
|
}
|
|
1703
796
|
} else {
|
|
1704
|
-
const configDir =
|
|
797
|
+
const configDir = resolve2(resolveFromConfig("."));
|
|
1705
798
|
try {
|
|
1706
799
|
const custom = await loadCustomReporter(trimmed, configDir);
|
|
1707
800
|
reporters.push(custom);
|
|
@@ -1724,7 +817,7 @@ async function resolveExecutionContext(opts) {
|
|
|
1724
817
|
console.log(error instanceof Error ? error.message : String(error));
|
|
1725
818
|
return { ok: false, success: false };
|
|
1726
819
|
}
|
|
1727
|
-
const configDir =
|
|
820
|
+
const configDir = dirname2(loadedConfigPath ?? resolve2("spana.config.ts"));
|
|
1728
821
|
if (opts.validateConfigOnly) {
|
|
1729
822
|
if (!loadedConfigPath) {
|
|
1730
823
|
console.log("No config file found to validate.");
|
|
@@ -1733,7 +826,7 @@ async function resolveExecutionContext(opts) {
|
|
|
1733
826
|
console.log(`\u2713 Config valid (${loadedConfigPath})`);
|
|
1734
827
|
return { ok: false, success: true };
|
|
1735
828
|
}
|
|
1736
|
-
const resolveFromConfig = (p) =>
|
|
829
|
+
const resolveFromConfig = (p) => resolve2(configDir, p);
|
|
1737
830
|
if (process.env.SPANA_OUTPUT_DIR) {
|
|
1738
831
|
config.artifacts = { ...config.artifacts, outputDir: process.env.SPANA_OUTPUT_DIR };
|
|
1739
832
|
} else if (config.artifacts?.outputDir) {
|
|
@@ -1786,10 +879,10 @@ async function resolveExecutionContext(opts) {
|
|
|
1786
879
|
};
|
|
1787
880
|
}
|
|
1788
881
|
async function resolveTargetDevice(deviceId, platforms, cliPlatforms) {
|
|
1789
|
-
const { findDeviceById } = await import("./discover-
|
|
882
|
+
const { findDeviceById } = await import("./discover-6ULCTB5T.js");
|
|
1790
883
|
const targetDevice = findDeviceById(deviceId);
|
|
1791
884
|
if (!targetDevice) {
|
|
1792
|
-
const { discoverDevices } = await import("./discover-
|
|
885
|
+
const { discoverDevices } = await import("./discover-6ULCTB5T.js");
|
|
1793
886
|
const available = discoverDevices(["web", "android", "ios"]);
|
|
1794
887
|
console.log(`Device "${deviceId}" not found. Available devices:`);
|
|
1795
888
|
for (const d of available) {
|
|
@@ -1863,7 +956,12 @@ async function discoverAndFilterFlows(input) {
|
|
|
1863
956
|
}
|
|
1864
957
|
const filteredFlows = filterFlows(
|
|
1865
958
|
loadedFlows.map((l) => l.flow),
|
|
1866
|
-
{
|
|
959
|
+
{
|
|
960
|
+
tags: input.tags,
|
|
961
|
+
grep: input.grep,
|
|
962
|
+
grepInvert: input.grepInvert,
|
|
963
|
+
platforms: input.platforms
|
|
964
|
+
}
|
|
1867
965
|
);
|
|
1868
966
|
const allowedFlows = new Set(focusFlows(filteredFlows));
|
|
1869
967
|
let filteredLoadedFlows = loadedFlows.filter((l) => allowedFlows.has(l.flow));
|
|
@@ -1874,7 +972,7 @@ async function discoverAndFilterFlows(input) {
|
|
|
1874
972
|
);
|
|
1875
973
|
}
|
|
1876
974
|
if (input.changedSince && input.filters && input.filters.length > 0 && filteredLoadedFlows.length > 0) {
|
|
1877
|
-
const { applyTestFilters, buildFilterCandidates, collectGitChanges, formatFilterSummary } = await import("./filters-
|
|
975
|
+
const { applyTestFilters, buildFilterCandidates, collectGitChanges, formatFilterSummary } = await import("./filters-5DCGGJRN.js");
|
|
1878
976
|
try {
|
|
1879
977
|
const cwd = process.cwd();
|
|
1880
978
|
const changes = collectGitChanges(input.changedSince, cwd);
|
|
@@ -1934,7 +1032,7 @@ async function discoverAndFilterFlows(input) {
|
|
|
1934
1032
|
const selectedFlows = selectedLoadedFlows.map((l) => l.flow);
|
|
1935
1033
|
if (filteredLoadedFlows.length === 0) {
|
|
1936
1034
|
console.log("No flows match the given filters.");
|
|
1937
|
-
return { ok: false, success:
|
|
1035
|
+
return { ok: false, success: Boolean(input.passWithNoTests), watchRoots };
|
|
1938
1036
|
}
|
|
1939
1037
|
if (selectedFlows.length === 0) {
|
|
1940
1038
|
console.log(`No flows assigned to shard ${input.shard.current}/${input.shard.total}.`);
|
|
@@ -1985,10 +1083,10 @@ ${redacted.error.stack.split("\n").map((l) => ` ${l}`).join("\n")}`
|
|
|
1985
1083
|
};
|
|
1986
1084
|
}
|
|
1987
1085
|
async function reportToCloudProvider(runtimes, appiumUrl, result, platforms) {
|
|
1988
|
-
const { detectProvider
|
|
1086
|
+
const { detectProvider } = await import("./provider-CBAXZ2VA.js");
|
|
1989
1087
|
for (const rt of runtimes) {
|
|
1990
1088
|
if (rt.metadata.mode === "appium" && rt.metadata.provider) {
|
|
1991
|
-
const provider =
|
|
1089
|
+
const provider = detectProvider(appiumUrl);
|
|
1992
1090
|
if (provider) {
|
|
1993
1091
|
try {
|
|
1994
1092
|
const meta = {};
|
|
@@ -2024,16 +1122,30 @@ async function runTestCommandOnce(opts) {
|
|
|
2024
1122
|
return { success: false, watchRoots: [] };
|
|
2025
1123
|
}
|
|
2026
1124
|
const webServers = await startWebServers(config.webServer, { cwd: configDir });
|
|
1125
|
+
const projReporterNames = opts.reporter?.trim() ? opts.reporter : config.reporters && config.reporters.length > 0 ? config.reporters.join(",") : "console";
|
|
1126
|
+
const { redactor: projRedactor, reporters: projReporters } = await setupReporters(
|
|
1127
|
+
projReporterNames,
|
|
1128
|
+
config,
|
|
1129
|
+
resolveFromConfig,
|
|
1130
|
+
opts.appiumUrl,
|
|
1131
|
+
opts
|
|
1132
|
+
);
|
|
1133
|
+
const allProjectResults = [];
|
|
1134
|
+
const allProjectPlatforms = /* @__PURE__ */ new Set();
|
|
1135
|
+
const projectsStart = Date.now();
|
|
2027
1136
|
let allPassed = true;
|
|
2028
1137
|
try {
|
|
2029
1138
|
const executeProject = async (project) => {
|
|
2030
1139
|
const projFlowDir = opts.flowPath ?? resolveFromConfig(project.flowDir ?? config.flowDir ?? "./flows");
|
|
2031
1140
|
const projPlatforms = opts.platforms.length > 0 ? opts.platforms : project.platform ? [project.platform] : config.platforms && config.platforms.length > 0 ? config.platforms : ["web"];
|
|
1141
|
+
for (const p of projPlatforms) allProjectPlatforms.add(p);
|
|
2032
1142
|
const discovered = await discoverAndFilterFlows({
|
|
2033
1143
|
flowDir: projFlowDir,
|
|
2034
1144
|
configPath,
|
|
2035
1145
|
tags: opts.tags ?? project.tags,
|
|
2036
1146
|
grep: opts.grep ?? project.grep,
|
|
1147
|
+
grepInvert: opts.grepInvert,
|
|
1148
|
+
passWithNoTests: opts.passWithNoTests ?? true,
|
|
2037
1149
|
platforms: projPlatforms,
|
|
2038
1150
|
outputDir: config.artifacts?.outputDir ?? resolveFromConfig("./spana-output")
|
|
2039
1151
|
});
|
|
@@ -2068,8 +1180,17 @@ async function runTestCommandOnce(opts) {
|
|
|
2068
1180
|
}
|
|
2069
1181
|
};
|
|
2070
1182
|
const runtimes2 = [];
|
|
1183
|
+
const useParallelWorkers = Boolean(
|
|
1184
|
+
opts.parallel || opts.devices || opts.workers && opts.workers > 1 || projConfig.defaults?.workers && projConfig.defaults.workers > 1
|
|
1185
|
+
);
|
|
2071
1186
|
try {
|
|
2072
|
-
const platformConfigs2 = await
|
|
1187
|
+
const platformConfigs2 = executionMode === "local" && useParallelWorkers ? await buildParallelPlatformConfigs(
|
|
1188
|
+
projPlatforms,
|
|
1189
|
+
opts,
|
|
1190
|
+
projConfig,
|
|
1191
|
+
runtimes2,
|
|
1192
|
+
resolveFromConfig
|
|
1193
|
+
) : await buildSerialPlatformConfigs(
|
|
2073
1194
|
projPlatforms,
|
|
2074
1195
|
opts,
|
|
2075
1196
|
projConfig,
|
|
@@ -2081,10 +1202,31 @@ async function runTestCommandOnce(opts) {
|
|
|
2081
1202
|
null,
|
|
2082
1203
|
resolveFromConfig
|
|
2083
1204
|
);
|
|
1205
|
+
const redactProjResult = (r) => {
|
|
1206
|
+
if (!r.error) return r;
|
|
1207
|
+
return {
|
|
1208
|
+
...r,
|
|
1209
|
+
error: {
|
|
1210
|
+
...r.error,
|
|
1211
|
+
message: projRedactor.redact(r.error.message),
|
|
1212
|
+
stack: r.error.stack ? projRedactor.redact(r.error.stack) : void 0,
|
|
1213
|
+
suggestion: r.error.suggestion ? projRedactor.redact(r.error.suggestion) : void 0
|
|
1214
|
+
}
|
|
1215
|
+
};
|
|
1216
|
+
};
|
|
1217
|
+
const onResult = createResultHandler(projReporters, redactProjResult, projRedactor, opts);
|
|
2084
1218
|
const orchResult = await orchestrate(matched, platformConfigs2, {
|
|
2085
1219
|
retries: opts.retries ?? projConfig.defaults?.retries ?? 0,
|
|
2086
|
-
bail: opts.bail
|
|
1220
|
+
bail: opts.bail,
|
|
1221
|
+
parallelPlatforms: useParallelWorkers || projConfig.parallelPlatforms,
|
|
1222
|
+
onFlowStart(name, platform, workerName) {
|
|
1223
|
+
for (const reporter of projReporters) {
|
|
1224
|
+
reporter.onFlowStart?.(name, platform, workerName);
|
|
1225
|
+
}
|
|
1226
|
+
},
|
|
1227
|
+
onResult
|
|
2087
1228
|
});
|
|
1229
|
+
allProjectResults.push(...orchResult.results.map(redactProjResult));
|
|
2088
1230
|
console.log(
|
|
2089
1231
|
`[project:${project.name}] ${orchResult.passed} passed, ${orchResult.failed} failed, ${orchResult.skipped} skipped`
|
|
2090
1232
|
);
|
|
@@ -2107,6 +1249,18 @@ async function runTestCommandOnce(opts) {
|
|
|
2107
1249
|
const tdOk = await executeProject(td);
|
|
2108
1250
|
if (!tdOk) allPassed = false;
|
|
2109
1251
|
}
|
|
1252
|
+
for (const reporter of projReporters) {
|
|
1253
|
+
reporter.onRunComplete({
|
|
1254
|
+
total: allProjectResults.length,
|
|
1255
|
+
passed: allProjectResults.filter((r) => r.status === "passed").length,
|
|
1256
|
+
failed: allProjectResults.filter((r) => r.status === "failed").length,
|
|
1257
|
+
skipped: allProjectResults.filter((r) => r.status === "skipped").length,
|
|
1258
|
+
flaky: allProjectResults.filter((r) => r.flaky).length,
|
|
1259
|
+
durationMs: Date.now() - projectsStart,
|
|
1260
|
+
results: allProjectResults,
|
|
1261
|
+
platforms: [...allProjectPlatforms]
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
2110
1264
|
} finally {
|
|
2111
1265
|
await webServers.stopAll();
|
|
2112
1266
|
}
|
|
@@ -2123,6 +1277,8 @@ async function runTestCommandOnce(opts) {
|
|
|
2123
1277
|
configPath,
|
|
2124
1278
|
tags: opts.tags,
|
|
2125
1279
|
grep: opts.grep,
|
|
1280
|
+
grepInvert: opts.grepInvert,
|
|
1281
|
+
passWithNoTests: opts.passWithNoTests,
|
|
2126
1282
|
platforms,
|
|
2127
1283
|
shard: opts.shard,
|
|
2128
1284
|
lastFailed: opts.lastFailed,
|
|
@@ -2183,6 +1339,8 @@ async function runTestCommandOnce(opts) {
|
|
|
2183
1339
|
configPath,
|
|
2184
1340
|
tags: opts.tags,
|
|
2185
1341
|
grep: opts.grep,
|
|
1342
|
+
grepInvert: opts.grepInvert,
|
|
1343
|
+
passWithNoTests: opts.passWithNoTests,
|
|
2186
1344
|
platforms,
|
|
2187
1345
|
lastFailed: opts.lastFailed,
|
|
2188
1346
|
changed: opts.changed,
|
|
@@ -2219,6 +1377,11 @@ async function runTestCommandOnce(opts) {
|
|
|
2219
1377
|
const queueServer = await startSharedFlowQueueServer(orderedFlows.map((f) => f.name));
|
|
2220
1378
|
const runTag = `${Date.now()}-${Math.floor(Math.random() * 1e4)}`;
|
|
2221
1379
|
const baseWarmScope = config.execution?.web?.warmBrowserScope ?? `mp-${runTag}`;
|
|
1380
|
+
const shardOutDirs = [];
|
|
1381
|
+
let workerIndexOffsetCursor = 0;
|
|
1382
|
+
if (config.hooks?.beforeAll) {
|
|
1383
|
+
await config.hooks.beforeAll({ app: void 0, platform: platforms[0] });
|
|
1384
|
+
}
|
|
2222
1385
|
try {
|
|
2223
1386
|
const poolResult = await runMultiProcessPool({
|
|
2224
1387
|
totalWorkers: requestedWorkers,
|
|
@@ -2226,6 +1389,10 @@ async function runTestCommandOnce(opts) {
|
|
|
2226
1389
|
processes: effectivePlan.processCount,
|
|
2227
1390
|
buildShardCommand: (shardIndex, _shardTotal, workerCount) => {
|
|
2228
1391
|
const shardOutDir = join2(tmpdir(), `spana-mp-${runTag}-p${shardIndex}`);
|
|
1392
|
+
const reportPath = join2(shardOutDir, "results.json");
|
|
1393
|
+
const myOffset = workerIndexOffsetCursor;
|
|
1394
|
+
workerIndexOffsetCursor += workerCount;
|
|
1395
|
+
shardOutDirs.push(shardOutDir);
|
|
2229
1396
|
const args = [
|
|
2230
1397
|
process.argv[1],
|
|
2231
1398
|
"test",
|
|
@@ -2236,13 +1403,17 @@ async function runTestCommandOnce(opts) {
|
|
|
2236
1403
|
String(workerCount),
|
|
2237
1404
|
"--reporter",
|
|
2238
1405
|
"json",
|
|
1406
|
+
"--pass-with-no-tests",
|
|
2239
1407
|
...opts.browser ? ["--browser", opts.browser] : [],
|
|
2240
1408
|
...opts.configPath ? ["--config", opts.configPath] : [],
|
|
2241
1409
|
...opts.tags?.flatMap((t) => ["--tag", t]) ?? [],
|
|
2242
1410
|
...opts.grep ? ["--grep", opts.grep] : [],
|
|
1411
|
+
...opts.grepInvert ? ["--grep-invert", opts.grepInvert] : [],
|
|
2243
1412
|
...opts.changedSince ? ["--changed-since", opts.changedSince] : [],
|
|
2244
1413
|
...opts.retries !== void 0 ? ["--retries", String(opts.retries)] : [],
|
|
2245
1414
|
...opts.jsCoverage ? ["--js-coverage"] : [],
|
|
1415
|
+
...opts.trace ? ["--trace"] : [],
|
|
1416
|
+
...opts.headed ? ["--headed"] : [],
|
|
2246
1417
|
...opts.bail !== void 0 ? ["--bail", String(opts.bail)] : []
|
|
2247
1418
|
];
|
|
2248
1419
|
return {
|
|
@@ -2252,13 +1423,56 @@ async function runTestCommandOnce(opts) {
|
|
|
2252
1423
|
SPANA_WORKER_PROCESS: "1",
|
|
2253
1424
|
SPANA_QUEUE_URL: queueServer.url,
|
|
2254
1425
|
SPANA_OUTPUT_DIR: shardOutDir,
|
|
1426
|
+
SPANA_WORKER_REPORT_PATH: reportPath,
|
|
1427
|
+
SPANA_WORKER_INDEX_OFFSET: String(myOffset),
|
|
2255
1428
|
SPANA_WARM_SCOPE: `${baseWarmScope}-p${shardIndex}`
|
|
2256
1429
|
},
|
|
2257
|
-
reportJsonPath:
|
|
1430
|
+
reportJsonPath: reportPath
|
|
2258
1431
|
};
|
|
2259
1432
|
}
|
|
2260
1433
|
});
|
|
2261
|
-
const
|
|
1434
|
+
const {
|
|
1435
|
+
cp,
|
|
1436
|
+
mkdir: mkdirFs,
|
|
1437
|
+
readdir: readdirFs,
|
|
1438
|
+
rm: rmFs
|
|
1439
|
+
} = await import("fs/promises");
|
|
1440
|
+
const pathRewrites = [];
|
|
1441
|
+
await mkdirFs(outputDir, { recursive: true });
|
|
1442
|
+
for (const shardDir of shardOutDirs) {
|
|
1443
|
+
try {
|
|
1444
|
+
const entries = await readdirFs(shardDir);
|
|
1445
|
+
for (const entry of entries) {
|
|
1446
|
+
if (entry === "results.json" || entry === ".spana") continue;
|
|
1447
|
+
const src = join2(shardDir, entry);
|
|
1448
|
+
const dest = join2(outputDir, entry);
|
|
1449
|
+
await cp(src, dest, { recursive: true, force: true });
|
|
1450
|
+
pathRewrites.push([src, dest]);
|
|
1451
|
+
}
|
|
1452
|
+
} catch {
|
|
1453
|
+
} finally {
|
|
1454
|
+
await rmFs(shardDir, { recursive: true, force: true }).catch(() => {
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
const rewriteAttachmentPath = (p) => {
|
|
1459
|
+
for (const [src, dest] of pathRewrites) {
|
|
1460
|
+
if (p === src || p.startsWith(`${src}/`) || p.startsWith(`${src}\\`)) {
|
|
1461
|
+
return dest + p.slice(src.length);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
return p;
|
|
1465
|
+
};
|
|
1466
|
+
const mergedResults = poolResult.results.map((r) => ({
|
|
1467
|
+
...r,
|
|
1468
|
+
...r.attachments ? {
|
|
1469
|
+
attachments: r.attachments.map((a) => ({
|
|
1470
|
+
...a,
|
|
1471
|
+
path: rewriteAttachmentPath(a.path)
|
|
1472
|
+
}))
|
|
1473
|
+
} : {}
|
|
1474
|
+
}));
|
|
1475
|
+
const redactedResults = mergedResults.map(
|
|
2262
1476
|
(r) => r.error ? {
|
|
2263
1477
|
...r,
|
|
2264
1478
|
error: {
|
|
@@ -2281,6 +1495,19 @@ async function runTestCommandOnce(opts) {
|
|
|
2281
1495
|
platforms
|
|
2282
1496
|
});
|
|
2283
1497
|
}
|
|
1498
|
+
if (config.hooks?.afterAll) {
|
|
1499
|
+
try {
|
|
1500
|
+
await config.hooks.afterAll({
|
|
1501
|
+
app: void 0,
|
|
1502
|
+
platform: platforms[0],
|
|
1503
|
+
summary: { results: redactedResults }
|
|
1504
|
+
});
|
|
1505
|
+
} catch (hookError) {
|
|
1506
|
+
console.warn(
|
|
1507
|
+
`afterAll hook failed: ${hookError instanceof Error ? hookError.message : hookError}`
|
|
1508
|
+
);
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
2284
1511
|
const sourcePathsByFlowName = new Map(
|
|
2285
1512
|
mpFlowResult.selectedLoadedFlows.map((loaded) => [loaded.flow.name, loaded.sourcePath])
|
|
2286
1513
|
);
|
|
@@ -2290,7 +1517,7 @@ async function runTestCommandOnce(opts) {
|
|
|
2290
1517
|
buildLastRunState({
|
|
2291
1518
|
flowDir,
|
|
2292
1519
|
platforms,
|
|
2293
|
-
results:
|
|
1520
|
+
results: mergedResults,
|
|
2294
1521
|
sourcePathsByFlowName
|
|
2295
1522
|
})
|
|
2296
1523
|
);
|
|
@@ -2307,27 +1534,40 @@ async function runTestCommandOnce(opts) {
|
|
|
2307
1534
|
}
|
|
2308
1535
|
}
|
|
2309
1536
|
const prelaunchedWeb = executionMode === "local" && platforms.includes("web") ? speculativelyPrelaunchWebBrowser(config) : void 0;
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
1537
|
+
const closePrelaunchedWeb = async () => {
|
|
1538
|
+
if (!prelaunchedWeb?.ownsBrowser) return;
|
|
1539
|
+
await prelaunchedWeb.browserPromise.then((b) => b?.close?.()).catch(() => {
|
|
1540
|
+
});
|
|
1541
|
+
await prelaunchedWeb.cdpBrowserPromise?.then((h) => h.close()).catch(() => {
|
|
1542
|
+
});
|
|
1543
|
+
};
|
|
1544
|
+
let flowResult;
|
|
1545
|
+
let priorRunState;
|
|
1546
|
+
try {
|
|
1547
|
+
[flowResult, priorRunState] = await Promise.all([
|
|
1548
|
+
discoverAndFilterFlows({
|
|
1549
|
+
flowDir,
|
|
1550
|
+
configPath,
|
|
1551
|
+
tags: opts.tags,
|
|
1552
|
+
grep: opts.grep,
|
|
1553
|
+
grepInvert: opts.grepInvert,
|
|
1554
|
+
passWithNoTests: opts.passWithNoTests,
|
|
1555
|
+
platforms,
|
|
1556
|
+
shard: opts.shard,
|
|
1557
|
+
lastFailed: opts.lastFailed,
|
|
1558
|
+
changed: opts.changed,
|
|
1559
|
+
changedSince: opts.changedSince,
|
|
1560
|
+
filters: config.filters,
|
|
1561
|
+
outputDir
|
|
1562
|
+
}),
|
|
1563
|
+
readLastRunState(createLastRunStatePath(outputDir))
|
|
1564
|
+
]);
|
|
1565
|
+
} catch (err) {
|
|
1566
|
+
await closePrelaunchedWeb();
|
|
1567
|
+
throw err;
|
|
1568
|
+
}
|
|
2326
1569
|
if (!flowResult.ok) {
|
|
2327
|
-
|
|
2328
|
-
await prelaunchedWeb.browserPromise.then((b) => b.close()).catch(() => {
|
|
2329
|
-
});
|
|
2330
|
-
}
|
|
1570
|
+
await closePrelaunchedWeb();
|
|
2331
1571
|
return { success: flowResult.success, watchRoots: flowResult.watchRoots };
|
|
2332
1572
|
}
|
|
2333
1573
|
const { selectedLoadedFlows, selectedFlows, watchRoots, filterSummaries } = flowResult;
|
|
@@ -2368,7 +1608,7 @@ async function runTestCommandOnce(opts) {
|
|
|
2368
1608
|
"Appium auto-start is enabled; ignoring --appium-url / SPANA_APPIUM_URL / execution.appium.serverUrl."
|
|
2369
1609
|
);
|
|
2370
1610
|
}
|
|
2371
|
-
const { startLocalAppium } = await import("./appium-server-
|
|
1611
|
+
const { startLocalAppium } = await import("./appium-server-M6CWWUWF.js");
|
|
2372
1612
|
const started = await startLocalAppium({
|
|
2373
1613
|
binary: appiumConfig.autoStartBinary,
|
|
2374
1614
|
extraArgs: appiumConfig.autoStartArgs,
|
|
@@ -2378,7 +1618,7 @@ async function runTestCommandOnce(opts) {
|
|
|
2378
1618
|
runCleanups.push(() => started.stop());
|
|
2379
1619
|
}
|
|
2380
1620
|
const shouldReportToProvider = !opts.noProviderReporting && appiumConfig.reportToProvider !== false;
|
|
2381
|
-
const cloudHelper = executionMode === "appium" && appiumUrl ? await createCloudProviderHelper(appiumUrl, appiumConfig) : void 0;
|
|
1621
|
+
const cloudHelper = executionMode === "appium" && appiumUrl ? await (await import("./provider-CBAXZ2VA.js")).createCloudProviderHelper(appiumUrl, appiumConfig) : void 0;
|
|
2382
1622
|
if (cloudHelper) {
|
|
2383
1623
|
runCleanups.push(() => cloudHelper.cleanup());
|
|
2384
1624
|
}
|
|
@@ -2523,18 +1763,8 @@ async function runTestCommandOnce(opts) {
|
|
|
2523
1763
|
}
|
|
2524
1764
|
return { success: result.failed === 0, watchRoots };
|
|
2525
1765
|
} finally {
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
await rt.cleanup();
|
|
2529
|
-
} catch {
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
for (const cleanup of runCleanups) {
|
|
2533
|
-
try {
|
|
2534
|
-
await cleanup();
|
|
2535
|
-
} catch {
|
|
2536
|
-
}
|
|
2537
|
-
}
|
|
1766
|
+
await Promise.allSettled(runtimes.map((rt) => rt.cleanup()));
|
|
1767
|
+
await Promise.allSettled(runCleanups.map((cleanup) => cleanup()));
|
|
2538
1768
|
process.removeListener("SIGINT", handleSignal);
|
|
2539
1769
|
process.removeListener("SIGTERM", handleSignal);
|
|
2540
1770
|
}
|
|
@@ -2550,6 +1780,7 @@ async function runTestCommand(opts) {
|
|
|
2550
1780
|
console.log(
|
|
2551
1781
|
`Watching ${lastResult.watchRoots.length} path(s) for changes. Press Ctrl+C to stop.`
|
|
2552
1782
|
);
|
|
1783
|
+
const { runWatchLoop } = await import("./watch-mode-NR5MHNNL.js");
|
|
2553
1784
|
await runWatchLoop({
|
|
2554
1785
|
roots: lastResult.watchRoots,
|
|
2555
1786
|
onChange: async (changedPaths) => {
|
|
@@ -2566,4 +1797,4 @@ export {
|
|
|
2566
1797
|
loadCustomReporter,
|
|
2567
1798
|
runTestCommand
|
|
2568
1799
|
};
|
|
2569
|
-
//# sourceMappingURL=test-command-
|
|
1800
|
+
//# sourceMappingURL=test-command-T4PLAZXU.js.map
|