@mobilewright/driver-mobile-use 0.0.1 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/dist/example.d.ts +0 -2
- package/dist/example.d.ts.map +0 -1
- package/dist/example.js +0 -39
- package/dist/example.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mobilewright/driver-mobile-use",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "mobile-use.com driver for Mobilewright",
|
|
5
5
|
"homepage": "https://mobilewright.dev",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mobilewright/protocol": "^0.0.
|
|
32
|
+
"@mobilewright/protocol": "^0.0.24",
|
|
33
33
|
"debug": "^4.4.3",
|
|
34
34
|
"ws": "^8.18.0"
|
|
35
35
|
},
|
package/dist/example.d.ts
DELETED
package/dist/example.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":""}
|
package/dist/example.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { writeFileSync } from 'node:fs';
|
|
2
|
-
import { MobileUseDriver } from './driver.js';
|
|
3
|
-
const API_KEY = "mob_Z2WFuDmQR3v7A5HJN1bJ18UjETPr4cDueZEt";
|
|
4
|
-
async function main() {
|
|
5
|
-
const driver = new MobileUseDriver({
|
|
6
|
-
// region: 'us-west-2',
|
|
7
|
-
// apiKey: 'your-api-key',
|
|
8
|
-
apiKey: API_KEY,
|
|
9
|
-
});
|
|
10
|
-
// Connect to a device
|
|
11
|
-
const session = await driver.connect({
|
|
12
|
-
platform: 'ios',
|
|
13
|
-
});
|
|
14
|
-
console.log('Connected:', session);
|
|
15
|
-
// Get screen size
|
|
16
|
-
const screenSize = await driver.getScreenSize();
|
|
17
|
-
console.log('Screen size:', screenSize);
|
|
18
|
-
// Get orientation
|
|
19
|
-
const orientation = await driver.getOrientation();
|
|
20
|
-
console.log('Orientation:', orientation);
|
|
21
|
-
// Take a screenshot and save to file
|
|
22
|
-
const screenshot = await driver.screenshot();
|
|
23
|
-
writeFileSync('screenshot.png', screenshot);
|
|
24
|
-
console.log('Screenshot saved to screenshot.png (%d bytes)', screenshot.length);
|
|
25
|
-
// List elements on screen
|
|
26
|
-
const elements = await driver.getViewHierarchy();
|
|
27
|
-
console.log('Elements on screen:', JSON.stringify(elements, null, 2));
|
|
28
|
-
// Type text
|
|
29
|
-
await driver.typeText('Hello from mobile-use driver!');
|
|
30
|
-
console.log('Typed text on screen');
|
|
31
|
-
// Disconnect
|
|
32
|
-
await driver.disconnect();
|
|
33
|
-
console.log('Disconnected');
|
|
34
|
-
}
|
|
35
|
-
main().catch((err) => {
|
|
36
|
-
console.error(err);
|
|
37
|
-
process.exit(1);
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=example.js.map
|
package/dist/example.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example.js","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,OAAO,GAAG,0CAA0C,CAAC;AAE3D,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,uBAAuB;QACvB,0BAA0B;QAC1B,MAAM,EAAE,OAAO;KAChB,CAAC,CAAC;IAEH,sBAAsB;IACtB,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QACnC,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,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