Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a script to open WDA in Xcode #1457

Merged
merged 4 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/real-device-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,5 @@ echo "$(dirname "$(find "$HOME/.appium" -name WebDriverAgent.xcodeproj)")"
```

The resulting output will contain the full path to WDA's source folder.

Since XCUITest driver v4.13.0 there is a possibility to open `WebDriverAgent.xcodeproj` in Xcode by simply executing `appium driver run xcuitest open-wda` command.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
],
"mainClass": "XCUITestDriver",
"scripts": {
"build-wda": "./build/lib/build-wda.js"
"build-wda": "./build/lib/build-wda.js",
"open-wda": "./scripts/open-wda.js"
},
"schema": {
"$schema": "http://json-schema.org/draft-07/schema",
Expand Down Expand Up @@ -77,6 +78,7 @@
"asyncbox": "^2.3.1",
"bluebird": "^3.5.1",
"css-selector-parser": "^1.4.1",
"fancy-log": "^2.0.0",
"js2xmlparser2": "^0.x",
"lodash": "^4.17.10",
"lru-cache": "^7.0.1",
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('path');
const { exec } = require('teen_process');
const log = require('fancy-log');
const { BOOTSTRAP_PATH } = require('appium-webdriveragent');
const XCODEPROJ_NAME = 'WebDriverAgent.xcodeproj';


async function openWda () {
const dstPath = path.resolve(BOOTSTRAP_PATH, XCODEPROJ_NAME);
log.info(`Opening '${dstPath}'`);
await exec('open', [dstPath]);
}

(async () => await openWda())();