Skip to content

Commit eea7dea

Browse files
authored
Merge pull request #147 from ServiceNow/scratch/remove-call-get-form
remove call to _get_form as it causes issues in workspace forms
2 parents e90af5e + 22f43ed commit eea7dea

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/browsergym/workarena/tasks/form_workspace.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,20 @@ def setup_goal(self, page: Page) -> tuple[str, dict]:
6363

6464
return goal, info
6565

66+
def start(self, page: Page) -> None:
67+
# Overriding start because calling self._get_form(page) in the parent class gives an error
68+
logging.debug("Navigating to task start page")
69+
70+
# Authenticate
71+
url_login(
72+
instance=self.instance,
73+
page=page,
74+
)
75+
76+
# Navigate to the task's url
77+
page.goto(self.start_url)
78+
self._wait_for_ready(page)
79+
6680
def validate(
6781
self, page: Page, chat_messages: list[str]
6882
) -> Tuple[float, bool, str, dict]:
@@ -237,20 +251,6 @@ def __init__(self, seed: int = None,
237251
self.start_url = self.instance.snow_url
238252
self.created_sys_id = None
239253

240-
def start(self, page: Page) -> None:
241-
# Overriding start because calling self._get_form(page) in the parent class gives an error
242-
logging.debug("Navigating to task start page")
243-
244-
# Authenticate
245-
url_login(
246-
instance=self.instance,
247-
page=page,
248-
)
249-
250-
# Navigate to the task's url
251-
page.goto(self.start_url)
252-
self._wait_for_ready(page)
253-
254254
def get_init_scripts(self) -> List[str]:
255255
# Override this to avoid changing functionality of submit button
256256
return []

0 commit comments

Comments
 (0)