80 lines
3.5 KiB
TypeScript
80 lines
3.5 KiB
TypeScript
import { ElementLocator } from '../drivers/types';
|
|
|
|
export const AICAM_LOCATORS: Record<string, ElementLocator> = {
|
|
// === AI Hub 功能主页 ===
|
|
hubTitle: {
|
|
name: 'AI Hub Title',
|
|
ios: { using: 'predicate string', value: 'label CONTAINS "AI Hub"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().textContains("AI Hub")' },
|
|
},
|
|
tryOpenClaw: {
|
|
name: 'Try OpenClaw Entry',
|
|
ios: { using: 'predicate string', value: 'label == "Try OpenClaw"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().text("Try OpenClaw")' },
|
|
},
|
|
aiRoutines: {
|
|
name: 'AI Routines Entry',
|
|
ios: { using: 'predicate string', value: 'label == "AI Routines"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().text("AI Routines")' },
|
|
},
|
|
aiEvents: {
|
|
name: 'AI Events Entry',
|
|
ios: { using: 'predicate string', value: 'label == "AI Events"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().text("AI Events")' },
|
|
},
|
|
camerasLabel: {
|
|
name: 'Cameras Section Label',
|
|
ios: { using: 'predicate string', value: 'label == "Cameras"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().text("Cameras")' },
|
|
},
|
|
settingsIcon: {
|
|
name: 'Settings Icon (top right gear)',
|
|
ios: { using: 'predicate string', value: 'label CONTAINS "setting" OR name CONTAINS "setting"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().descriptionContains("setting")' },
|
|
},
|
|
gotItButton: {
|
|
name: 'Got it dismiss button',
|
|
ios: { using: 'predicate string', value: 'label == "Got it"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().text("Got it")' },
|
|
},
|
|
|
|
// === AI Events 页面 ===
|
|
aiEventsTitle: {
|
|
name: 'AI Events Page Title',
|
|
ios: { using: 'predicate string', value: 'label == "AI Events" AND type == "XCUIElementTypeStaticText"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().text("AI Events")' },
|
|
},
|
|
searchBar: {
|
|
name: 'AI Search Bar',
|
|
ios: { using: 'class name', value: 'XCUIElementTypeTextField' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().className("android.widget.EditText")' },
|
|
},
|
|
filterIcon: {
|
|
name: 'Filter Icon (top right sliders)',
|
|
ios: { using: 'predicate string', value: 'label CONTAINS "filter" OR name CONTAINS "filter"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().descriptionContains("filter")' },
|
|
},
|
|
moreMenuIcon: {
|
|
name: 'More Menu (...) Icon',
|
|
ios: { using: 'predicate string', value: 'label CONTAINS "more" OR name CONTAINS "more"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().descriptionContains("more")' },
|
|
},
|
|
todayLabel: {
|
|
name: 'Today date label',
|
|
ios: { using: 'predicate string', value: 'label == "Today"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().text("Today")' },
|
|
},
|
|
eventCard: {
|
|
name: 'Event Card',
|
|
ios: { using: 'predicate string', value: 'type == "XCUIElementTypeCell" AND visible == true' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().className("android.view.ViewGroup").clickable(true)' },
|
|
},
|
|
|
|
// === 通用 ===
|
|
backButton: {
|
|
name: 'Back Button (top left <)',
|
|
ios: { using: 'predicate string', value: 'label CONTAINS "back" OR label CONTAINS "Back" OR name CONTAINS "back"' },
|
|
android: { using: '-android uiautomator', value: 'new UiSelector().descriptionContains("Back")' },
|
|
},
|
|
};
|