Skip to content

Commit

Permalink
feat: Add open-wda script (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Aug 1, 2024
1 parent e7f5eb3 commit f5cfa81
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
"Mac"
],
"mainClass": "Mac2Driver",
"scripts": {
"open-wda": "./scripts/open-wda.js"
},
"doctor": {
"checks": [
"./build/lib/doctor/required-checks.js",
Expand Down Expand Up @@ -93,6 +96,7 @@
"lib",
"build/index.js",
"build/lib",
"scripts",
"WebDriverAgentMac/Scripts",
"WebDriverAgentMac/Cartfile",
"WebDriverAgentMac/Cartfile.resolved",
Expand Down
14 changes: 14 additions & 0 deletions scripts/open-wda.js
Original file line number Diff line number Diff line change
@@ -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())();

0 comments on commit f5cfa81

Please sign in to comment.