Skip to content

Commit ff11211

Browse files
feat: add dom diff into case generation
1 parent bf911b1 commit ff11211

File tree

9 files changed

+730
-10
lines changed

9 files changed

+730
-10
lines changed

webqa-agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def build_test_configurations(cfg, cookies=None):
222222
"test_specific_config": {
223223
"cookies": cookies,
224224
"business_objectives": tconf["function_test"].get("business_objectives", ""),
225+
"dynamic_step_generation": tconf["function_test"].get("dynamic_step_generation", {}),
225226
},
226227
}
227228
)

webqa_agent/crawler/deep_crawler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ async def crawl(
289289
current_url=page.url
290290
)
291291

292-
logging.debug(f"DOM change result: {diff_elements}")
292+
if diff_elements["has_changes"]:
293+
logging.debug(f"DOM change result: {diff_elements}")
293294

294295
result.diff_element_map = ElementMap(data=self.extract_interactive_elements(get_new_elems=True))
295296

webqa_agent/executor/test_runners.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ async def run_test(
5959
business_objectives = test_config.test_specific_config.get('business_objectives', '')
6060
logging.info(f"{icon['running']} Running test: {test_config.test_name} with business objectives: {business_objectives}")
6161

62+
# Extract dynamic step generation configuration
63+
dynamic_step_config = test_config.test_specific_config.get('dynamic_step_generation', {
64+
"enabled": False,
65+
"max_dynamic_steps": 5,
66+
"min_elements_threshold": 2
67+
})
68+
6269
cookies = test_config.test_specific_config.get('cookies')
6370

6471
initial_state = {
@@ -72,6 +79,7 @@ async def run_test(
7279
'current_test_case_index': 0,
7380
'skip_reflection': False, # Initialize skip reflection flag
7481
'language': test_config.report_config.get('language', 'zh-CN'),
82+
'dynamic_step_generation': dynamic_step_config, # Pass dynamic step generation config
7583
}
7684

7785
graph_config = {'configurable': {'ui_tester_instance': parallel_tester}, 'recursion_limit': 100}

0 commit comments

Comments
 (0)