mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-07-24 17:31:58 +00:00

* refactor: android api * refactor: update the Android agent and device connection logic * refactor: enhance Android agent to accept options for device connection * fix: type error * feat: use first device when no deviceId pass * fix: import from agent.ts * fix: click after clearInput * fix: click before clearInput
27 lines
796 B
TypeScript
27 lines
796 B
TypeScript
import { describe, it, vi } from 'vitest';
|
|
import { agentFromAdbDevice, getConnectedDevices } from '../../src';
|
|
|
|
vi.setConfig({
|
|
testTimeout: 90 * 1000,
|
|
});
|
|
|
|
describe(
|
|
'android integration',
|
|
async () => {
|
|
await it('Android settings page demo for scroll', async () => {
|
|
const devices = await getConnectedDevices();
|
|
const agent = await agentFromAdbDevice(devices[0].udid);
|
|
|
|
await agent.launch('com.android.settings/.Settings');
|
|
|
|
await agent.aiAction('scroll list to bottom');
|
|
await agent.aiAction('open "More settings"');
|
|
await agent.aiAction('scroll list to bottom');
|
|
await agent.aiAction('scroll list to top');
|
|
await agent.aiAction('swipe down one screen');
|
|
await agent.aiAction('swipe up one screen');
|
|
});
|
|
},
|
|
360 * 1000,
|
|
);
|