(
observation_type: str, current_viewport_only: bool
)
| 26 | |
| 27 | |
| 28 | def get_observation( |
| 29 | observation_type: str, current_viewport_only: bool |
| 30 | ) -> None: |
| 31 | env = ScriptBrowserEnv( |
| 32 | observation_type=observation_type, |
| 33 | current_viewport_only=current_viewport_only, |
| 34 | headless=HEADLESS, |
| 35 | sleep_after_execution=2.0, |
| 36 | ) |
| 37 | env.reset(options={"config_file": f"scripts/tmp_storage_state.json"}) |
| 38 | s = f"""page.goto("http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7780/admin/admin/dashboard/") |
| 39 | page.get_by_label("", exact=True).fill("reviews") |
| 40 | page.get_by_label("", exact=True).press("Enter") |
| 41 | page.scroll(down)""" |
| 42 | action_seq = s.split("\n") |
| 43 | |
| 44 | for action in action_seq: |
| 45 | action = action.strip() |
| 46 | obs, success, _, _, info = env.step(create_playwright_action(action)) |
| 47 | print(obs["text"]) |
| 48 | _ = input("Press enter to continue") |
| 49 | |
| 50 | |
| 51 | if __name__ == "__main__": |
no test coverage detected