@@ -425,6 +425,9 @@ def run(self):
425425 exp_dir = self .exp_dir ,
426426 use_raw_page_output = getattr (self .agent_args , "use_raw_page_output" , False ),
427427 )
428+ # webarena_verified hack, enable playwright tracing
429+ if self .env_args .task_name .startswith ("webarena_verified" ):
430+ env .unwrapped .context .tracing .start (snapshots = True )
428431
429432 logger .debug ("Environment created." )
430433 step_info = StepInfo (step = 0 )
@@ -504,6 +507,9 @@ def run(self):
504507 logger .exception (f"Error while saving experiment info: { e } " )
505508 try :
506509 if env is not None :
510+ # webarena_verified hack, close playwright tracing
511+ if self .env_args .task_name .startswith ("webarena_verified" ):
512+ env .unwrapped .context .tracing .stop (path = self .exp_dir / "pw_traces" / f"{ self .exp_name } .zip" )
507513 env .close ()
508514 except Exception as e :
509515 logger .exception (f"Error while closing the environment: { e } " )
@@ -915,6 +921,8 @@ def _get_env_name(task_name: str):
915921 import browsergym .workarena
916922 elif task_name .startswith ("webarena" ):
917923 import browsergym .webarena
924+ import browsergym .webarena_verified
925+ import browsergym .webarenalite
918926 elif task_name .startswith ("visualwebarena" ):
919927 import browsergym .visualwebarena
920928 elif task_name .startswith ("assistantbench" ):
0 commit comments