diff --git a/README.md b/README.md index 228f1df..2e87a38 100644 --- a/README.md +++ b/README.md @@ -730,6 +730,15 @@ boundElementsByIndex | boolean | Whether to use elements binding by index (`true useDefaultUiInterruptionsHandling | boolean | Whether to use the default XCTest UI interruptions handling (`true`, the default setting) or to disable it for the [Application Under Test](#application-under-test-concept) (`false`). It makes sense to disable the default handler if it is necessary to validate the interrupting element's presence in your test or do some other actions on it rather than just closing the view implicitly. Check [this WWDC presentation](https://developer.apple.com/videos/play/wwdc2020/10220/) from Apple to get more details on the UI interruptions handling. +## Scripts + +The Mac2 driver supports the following scripts: + +### open-wda + +Run `appium driver run mac2 open-wda` to open the bundled WebDriverAgentMac source in Xcode and to print the path to the main .xcodeproj file into the Terminal. + + ## Examples ```python diff --git a/package.json b/package.json index f558552..2354528 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,9 @@ "Mac" ], "mainClass": "Mac2Driver", + "scripts": { + "open-wda": "./scripts/open-wda.js" + }, "doctor": { "checks": [ "./build/lib/doctor/required-checks.js", @@ -93,6 +96,7 @@ "lib", "build/index.js", "build/lib", + "scripts", "WebDriverAgentMac/Scripts", "WebDriverAgentMac/Cartfile", "WebDriverAgentMac/Cartfile.resolved", diff --git a/scripts/open-wda.js b/scripts/open-wda.js new file mode 100644 index 0000000..369aaae --- /dev/null +++ b/scripts/open-wda.js @@ -0,0 +1,14 @@ +const path = require('node:path'); +const {exec} = require('teen_process'); +const {logger} = require('@appium/support'); +const XCODEPROJ_NAME = 'WebDriverAgentMac.xcodeproj'; + +const log = logger.getLogger('WDA'); + +async function openWda() { + const dstPath = path.resolve(__dirname, '..', 'WebDriverAgentMac', XCODEPROJ_NAME); + log.info(`Opening '${dstPath}'`); + await exec('open', [dstPath]); +} + +(async () => await openWda())();