(temp_condition: dict, webdriver: WebDriver, return_record: dict,
global_script: dict, interval: float, wait: float, store: StoreBase = None)
| 234 | @staticmethod |
| 235 | @check |
| 236 | def __process_condition(temp_condition: dict, webdriver: WebDriver, return_record: dict, |
| 237 | global_script: dict, interval: float, wait: float, store: StoreBase = None) -> bool: |
| 238 | condition = temp_condition.get("condition") |
| 239 | trans_flag = False |
| 240 | if condition.startswith("__not-") and condition.endswith("__"): |
| 241 | trans_flag = True |
| 242 | condition = condition[6: -2] |
| 243 | return_flag = temp_condition.get("return_flag") |
| 244 | temp_args = {"driver": webdriver} |
| 245 | for key, value in temp_condition.items(): |
| 246 | if key.lower() not in ScriptProcess.__POP_KEY: |
| 247 | temp_args[key] = value |
| 248 | if "store" in signature(ScriptProcess.CONDITIONS[condition]).parameters: |
| 249 | temp_args["store"] = store |
| 250 | if return_record: |
| 251 | for key, value in temp_args.items(): |
| 252 | if isinstance(value, str) and value.startswith("__rf-") and value.endswith("__"): |
| 253 | temp_args[key] = return_record[value[5:-2]] |
| 254 | is_success = ScriptProcess.CONDITIONS[condition](**temp_args) |
| 255 | if trans_flag: |
| 256 | is_success = not is_success |
| 257 | if return_flag: |
| 258 | return_record[return_flag] = is_success |
| 259 | if not is_success: |
| 260 | fail_script = temp_condition.get("fail_script") |
| 261 | if fail_script: |
| 262 | ScriptProcess._process_script(script=fail_script, |
| 263 | global_script=global_script, |
| 264 | webdriver=webdriver, |
| 265 | interval=interval, |
| 266 | return_record=return_record, |
| 267 | wait=wait, |
| 268 | store=store, ) |
| 269 | return is_success |
| 270 | |
| 271 | @staticmethod |
| 272 | @check |
no test coverage detected