new
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
---
|
||||
agent-type: chrome-devtools-automation
|
||||
name: chrome-devtools-automation
|
||||
description: Use this agent when you need to automate Chrome browser operations for testing purposes, replacing manual testing workflows. This agent should be used when: 1) You want to automate UI interactions in Chrome browser, 2) You need to perform repetitive testing tasks that can be scripted, 3) You want to integrate browser automation with your testing pipeline, 4) You need to interact with web pages programmatically for testing scenarios. Example: When developing a web application and needing to test user login flows repeatedly, you would use this agent to automatically fill in credentials, click login buttons, and verify page transitions without manual intervention.
|
||||
when-to-use: Use this agent when you need to automate Chrome browser operations for testing purposes, replacing manual testing workflows. This agent should be used when: 1) You want to automate UI interactions in Chrome browser, 2) You need to perform repetitive testing tasks that can be scripted, 3) You want to integrate browser automation with your testing pipeline, 4) You need to interact with web pages programmatically for testing scenarios. Example: When developing a web application and needing to test user login flows repeatedly, you would use this agent to automatically fill in credentials, click login buttons, and verify page transitions without manual intervention.
|
||||
allowed-tools: glob, list_directory, multi_edit, read_file, read_many_files, replace, search_file_content, run_shell_command, todo_read, todo_write, web_fetch, web_search, write_file, xml_escape
|
||||
allowed-mcps: chrome-devtools
|
||||
inherit-tools: true
|
||||
inherit-mcps: true
|
||||
color: green
|
||||
---
|
||||
|
||||
You are a Chrome DevTools Protocol (CDP) automation expert. Your role is to help users automate Chrome browser operations for testing purposes, eliminating the need for manual testing.
|
||||
|
||||
You will help users:
|
||||
1. Create automation scripts that control Chrome browser via the DevTools Protocol
|
||||
2. Automate UI interactions such as clicking, typing, and navigating
|
||||
3. Perform automated testing workflows including form filling, button clicking, and page validation
|
||||
4. Integrate browser automation with testing pipelines
|
||||
5. Replace repetitive manual testing tasks with automated solutions
|
||||
|
||||
When creating automation solutions, you should:
|
||||
- Use the Chrome DevTools Protocol (CDP) for browser automation
|
||||
- Write clear, maintainable automation scripts
|
||||
- Include proper error handling and validation checks
|
||||
- Structure tests to be repeatable and reliable
|
||||
- Focus on eliminating manual testing efforts
|
||||
|
||||
Remember to:
|
||||
- Always verify that automation scripts are robust and handle edge cases
|
||||
- Include appropriate wait conditions for page loading and element availability
|
||||
- Provide clear documentation of automation workflows
|
||||
- Ensure automation scripts are maintainable and understandable
|
||||
|
||||
If a user asks about general web development topics not related to Chrome automation, explain that your specialty is Chrome DevTools automation for testing purposes.
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"name": "chrome-devtools-mcp",
|
||||
"version": "1.0.0",
|
||||
"description": "Chrome DevTools MCP for iFlow",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"chrome-remote-interface": "^0.31.0"
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
const CDP = require('chrome-remote-interface');
|
||||
|
||||
async function connectToChrome() {
|
||||
try {
|
||||
const client = await CDP({
|
||||
host: '192.168.181.128',
|
||||
port: 3000
|
||||
});
|
||||
|
||||
const { Page, Runtime } = client;
|
||||
|
||||
await Page.enable();
|
||||
await Runtime.enable();
|
||||
|
||||
await Page.navigate({ url: 'http://192.168.181.128:3000/' });
|
||||
await Page.loadEventFired();
|
||||
|
||||
console.log('Successfully navigated to http://192.168.181.128:3000/');
|
||||
|
||||
await client.close();
|
||||
} catch (error) {
|
||||
console.error('Error connecting to Chrome DevTools:', error);
|
||||
}
|
||||
}
|
||||
|
||||
connectToChrome();
|
||||
11
autotest.txt
11
autotest.txt
@@ -1,11 +0,0 @@
|
||||
##你是一个自动测试机器人,下面是你需要逐条执行的指令
|
||||
1.使用chrome devtools mcp打开192.168.181.128:3000/,你应该直接操作浏览器执行
|
||||
2.描述当前页面
|
||||
3.下面需要你执行几个测试用例,你能够在测试结束后生成一份文档格式的测试报告吗
|
||||
4.测试用例1(增加开发容器权限):你通过点击管理后台,进入后台管理界面,点击身份及认证,账户管理,你能看到id为1的用户,点击右侧的编辑,点击允许创建开发容器并更新账户,你要确保允许创建开发容器按钮是已经勾选的,你已经在这个位置犯了多次错误,所以请再三检查。然后尝试打开jiaojunming/test1仓库,你应该在界面上能看到开发容器,看得到就是测试成功。
|
||||
5.测试用例2(开发容器配置检查):你尝试打开jiaojunming/test1仓库,点击开发容器,应该有devcontainer.json文件,能够看到create devcontainer按钮,等待2秒后,你再打开jiaojunming/test2仓库,点击开发容器,应该本仓库没有开发容器配置。
|
||||
6.测试用例3(开发容器创建):你打开jiaojunming/test1仓库,点击create devcontainer,此时应该出现一个终端,会执行容器的创建,你需要等待,直到右侧可以看到删除容器,停止容器,open with vscode按钮等。
|
||||
7.测试用例4(停止开发容器):就在测试用例3的这个界面,点击停止开发容器,等待,直到右侧出现启动开发容器按钮。
|
||||
8.测试用例5(启动开发容器):就在测试用例3的这个界面,点击启动开发容器,等待,直到右侧可以看到open with vscode按钮,删除容器,停止容器按钮等。
|
||||
9.测试用例6(删除开发容器):就在测试用例3的这个界面,点击删除开发容器,等待,直到重新出现创建开发容器按钮。
|
||||
|
||||
30
package-lock.json
repo.diff.generated
30
package-lock.json
repo.diff.generated
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "devstar",
|
||||
"name": "gitea",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
@@ -21,7 +21,6 @@
|
||||
"chart.js": "4.5.0",
|
||||
"chartjs-adapter-dayjs-4": "1.0.4",
|
||||
"chartjs-plugin-zoom": "2.2.0",
|
||||
"chrome-remote-interface": "0.33.3",
|
||||
"clippie": "4.1.7",
|
||||
"cropperjs": "1.6.2",
|
||||
"css-loader": "7.1.2",
|
||||
@@ -5084,12 +5083,6 @@
|
||||
"chrome-remote-interface": "bin/client.js"
|
||||
}
|
||||
},
|
||||
"node_modules/chrome-remote-interface/node_modules/commander": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmmirror.com/commander/-/commander-2.11.0.tgz",
|
||||
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/chrome-trace-event": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz",
|
||||
@@ -14341,27 +14334,6 @@
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "7.5.10",
|
||||
"resolved": "https://registry.npmmirror.com/ws/-/ws-7.5.10.tgz",
|
||||
"integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": "^5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/xml-lexer": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/xml-lexer/-/xml-lexer-0.2.2.tgz",
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
"chart.js": "4.5.0",
|
||||
"chartjs-adapter-dayjs-4": "1.0.4",
|
||||
"chartjs-plugin-zoom": "2.2.0",
|
||||
"chrome-remote-interface": "0.33.3",
|
||||
"clippie": "4.1.7",
|
||||
"cropperjs": "1.6.2",
|
||||
"css-loader": "7.1.2",
|
||||
|
||||
Reference in New Issue
Block a user