2025-03-25 22:45:05 +08:00
|
|
|
import { describe, it, vi } from 'vitest';
|
2025-04-03 10:28:40 +08:00
|
|
|
import { agentFromAdbDevice, getConnectedDevices } from '../../src';
|
2025-03-25 22:45:05 +08:00
|
|
|
|
|
|
|
vi.setConfig({
|
|
|
|
testTimeout: 90 * 1000,
|
|
|
|
});
|
|
|
|
|
|
|
|
describe(
|
|
|
|
'android integration',
|
|
|
|
async () => {
|
|
|
|
await it('Android settings page demo for scroll', async () => {
|
2025-04-03 10:28:40 +08:00
|
|
|
const devices = await getConnectedDevices();
|
|
|
|
const agent = await agentFromAdbDevice(devices[0].udid);
|
|
|
|
|
|
|
|
await agent.launch('com.android.settings/.Settings');
|
2025-03-26 11:39:39 +08:00
|
|
|
|
|
|
|
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');
|
2025-03-25 22:45:05 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
360 * 1000,
|
|
|
|
);
|