feat: enhance evaluator configuration for Chrome with post-execution commands

- Added postconfig commands to multiple JSON files for Chrome evaluation examples.
- Included commands to terminate existing Chrome processes, launch Chrome with remote debugging, and introduce sleep intervals for timing.
- Updated logging messages in the AWS manager to improve clarity and user experience.

These changes enhance the automation and usability of the evaluation examples while preserving existing logic.
This commit is contained in:
yuanmengqi
2025-07-17 10:50:10 +00:00
parent 24fbad9015
commit 2c51950e73
12 changed files with 172 additions and 59 deletions

View File

@@ -29,6 +29,32 @@
"chrome"
],
"evaluator": {
"postconfig": [
{
"type": "launch",
"parameters": {
"command": [
"pkill",
"chrome"
]
}
},
{
"type": "launch",
"parameters": {
"command": [
"google-chrome",
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],
"func": "exact_match",
"result": {
"type": "enable_do_not_track"

View File

@@ -29,6 +29,32 @@
"chrome"
],
"evaluator": {
"postconfig": [
{
"type": "launch",
"parameters": {
"command": [
"pkill",
"chrome"
]
}
},
{
"type": "launch",
"parameters": {
"command": [
"google-chrome",
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],
"func": "is_expected_bookmarks",
"result": {
"type": "bookmarks"

View File

@@ -47,6 +47,12 @@
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],
"func": "exact_match",

View File

@@ -254,6 +254,12 @@
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],
"func": "check_history_deleted",

View File

@@ -47,6 +47,12 @@
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],
"func": "check_enabled_experiments",

View File

@@ -38,6 +38,32 @@
"chrome"
],
"evaluator": {
"postconfig": [
{
"type": "launch",
"parameters": {
"command": [
"pkill",
"chrome"
]
}
},
{
"type": "launch",
"parameters": {
"command": [
"google-chrome",
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],
"func": "is_expected_bookmarks",
"result": {
"type": "bookmarks"

View File

@@ -38,6 +38,32 @@
"chrome"
],
"evaluator": {
"postconfig": [
{
"type": "launch",
"parameters": {
"command": [
"pkill",
"chrome"
]
}
},
{
"type": "launch",
"parameters": {
"command": [
"google-chrome",
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],
"func": "is_cookie_deleted",
"result": {
"type": "cookie_data",

View File

@@ -31,10 +31,27 @@
"evaluator": {
"postconfig": [
{
"type": "execute",
"type": "launch",
"parameters": {
"command": "pkill chrome",
"shell": "true"
"command": [
"pkill",
"chrome"
]
}
},
{
"type": "launch",
"parameters": {
"command": [
"google-chrome",
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],

View File

@@ -31,10 +31,27 @@
"evaluator": {
"postconfig": [
{
"type": "execute",
"type": "launch",
"parameters": {
"command": "pkill chrome",
"shell": "true"
"command": [
"pkill",
"chrome"
]
}
},
{
"type": "launch",
"parameters": {
"command": [
"google-chrome",
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],

View File

@@ -47,6 +47,12 @@
"--remote-debugging-port=1337"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
}
],
"func": "check_font_size",

View File

@@ -31,28 +31,11 @@
"evaluator": {
"postconfig": [
{
"type": "execute",
"parameters": {
"command": [
"python3",
"-c",
"import pyautogui; pyautogui.press('f5')"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
},
{
"type": "execute",
"type": "launch",
"parameters": {
"command": [
"pkill",
"-f",
"google-chrome"
"chrome"
]
}
},
@@ -65,37 +48,6 @@
]
}
},
{
"type": "launch",
"parameters": {
"command": [
"socat",
"tcp-listen:9222,fork",
"tcp:localhost:1337"
]
}
},
{
"type": "chrome_open_tabs",
"parameters": {
"urls_to_open": [
"chrome://settings/search",
"chrome://settings"
]
}
},
{
"type": "sleep",
"parameters": {
"seconds": 3
}
},
{
"type": "execute",
"parameters": {
"command": ["pkill", "-SIGHUP", "-f", "google-chrome"]
}
},
{
"type": "sleep",
"parameters": {