Skip to content

Commit c5ebca2

Browse files
Initial commit to generate android test
Co-authored-by: SrinivasanTarget <[email protected]>
0 parents  commit c5ebca2

18 files changed

+8808
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
dist
3+
build
4+
./coverage
5+
./logs
6+
./temp
7+
./test-results
8+
./test-reports
9+
./test-results
10+
.DS_Store

create-session1.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AndroidUiautomator2Driver } from "appium-uiautomator2-driver";
2+
3+
const capabilities = {
4+
platformName: "Android",
5+
"appium:automationName": "UiAutomator2",
6+
"appium:deviceName": "Android Device",
7+
};
8+
console.log(
9+
"Creating new Android session with capabilities:",
10+
JSON.stringify(capabilities, null, 2)
11+
);
12+
13+
// Create a new UiAutomator2Driver instance
14+
15+
const driver = new AndroidUiautomator2Driver();
16+
17+
// @ts-ignore
18+
const sessionId = await driver.createSession(null, {
19+
alwaysMatch: capabilities,
20+
firstMatch: [{}],
21+
});
22+
23+
console.log(`Session created successfully with ID: ${sessionId}`);

0 commit comments

Comments
 (0)