(self, hook_type: str, *args)
| 163 | raise ValueError(f"Invalid hook type: {hook_type}") |
| 164 | |
| 165 | def execute_hook(self, hook_type: str, *args): |
| 166 | hook = self.hooks.get(hook_type) |
| 167 | if hook: |
| 168 | result = hook(*args) |
| 169 | if result is not None: |
| 170 | if isinstance(result, webdriver.Chrome): |
| 171 | return result |
| 172 | else: |
| 173 | raise TypeError(f"Hook {hook_type} must return an instance of webdriver.Chrome or None.") |
| 174 | # If the hook returns None or there is no hook, return self.driver |
| 175 | return self.driver |
| 176 | |
| 177 | def update_user_agent(self, user_agent: str): |
| 178 | self.options.add_argument(f"user-agent={user_agent}") |
no outgoing calls
no test coverage detected