diff --git a/requirements.txt b/requirements.txt index 5b9b49e..f8c2c95 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ numpy>=1.14 requests>=2.31 tenacity>=8.2.3 # only used in cheat() -> move to tests? tqdm>=4.66.2 +playwright==1.53.0 \ No newline at end of file diff --git a/src/browsergym/workarena/__init__.py b/src/browsergym/workarena/__init__.py index 75ac279..cf1e882 100644 --- a/src/browsergym/workarena/__init__.py +++ b/src/browsergym/workarena/__init__.py @@ -24,7 +24,6 @@ from .tasks.list import __TASKS__ as LIST_TASKS from .tasks.navigation import __TASKS__ as NAVIGATION_TASKS from .tasks.service_catalog import __TASKS__ as SERVICE_CATALOG_TASKS -from .tasks.compositional.base import CompositionalTask ALL_WORKARENA_TASKS = [ *ALL_COMPOSITIONAL_TASKS_L2, diff --git a/src/browsergym/workarena/api/user.py b/src/browsergym/workarena/api/user.py index 3e966ce..a625843 100644 --- a/src/browsergym/workarena/api/user.py +++ b/src/browsergym/workarena/api/user.py @@ -1,6 +1,7 @@ from faker import Faker import numpy as np import time +import secrets fake = Faker() @@ -38,7 +39,7 @@ def create_user( """ user_idx = str(random.randint(1000, 9999)) - user_password = "aStrongPassword!" + user_password = secrets.token_urlsafe(16) first_name = fake.first_name() if not first_name else first_name last_name = fake.last_name() if not last_name else last_name diff --git a/src/browsergym/workarena/api/utils.py b/src/browsergym/workarena/api/utils.py index 47a6b2a..636131f 100644 --- a/src/browsergym/workarena/api/utils.py +++ b/src/browsergym/workarena/api/utils.py @@ -75,14 +75,17 @@ def table_api_call( if method == "POST" or wait_for_record: while not record_exists: sleep(0.5) - get_response = table_api_call( - instance=instance, - table=table, + get_response = requests.request( + method="GET", + url=instance.snow_url + f"/api/now/table/{table}", + auth=instance.snow_credentials, + headers=SNOW_API_HEADERS, + data=data, params=params, json=json, - data=data, - method="GET", ) + get_response.raise_for_status() + get_response = get_response.json() record_exists = len(get_response["result"]) > 0 num_retries += 1 if num_retries > max_retries: