Skip to content

Commit 86265f6

Browse files
committed
rc3
1 parent 7128289 commit 86265f6

6 files changed

Lines changed: 64 additions & 61 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
browsergym-core==0.1.0rc2
1+
browsergym-core==0.1.0rc3
22
english-words>=2.0.1
33
numpy>=1.14
44
requests>=2.31

src/browsergym/workarena/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.1.0rc2"
1+
__version__ = "0.1.0rc3"
22

33
from browsergym.core.registration import register_task
44

src/browsergym/workarena/data_files/task_configs/all_menu.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -474,31 +474,6 @@
474474
"module": "Wrap Up",
475475
"url": "/now/nav/ui/classic/params/target/interaction_wrap_up_configuration_list.do%3Fsysparm_userpref_module%3D5d2e87400f022010603bf634a7767e81"
476476
},
477-
{
478-
"application": "ISM Monitoring",
479-
"module": "Daily ISM Scan Results ",
480-
"url": "/now/nav/ui/classic/params/target/sn_app_ism_monitor_check_result_list.do%3Fsysparm_userpref_module%3D1d3bde79ff351110f416d018d53bf1d9%26sysparm_query%3Dsys_created_onONToday%2540javascript%253Ags.beginningOfToday%2528%2529%2540javascript%253Ags.endOfToday%2528%2529%255EEQ"
481-
},
482-
{
483-
"application": "ISM Monitoring",
484-
"module": "Flow",
485-
"url": "/now/nav/ui/classic/params/target/%24flow-designer.do%23%2Fflow-designer%2Fc79a2bf1ff001110f416d018d53bf1f3"
486-
},
487-
{
488-
"application": "ISM Monitoring",
489-
"module": "Flow Executions",
490-
"url": "/now/nav/ui/classic/params/target/sys_flow_context_list.do%3Fsysparm_userpref_module%3D21ec5af9ff351110f416d018d53bf1ae%26sysparm_query%3Dflow%253Dc79a2bf1ff001110f416d018d53bf1f3%255EEQ"
491-
},
492-
{
493-
"application": "ISM Monitoring",
494-
"module": "Scan Suites",
495-
"url": "/now/nav/ui/classic/params/target/scan_check_suite_list.do%3Fsysparm_userpref_module%3Dbf8dd63dff351110f416d018d53bf11e%26sysparm_query%3Dsys_scope%253D02b1d852ff320110f416d018d53bf121%255EEQ"
496-
},
497-
{
498-
"application": "ISM Monitoring",
499-
"module": "ATF Suites",
500-
"url": "/now/nav/ui/classic/params/target/sys_atf_test_suite_list.do%3Fsysparm_userpref_module%3D44cdd63dff351110f416d018d53bf1a1%26sysparm_query%3Dsys_scope%253D02b1d852ff320110f416d018d53bf121%255EEQ"
501-
},
502477
{
503478
"application": "Issue Auto Resolution",
504479
"module": "Settings",
@@ -3629,11 +3604,6 @@
36293604
"module": "Sell and Consume > Business Request Catalog",
36303605
"url": "/now/nav/ui/classic/params/target/sc_cat_item_subscribe_mtom_list.do%3Fsysparm_userpref_module%3D00bc628e231200106682110d96bf65a7%26sysparm_query%3Dservice_offering.service_classification%253DBusiness%2BService%255EEQ"
36313606
},
3632-
{
3633-
"application": "ECC",
3634-
"module": "Queue",
3635-
"url": "/now/nav/ui/classic/params/target/ecc_queue_list.do%3Fsysparm_userpref_module%3D6924fdb4c0a8016901ee5b3609621423%26sysparm_query%3Dsys_created_onONToday%2540javascript%253Ags.daysAgoStart%25280%2529%2540javascript%253Ags.daysAgoEnd%25280%2529%255EEQ"
3636-
},
36373607
{
36383608
"application": "Email Client",
36393609
"module": "Response Templates - Received > Forward",
@@ -4012,7 +3982,7 @@
40123982
{
40133983
"application": "System Applications",
40143984
"module": "All Available Applications > All",
4015-
"url": "/now/nav/ui/classic/params/target/%24allappsmgmt.do"
3985+
"url": "/now/nav/ui/classic/params/target/%24allappsmgmt.do%3Fsysparm_use_polaris%3Dfalse"
40163986
},
40173987
{
40183988
"application": "System Applications",
@@ -4022,12 +3992,7 @@
40223992
{
40233993
"application": "System Applications",
40243994
"module": "All Available Applications > ServiceNow Products",
4025-
"url": "/now/nav/ui/classic/params/target/%24products.do"
4026-
},
4027-
{
4028-
"application": "All Available Applications",
4029-
"module": "Available To Obtain From Store",
4030-
"url": "/now/nav/ui/classic/params/target/%24allappsmgmt.do%3Fview%3Dstore"
3995+
"url": "/now/nav/ui/classic/params/target/%24products.do%3Fsysparm_use_polaris%3Dfalse"
40313996
},
40323997
{
40333998
"application": "System Archiving",
@@ -4998,5 +4963,40 @@
49984963
"application": "System UI",
49994964
"module": "Field Styles",
50004965
"url": "/now/nav/ui/classic/params/target/sys_ui_style_list.do%3Fsysparm_userpref_module%3Dc5cc1c4cc0a80164013e846f439f500f"
4966+
},
4967+
{
4968+
"application": "Workspace Experience",
4969+
"module": "Forms > UI Action Groups",
4970+
"url": "/now/nav/ui/classic/params/target/sys_aw_form_uiaction_group_list.do%3Fsysparm_query%3DORDERBYui_action_layout%255EORDERBYoverflow%255EORDERBYorder"
4971+
},
4972+
{
4973+
"application": "Workspace Experience",
4974+
"module": "Forms > Workspace Ribbon Settings",
4975+
"url": "/now/nav/ui/classic/params/target/sys_aw_ribbon_setting_list.do%3Fsysparm_view%3Dworkspace"
4976+
},
4977+
{
4978+
"application": "Workspace Experience",
4979+
"module": "Forms > Workspace Form Headers",
4980+
"url": "/now/nav/ui/classic/params/target/sys_aw_form_header_list.do%3Fsysparm_view%3Dworkspace"
4981+
},
4982+
{
4983+
"application": "Workspace Experience",
4984+
"module": "Forms > Workspace View Rules",
4985+
"url": "/now/nav/ui/classic/params/target/sysrule_view_workspace_list.do%3Fsysparm_view%3Dworkspace"
4986+
},
4987+
{
4988+
"application": "Workspace Experience",
4989+
"module": "Actions & Components > Field Decorators",
4990+
"url": "/now/nav/ui/classic/params/target/sys_declarative_action_assignment_list.do%3Fsysparm_fixed_query%3Dmodel%253D15920e6d534723003eddddeeff7b1244%26sysparm_view%3Ddecorators%0D%0A"
4991+
},
4992+
{
4993+
"application": "Workspace Experience",
4994+
"module": "Actions & Components > List Actions",
4995+
"url": "/now/nav/ui/classic/params/target/sys_declarative_action_assignment_list.do%3Fsysparm_fixed_query%3Dmodel%253Dc3547169534723003eddddeeff7b126c%26sysparm_view%3Dlist_action"
4996+
},
4997+
{
4998+
"application": "Workspace Experience",
4999+
"module": "Actions & Components > Related List Actions",
5000+
"url": "/now/nav/ui/classic/params/target/sys_declarative_action_assignment_list.do%3Fsysparm_fixed_query%3Dmodel%253Dd91731a9534723003eddddeeff7b121c%26sysparm_view%3Dlist_action"
50015001
}
50025002
]

src/browsergym/workarena/tasks/list.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,21 @@ def setup(self, seed: int, page: Page) -> tuple[str, dict]:
427427
self.list_info = config["list_info"]
428428
self.filter_len = len(self.filter_columns)
429429

430+
# generate goal
431+
goal = (
432+
f"Create a filter for the list to extract all entries where "
433+
+ f" {'and' if self.filter_kind == 'AND' else 'or'} ".join(
434+
[
435+
f'"{self.list_info["columns"][col]["label"]}" is "{val}"'
436+
for col, val in zip(self.filter_columns, self.filter_values)
437+
]
438+
)
439+
+ "."
440+
)
441+
info = {}
442+
443+
return goal, info
444+
430445
def _generate_random_config(self, seed: int, page: Page):
431446
self.pre_setup(seed, page)
432447
self._wait_for_ready(page)
@@ -497,22 +512,6 @@ def _generate_random_config(self, seed: int, page: Page):
497512
list(self.list_info["columns"][c]["choices"].values())
498513
)
499514

500-
# generate goal
501-
goal = (
502-
f'Create a filter for the "{self.list_info["title"].lower()}" list '
503-
+ f"to extract all entries where "
504-
+ f" {'and' if self.filter_kind == 'AND' else 'or'} ".join(
505-
[
506-
f'"{self.list_info["columns"][col]["label"]}" is "{val}"'
507-
for col, val in zip(self.filter_columns, self.filter_values)
508-
]
509-
)
510-
+ "."
511-
)
512-
info = {}
513-
514-
return goal, info
515-
516515
def cheat(self, page: Page, chat_messages: list[str]) -> None:
517516
super().cheat(page, chat_messages)
518517
self._wait_for_ready(page)

tests/test_task_from_config.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,13 @@ def generic_task_cheat_test(task_class, config_path, page: Page):
9494
task_config = json.load(open(config_path, "r"))[0]
9595

9696
task = task_class(fixed_config=task_config)
97-
task.setup(page=page, seed=1)
97+
goal, info = task.setup(page=page, seed=1)
9898
chat_messages = []
99-
assert task.validate(page, chat_messages)[1] is False
99+
reward, done, message, info = task.validate(page, chat_messages)
100+
assert done is False and reward == 0.0
100101
task.cheat(page=page, chat_messages=chat_messages)
101-
assert task.validate(page, chat_messages)[1] is True
102+
reward, done, message, info = task.validate(page, chat_messages)
103+
assert done is True and reward == 1.0
102104
task.teardown()
103105

104106

tests/test_task_general.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@
2828
@pytest.mark.slow
2929
def test_cheat(task_entrypoint, random_seed: int, page: Page):
3030
task = task_entrypoint()
31-
task.setup(seed=random_seed, page=page)
31+
goal, info = task.setup(seed=random_seed, page=page)
3232
chat_messages = []
33-
assert task.validate(page, chat_messages)[1] is False
33+
reward, done, message, info = task.validate(page, chat_messages)
34+
assert done is False and reward == 0.0
3435
task.cheat(page=page, chat_messages=chat_messages)
35-
assert task.validate(page, chat_messages)[1] is True
36+
reward, done, message, info = task.validate(page, chat_messages)
37+
assert done is True and reward == 1.0
3638
task.teardown()

0 commit comments

Comments
 (0)