fix tasks

This commit is contained in:
yuanmengqi
2025-07-01 15:57:14 +00:00
parent b48c69a2fb
commit 2e3a4a5ba9
8 changed files with 35 additions and 18 deletions

View File

@@ -1444,6 +1444,8 @@ def get_active_tab_url_parse(env, config: Dict[str, Any]):
# change original key to new key, keep value unchange
value = extracted_params.pop(key)
extracted_params[config["replace"][key]] = value
if config.get("split_list", False):
extracted_params = {key: extracted_params[key].split(',') for key in extracted_params.keys()}
return extracted_params

View File

@@ -322,8 +322,14 @@ def check_direct_json_object(result, rules) -> float:
expected_json = rules["expected"]
for key in expected_json.keys():
expected_value = expected_json.get(key)
if expected_value != result.get(key):
return 0.
if expected_json.get("ignore_list_order", False):
expected_value = sorted(expected_value)
result_value = sorted(result.get(key))
if expected_value != result_value:
return 0.
else:
if expected_value != result.get(key):
return 0.
return 1.0
else:
expected_json = rules["expected"]

View File

@@ -1,7 +1,7 @@
{
"id": "47543840-672a-467d-80df-8f7c3b9788c9",
"snapshot": "chrome",
"instruction": "Find and select the car with the most number of seats to pick up in Boston Logan Intl Airport from 10th next month to 11th next month.",
"instruction": "Show me the cars available for pickup at Boston Logan Intl Airport from the 10th to the 11th of next month, sorted by the number of seats to find the largest capacity.",
"source": "test_task_1",
"config": [
{
@@ -75,7 +75,7 @@
"goto_prefix": "https://www.",
"category": "xpath",
"xpathObject": {
"/html/body/div[6]/div[2]/div[1]/div/div/div[2]/div[1]/section[1]/div/form/div[1]/div[2]/div/a": "rank"
"/html/body/div[6]/div[2]/div[1]/div/div/div[2]/section[1]/div[1]/form/div[1]/div[1]/div[2]/div/a": "rank"
}
}
],

View File

@@ -1,7 +1,7 @@
{
"id": "6766f2b8-8a72-417f-a9e5-56fcaa735837",
"snapshot": "chrome",
"instruction": "Could you help me install the unpacked extension at /home/user/Desktop/ in Chrome?",
"instruction": "Could you help me unzip the downloaded extension file from /home/user/Desktop/ to /home/user/Desktop/ and configure it in Chrome's extensions?",
"source": "https://support.google.com/chrome/thread/205881926/it-s-possible-to-load-unpacked-extension-automatically-in-chrome?hl=en",
"config": [
{

View File

@@ -53,16 +53,26 @@
"chrome"
],
"evaluator": {
"func": "is_expected_active_tab",
"func": "check_direct_json_object",
"result": {
"type": "active_url_from_accessTree",
"goto_prefix": "https://www."
"type": "active_tab_url_parse",
"goto_prefix": "https://www.",
"parse_keys": [
"modelList"
],
"split_list": true
},
"expected": {
"type": "rule",
"rules": {
"type": "url",
"url": "https://www.apple.com/iphone/compare/?modelList=iphone-15-pro-max,iphone-15-pro,iphone-13-pro-max"
"expected": {
"modelList": [
"iphone-15-pro-max",
"iphone-14-pro-max",
"iphone-13-pro-max"
]
},
"ignore_list_order": true
}
}
},

View File

@@ -49,10 +49,10 @@
"goto_prefix": "https://www.",
"category": "class",
"class_singleObject": {
"search-date": "time"
"mach-flight-context-info__wrapper--date": "time"
},
"class_multiObject": {
"search-segment-cities__city": {
"class_multiObject_child": {
"mach-flight-context-info__wrapper__info--separator": {
"0": "start",
"1": "end"
}
@@ -67,7 +67,7 @@
"expected": {
"start": "NYC",
"end": "CMH",
"time": "{DoW}, {Month} {DayD}, {Year}"
"time": "{DoW}, {Month} {Day0D}, {Year}"
}
}
}

View File

@@ -2,8 +2,8 @@
{
"host": "gw.dataimpulse.com",
"port": 823,
"username": "fba5ac061fe18be70c6c",
"password": "3b5669b6640fc80c",
"username": "67e5faf31654b923f06b",
"password": "26a3158d346abdfa",
"protocol": "http",
"provider": "dataimpulse",
"type": "residential",

View File

@@ -266,8 +266,7 @@ def main():
screen_size=(args.screen_width, args.screen_height),
headless=args.headless,
os_type="Ubuntu",
require_a11y_tree=args.observation_type in ["a11y_tree", "screenshot_a11y_tree", "som"],
enable_proxy=True
require_a11y_tree=args.observation_type in ["a11y_tree", "screenshot_a11y_tree", "som"]
)
# 执行手动检查