AI开发tool提示词

Playwright

处理module元素及其子节点

[TASK]
生成一个isModuleElementObject function,若element的qa-test class在对象moduleObj {"qa-test-mycourses-course": "qa-test-mycourses-course-title", "qa-test-discussion-module": "qa-test-discussion-description", "qa-test-reply-module": "qa-test-reply-description"}的key中,返回该key的value
生成一个getModuleText function,根据`.${value}`得到elementList,并返回所有element的textList
生成一个getUniqueLocatorsInModule function,传入rootElement,按照以下规则生成该元素下所有节点:
1.调用getModuleText,并根据text得到rootElement的uniqueLocator `${rootElement.locator}:has-text("${text}") ${element.locator}`
2.遍历每个子节点element,判断是否moduleElementsObject
2.当class包含qa-test时,获取该子节点的locator, 并返回
3.用isUnique判断,若元素唯一,则加入全局数组中

[Example]
以下是rootElement及其后代节点的信息,提供参考

生成验证元素的tool

[TASK]
Create a BROWSER_TOOLS type tool playwright_verify_element to execute validation steps. 

[INPUT EXAMPLE]
{
    selector: '.qa-test-mycourses-course-title',  //required
    text: 'AOS_BROWSE_Course028',   //optional, should be provide if element required
    state: 'visible',   //required
    attributes: { 'class': 'qa-test-mycourses-course-title tw-text-2xl' }  //optional, should be provided if step required
}

[WORKFLOW]
1.Check src/tools.ts file: it should define the tool name, description and inputSchema
2.Check src/toolHandler.ts: it should import tool, initialize tool, route to tool
3.Check src/tools/class/.ts: this file should be created automatically to implement tool, the class should extends ToolBase
4.Check src/tools/codegen/generator.ts: create a login step generator for the playwright_login tool

Appium

生成tool

[TASK]
在element.ts中新增一个工具scroll_until_element_visible,用于实现向一个方向滚动屏幕,直到指定的元素出现才停止

[WORKFLOW]
1.在element-controller.ts中实现handler
2.在types.ts中导出接口的定义
export interface ElementScrollUntilVisibleInput extends ElementOperationBaseInput {
    direction: 'up' | 'down';
    maxScrolls?: number;
    percent?: number;
}

 

你可能感兴趣的:(测试工具,java,服务器,前端,人工智能)