Skip to content

Commit 8162cae

Browse files
committed
added support for ios
1 parent c5ebca2 commit 8162cae

File tree

10 files changed

+12618
-4222
lines changed

10 files changed

+12618
-4222
lines changed

create-session1.ts renamed to create-session-android.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ console.log(
1313
// Create a new UiAutomator2Driver instance
1414

1515
const driver = new AndroidUiautomator2Driver();
16-
1716
// @ts-ignore
1817
const sessionId = await driver.createSession(null, {
1918
alwaysMatch: capabilities,
2019
firstMatch: [{}],
2120
});
2221

22+
console.log(driver.caps.automationName);
23+
2324
console.log(`Session created successfully with ID: ${sessionId}`);

create-session-ios.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { XCUITestDriver } from "appium-xcuitest-driver";
2+
3+
const capabilities = {
4+
platformName: "iOS",
5+
"appium:automationName": "XCUITest",
6+
"appium:deviceName": "iPhone 16 Pro",
7+
"appium:platformVersion": "18.2",
8+
"appium:udid": "E9F10A3E-58E6-4506-B273-B22AF836014E",
9+
};
10+
console.log(
11+
"Creating new iOS session with capabilities:",
12+
JSON.stringify(capabilities, null, 2)
13+
);
14+
15+
// Create a new UiAutomator2Driver instance
16+
17+
const driver = new XCUITestDriver();
18+
19+
// @ts-ignore
20+
const sessionId = await driver.createSession(null, {
21+
alwaysMatch: capabilities,
22+
firstMatch: [{}],
23+
});
24+
25+
console.log(driver.caps.automationName);
26+
27+
console.log(`Session created successfully with ID: ${sessionId}`);

0 commit comments

Comments
 (0)