Auto-generated from the executor's event_dict (556 commands).
| Command | Signature | Summary |
|---|---|---|
WR_a11y_load_axe |
(path: 'str') -> 'str' |
讀取本地 axe-core JS 原始碼檔案 / Read a local axe-core source file. |
WR_a11y_run_audit |
`(axe_source: 'str', options: 'dict[str, Any] | None' = None) -> 'dict[str, Any]'` |
WR_a11y_summarise |
(results: 'dict[str, Any]') -> 'list[dict[str, Any]]' |
將 axe 結果壓縮成只含 id / impact / help / nodes 數量的清單 |
WR_ac_assert_image_on_screen |
`(image_path: 'str', detect_threshold: 'float | None' = None) -> 'list[int]'` |
WR_ac_available |
() -> 'bool' |
AutoControl 是否已安裝(不 import) |
WR_ac_basic_auth |
`(username_env: 'str', password_env: 'str', url: 'str | None' = None, submit: 'bool' = True, wait_seconds: 'float' = 1.0) -> 'None'` |
WR_ac_click_element_native |
`(selector: 'str | None' = None, by: 'str' = 'css selector', mouse_button: 'str' = 'mouse_left', scale: 'float |
WR_ac_fill_native_file_dialog |
(file_path: 'str', submit: 'bool' = True, wait_seconds: 'float' = 1.0) -> 'str' |
在已開啟的系統檔案對話框輸入路徑並按 Enter |
WR_ac_list_commands |
() -> 'list[str]' |
列出可經橋接執行的 AutoControl 命令 |
WR_ac_run |
(action: 'list') -> 'Any' |
執行一個 AutoControl 動作並回傳結果 |
WR_ac_run_actions |
(actions: 'list') -> 'list[Any]' |
依序執行 AutoControl 動作並回傳各自的結果;第一個失敗就拋出 |
WR_add_cookie |
(cookie_dict: 'dict') -> 'None' |
新增 cookie 到當前頁面 |
WR_add_package_to_callback_executor |
(package) |
將套件的成員加入到 callback_executor 的 event_dict |
WR_add_package_to_executor |
(package) |
將套件的成員加入到 executor 的 event_dict |
WR_add_script_to_evaluate_on_new_document |
`(source: 'str') -> 'str | None'` |
WR_alert_accept |
`(prompt_text: 'str | None' = None) -> 'None'` |
WR_alert_dismiss |
() -> 'None' |
Dismiss the open alert / confirm / prompt. |
WR_alert_text |
() -> 'str' |
The message of the open dialog. |
WR_appium_android_caps |
`(app: 'str', device_name: 'str' = 'Android Emulator', platform_version: 'str' = '13', automation_name: 'str' = 'UiAutomator2', extra: 'dict[str, Any] | None' = None) -> 'dict[str, Any]'` |
WR_appium_ios_caps |
`(app: 'str', device_name: 'str' = 'iPhone 15', platform_version: 'str' = '17', automation_name: 'str' = 'XCUITest', extra: 'dict[str, Any] | None' = None) -> 'dict[str, Any]'` |
WR_appium_quit |
() -> 'None' |
Quit whatever driver is currently registered on the WebRunner wrapper. |
WR_appium_start |
(server_url: 'str', capabilities: 'dict[str, Any]', register: 'bool' = True) -> 'Any' |
建立 Appium WebDriver 並註冊到 webdriver_wrapper_instance |
WR_apw_assert_text |
(selector: 'str', expected: 'str') -> 'str' |
Fail unless the element's text contains expected; returns the text. |
WR_apw_assert_title |
(expected: 'str') -> 'str' |
Fail unless the page title contains expected; returns the title. |
WR_apw_click |
(selector: 'str') -> 'None' |
Click the element selector matches (Playwright waits until it is actionable). |
WR_apw_close_page |
() -> 'int' |
Close the current page; returns how many stay open. |
WR_apw_evaluate |
(script: 'str', arg: 'Any' = None) -> 'Any' |
Evaluate JavaScript in the page (behind the arbitrary-script gate). |
WR_apw_fill |
(selector: 'str', value: 'str') -> 'None' |
Fill an input. |
WR_apw_goto |
(url: 'str', wait_until: 'str' = 'load') -> 'str' |
Navigate the current page (opening one first if none is open); returns the final URL. |
WR_apw_new_page |
`(url: 'str | None' = None) -> 'int'` |
WR_apw_press |
(selector: 'str', key: 'str') -> 'None' |
Press key (Enter, Control+A …) in the element. |
WR_apw_screenshot |
(path: 'str', full_page: 'bool' = False) -> 'str' |
Save a PNG of the current page; returns the path. |
WR_apw_sleep |
(seconds: 'float') -> 'None' |
Pause this action list only; the others keep running. |
WR_apw_switch_to_page |
(index: 'int') -> 'str' |
Make page index current; returns its URL. |
WR_apw_text |
(selector: 'str') -> 'str' |
The element's inner text. |
WR_apw_title |
() -> 'str' |
The current page's title. |
WR_apw_url |
() -> 'str' |
The current page's URL. |
WR_apw_wait_for_selector |
(selector: 'str', state: 'str' = 'visible', timeout: 'float' = 10.0) -> 'None' |
Wait until selector is attached / detached / visible / hidden (timeout in seconds). |
WR_apw_wait_for_websocket_message |
(contains: 'str', timeout: 'float' = 10.0) -> 'dict[str, Any]' |
Wait until a received WebSocket frame contains contains; returns it. |
WR_apw_websocket_messages |
`(direction: 'str | None' = None) -> 'list[dict[str, Any]]'` |
WR_assert_no_4xx_or_5xx |
() -> 'None' |
|
WR_assert_no_5xx |
() -> 'None' |
|
WR_assert_no_console_errors |
() -> 'None' |
|
WR_assert_no_secrets |
(data: 'Any') -> 'None' |
掃描並在有發現時拋例外 / Scan and raise SecretsFound on any hit. |
WR_assert_web_vitals |
`(budgets: 'dict[str, float] | None' = None, observe_ms: 'int' = 1000, source: 'str' = 'page', url: 'str |
WR_attach_to_existing_browser |
`(debugger_address: 'str', webdriver_name: 'str' = 'chrome', options: 'list[str] | None' = None, experimental_options: 'dict |
WR_audit_security_headers |
`(headers: 'dict[str, str]', required: 'list[dict[str, Any]] | None' = None) -> 'list[dict[str, Any]]'` |
WR_audit_security_headers_url |
`(url: 'str', timeout: 'int' = 30, required: 'list[dict[str, Any]] | None' = None) -> 'list[dict[str, Any]]'` |
WR_back |
() -> 'None' |
返回上一頁 / Navigate back |
WR_block_urls |
(patterns: 'list[str]') -> 'None' |
透過 CDP Network.setBlockedURLs 阻擋符合任一 pattern 的請求。 |
WR_bring_to_front |
() -> 'None' |
將瀏覽器視窗叫到最上層 (透過 CDP Page.bringToFront)。 |
WR_browserstack_capabilities |
`(browser_name: 'str' = 'chrome', browser_version: 'str' = 'latest', os_name: 'str' = 'Windows', os_version: 'str' = '11', project: 'str | None' = None, build: 'str |
WR_build_action_schema |
() -> 'dict[str, Any]' |
產生一份描述 action JSON 結構的 Draft 2020-12 Schema |
WR_build_command_reference |
(title: 'str' = 'WebRunner command reference') -> 'str' |
產生整份命令參考(Markdown 字串) |
WR_build_dependency_graph |
(paths: 'Sequence[str]') -> 'dict[str, list[str]]' |
依基本檔名建立 {path: [dep_path, ...]} 圖 |
WR_build_replay_html |
`(records: 'list[dict[str, Any]] | None' = None, screenshot_dir: 'str |
WR_cdp |
`(method: 'str', params: 'dict[str, Any] | None' = None) -> 'Any'` |
WR_change_index_of_webdriver |
(index_of_webdriver: int) -> None |
切換當前 WebDriver |
WR_check_current_webdriver |
(check_dict: 'dict') -> 'None' |
驗證當前 WebDriver 狀態,若不符合會拋出例外 |
WR_chrome_options_with_extension |
`(crx_or_dir: 'str', options: 'ChromeOptions | None' = None) -> 'ChromeOptions'` |
WR_classify_error |
`(error_repr: 'str') -> 'str | None'` |
WR_classify_failure |
`(error_repr: 'str', ledger_path: 'str | None' = None, file_path: 'str |
WR_classify_failures |
`(failures: 'Iterable[dict[str, Any]]', ledger_path: 'str | None' = None) -> 'dict[str, str]'` |
WR_CleanTestObject |
() -> None |
清空所有測試物件紀錄 |
WR_clear_device_metrics |
() -> 'None' |
清除 set_device_metrics 設定。 |
WR_clear_fallback_locators |
() -> 'None' |
|
WR_clear_geolocation_override |
() -> 'None' |
清除 set_geolocation 設定。 |
WR_clear_origin_storage |
(origin: 'str') -> 'None' |
透過 CDP Storage.clearDataForOrigin 一次清掉指定 origin 的所有儲存 |
WR_clear_permissions |
() -> 'None' |
Reset every granted permission. |
WR_clear_test_objects |
() -> None |
清空所有測試物件紀錄 |
WR_click_element |
() -> 'None' |
點擊 WebElement |
WR_clock_freeze |
`(moment: 'str | int |
WR_close_window |
() -> 'None' |
關閉當前 tab / window (不會結束整個 driver;要結束請用 quit) |
WR_connect_browserstack |
`(username: 'str', access_key: 'str', capabilities: 'dict[str, Any] | None' = None, hub_url: 'str |
WR_connect_lambdatest |
`(username: 'str', access_key: 'str', capabilities: 'dict[str, Any] | None' = None, hub_url: 'str |
WR_connect_saucelabs |
`(username: 'str', access_key: 'str', capabilities: 'dict[str, Any] | None' = None, hub_url: 'str |
WR_console_messages |
() -> 'list[dict[str, Any]]' |
{type, text, location} per console message or JavaScript error collected. |
WR_dashboard_start |
(host: 'str' = '127.0.0.1', port: 'int' = 0) -> 'str' |
|
WR_dashboard_stop |
() -> 'None' |
|
WR_db_assert_count |
`(connection_url: 'str', sql: 'str', expected: 'int', params: 'dict[str, Any] | None' = None) -> 'None'` |
WR_db_assert_empty |
`(connection_url: 'str', sql: 'str', params: 'dict[str, Any] | None' = None) -> 'None'` |
WR_db_assert_exists |
`(connection_url: 'str', sql: 'str', params: 'dict[str, Any] | None' = None) -> 'None'` |
WR_db_assert_value |
`(connection_url: 'str', sql: 'str', column: 'str', expected: 'Any', row_index: 'int' = 0, params: 'dict[str, Any] | None' = None) -> 'None'` |
WR_db_query |
`(connection_url: 'str', sql: 'str', params: 'dict[str, Any] | None' = None) -> 'list[dict[str, Any]]'` |
WR_delete_all_cookies |
() -> 'None' |
刪除當前頁面的所有 cookies |
WR_delete_cookie |
(name: 'str') -> 'None' |
刪除指定名稱的 cookie |
WR_delete_snapshot |
(name: 'str', snapshot_dir: 'str' = 'snapshots') -> 'bool' |
Remove a snapshot file; returns True if it existed. |
WR_diff_ab_records |
(records_a: 'list[dict[str, Any]]', records_b: 'list[dict[str, Any]]') -> 'dict[str, Any]' |
比對兩側的 record 序列;回傳每步的差異 |
WR_diff_har |
(left: 'Any', right: 'Any') -> 'dict[str, list[dict[str, Any]]]' |
比對兩份 HAR;回傳 {added, removed, changed} |
WR_diff_har_files |
(left_path: 'str', right_path: 'str') -> 'dict[str, list[dict[str, Any]]]' |
讀取兩個 HAR 檔並比對 / Read two HAR files from disk and diff them. |
WR_disable_fetch_interception |
() -> 'None' |
停止 Fetch 攔截 / Disable Fetch interception. |
WR_dom_mutations |
() -> 'list[dict[str, Any]]' |
{type, target, added, removed, attribute} per DOM mutation collected. |
WR_drag_and_drop |
(element_name: 'str', target_element_name: 'str') -> 'None' |
使用 TestObjectRecord 中的元素名稱,拖曳元素到另一個元素上 |
WR_drag_and_drop_offset |
(element_name: 'str', offset_x: 'int', offset_y: 'int') -> 'None' |
使用 TestObjectRecord 中的元素名稱,拖曳元素到指定偏移位置 |
WR_element_assert |
(check_dict: 'dict') -> 'None' |
檢查當前 WebElement 是否符合指定條件 |
WR_element_change_web_element |
(element_index: 'int') -> 'None' |
切換當前 WebElement |
WR_element_check |
() -> 'None' |
Tick the current checkbox or radio button; nothing happens if it is already selected. |
WR_element_check_current_web_element |
(check_dict: 'dict') -> 'None' |
檢查當前 WebElement 是否符合指定條件 |
WR_element_clear |
() -> 'None' |
清除當前 WebElement 的內容 |
WR_element_click |
() -> 'None' |
點擊 WebElement |
WR_element_get_attribute |
`(name: 'str') -> 'str | None'` |
WR_element_get_dom_attribute |
`(name: 'str') -> 'str | None'` |
WR_element_get_property |
`(name: 'str') -> 'None | str |
WR_element_get_select |
`() -> 'Select | None'` |
WR_element_hover |
() -> 'None' |
Move the mouse over the current element now (WR_move_to_element waits for WR_perform). |
WR_element_inner_html |
`() -> 'str | None'` |
WR_element_inner_text |
() -> 'str' |
The rendered text of the current element. |
WR_element_input |
(input_value: 'str') -> 'None' |
輸入文字到 WebElement |
WR_element_is_displayed |
`() -> 'bool | None'` |
WR_element_is_enabled |
`() -> 'bool | None'` |
WR_element_is_selected |
`() -> 'bool | None'` |
WR_element_screenshot |
`(filename: 'str') -> 'bool | None'` |
WR_element_select_by_index |
(index: 'int') -> 'None' |
以索引選取 選項 |
WR_element_select_by_value |
(value: 'str') -> 'None' |
以 value 屬性選取 選項 |
WR_element_select_by_visible_text |
(text: 'str') -> 'None' |
以可見文字選取 選項 |
WR_element_submit |
() -> 'None' |
提交當前 WebElement |
WR_element_uncheck |
() -> 'None' |
Untick the current checkbox; nothing happens if it is not selected. |
WR_element_value_of_css_property |
`(property_name: 'str') -> 'str | None'` |
WR_emulate_device |
(name: 'str') -> 'None' |
套用具名裝置(utils/device_emulation 預設) |
WR_enable_fetch_interception |
`(patterns: 'list | None' = None, handle_auth: 'bool' = False) -> 'None'` |
WR_event_capture_clear |
() -> 'None' |
Forget what was collected. |
WR_event_capture_start |
(dom_mutations: 'bool' = False) -> 'None' |
開始收集 console、JavaScript 錯誤與網路回應(可選 DOM 變動) |
WR_event_capture_stop |
() -> 'None' |
Stop collecting; what was collected stays until :meth:clear_event_capture. |
WR_execute |
`(driver_command: 'str', params: 'dict | None' = None) -> 'dict |
WR_execute_action |
`(action_list: list | dict) -> dict` |
WR_execute_async_script |
(script: 'str', *args) |
執行非同步 JavaScript |
WR_execute_cdp_cmd |
`(cmd: 'str', cmd_args: 'dict | None' = None)` |
WR_execute_files |
(execute_files_list: list) -> list |
從檔案載入並執行動作 |
WR_execute_script |
(script: 'str', *args) |
在當前頁面執行 JavaScript,回傳 JS 的回傳值。 |
WR_expand_env_in_action |
(data: 'Any') -> 'Any' |
遞迴展開 ${ENV.KEY} 占位符 |
WR_expand_with_row |
(data: 'Any', row: 'dict[str, Any]') -> 'Any' |
遞迴展開 ${ROW.col} 占位符 |
WR_explicit_wait |
`(wait_time: 'int', method: 'typing.Callable | None' = None, until_type: 'bool' = True)` |
WR_explict_wait |
`(wait_time: 'int', method: 'typing.Callable | None' = None, until_type: 'bool' = True)` |
WR_export_action_schema |
(path: 'str') -> 'str' |
將 Schema 寫到 path 並回傳寫出的路徑 |
WR_export_command_reference |
`(path: 'str', title: 'str | None' = None) -> 'str'` |
WR_export_replay_studio |
`(output_path: 'str', records: 'list[dict[str, Any]] | None' = None, screenshot_dir: 'str |
WR_faker |
(method: 'str', *args: 'Any', **kwargs: 'Any') -> 'Any' |
任意 faker provider 的通用呼叫器 |
WR_faker_address |
() -> 'str' |
|
WR_faker_credit_card |
() -> 'str' |
|
WR_faker_email |
() -> 'str' |
|
WR_faker_first_name |
() -> 'str' |
|
WR_faker_last_name |
() -> 'str' |
|
WR_faker_name |
() -> 'str' |
|
WR_faker_password |
(length: 'int' = 12) -> 'str' |
|
WR_faker_phone |
() -> 'str' |
|
WR_faker_seed |
(seed: 'int') -> 'None' |
Set a deterministic seed for reproducible runs. |
WR_faker_text |
`(max_chars: 'int | None' = None) -> 'str'` |
WR_faker_url |
() -> 'str' |
|
WR_faker_user_agent |
() -> 'str' |
|
WR_faker_uuid |
() -> 'str' |
|
WR_fetch_continue_request |
`(request_id: 'str', url: 'str | None' = None, method: 'str |
WR_fetch_fail_request |
(request_id: 'str', error_reason: 'str' = 'Aborted') -> 'None' |
以指定錯誤理由讓被攔截的請求失敗 (用於阻擋 / 模擬網路錯誤)。 |
WR_fetch_fulfill_request |
`(request_id: 'str', response_code: 'int', body=None, response_headers=None, response_phrase: 'str | None' = None) -> 'None'` |
WR_filter_paths |
`(paths: 'Iterable[str]', include: 'Sequence[str] | None' = None, exclude: 'Sequence[str] |
WR_find_element |
`(element_name: 'str') -> 'WebElement | None'` |
WR_find_element_by |
(selector: 'str', by: 'str' = 'css selector') -> 'Any' |
Find by a raw selector (no saved TestObject) and make it the current element. |
WR_find_elements |
`(element_name: 'str') -> 'list[WebElement] | None'` |
WR_find_elements_by |
(selector: 'str', by: 'str' = 'css selector') -> 'list[Any]' |
Find every match of a raw selector; they become the current element list. |
WR_find_recorded_element |
`(element_name: 'str') -> 'WebElement | None'` |
WR_find_recorded_elements |
`(element_name: 'str') -> 'list[WebElement] | None'` |
WR_find_with_healing |
(name: 'str') |
依序嘗試 primary + fallback locator,回傳第一個命中的 WebElement |
WR_flakiness_stats |
(ledger_path: 'str', min_runs: 'int' = 3) -> 'dict[str, dict[str, int]]' |
從 ledger 算出每個檔案的 {runs, passes, fails, flaky} 統計 |
WR_flaky_paths |
(ledger_path: 'str', min_runs: 'int' = 3, min_fail_rate: 'float' = 0.0) -> 'list[str]' |
回傳被判為 flaky 的檔案 |
WR_forward |
() -> 'None' |
前進到下一頁 / Navigate forward |
WR_fullscreen_window |
() -> 'None' |
全螢幕顯示當前視窗 |
WR_generate_all_reports |
`(base_name: 'str', allure_dir: 'str | None' = None, write_manifest: 'bool' = True) -> 'dict[str, Any]'` |
WR_generate_allure |
() -> 'list[dict[str, Any]]' |
將目前的 record list 包成單一 Allure test case |
WR_generate_allure_report |
(output_dir: 'str' = 'allure-results') -> 'list[str]' |
把 test cases 寫成 <uuid>-result.json |
WR_generate_html |
() -> str |
產生完整 HTML 報告字串 |
WR_generate_html_report |
(html_name: str = 'default_name') |
產生並輸出 HTML 報告檔案 |
WR_generate_interactive_html_report |
`(html_name: 'str' = 'default_name', screenshot_dir: 'str | None' = None, har_path: 'str |
WR_generate_json |
() |
產生測試結果的 JSON 結構 |
WR_generate_json_report |
(json_file_name: str = 'default_name') |
產生並輸出 JSON 測試報告 |
WR_generate_junit_xml |
() -> str |
產生 JUnit 格式 XML 字串 |
WR_generate_junit_xml_report |
(junit_file_name: str = 'default_name') -> None |
產生並輸出 JUnit XML 測試報告 |
WR_generate_pom_from_html |
(html: 'str', class_name: 'str') -> 'str' |
Convenience: parse HTML and render the POM class in one call. |
WR_generate_pom_from_url |
(url: 'str', class_name: 'str', timeout: 'int' = 30) -> 'str' |
從 URL 下載 HTML 並產生 POM 類別 |
WR_generate_xml |
() |
產生 XML 結構字串 |
WR_generate_xml_report |
(xml_file_name: str = 'default_name') |
產生並輸出 XML 測試報告 |
WR_get_cookie |
`(name: 'str') -> 'dict | None'` |
WR_get_cookies |
`() -> 'list[dict] | None'` |
WR_get_current_url |
`() -> 'str | None'` |
WR_get_current_window_handle |
`() -> 'str | None'` |
WR_get_env |
`(key: 'str', default: 'str | None' = None) -> 'str |
WR_get_log |
(log_type: 'str') |
取得 WebDriver 日誌(log_type 為必填) |
WR_get_page_source |
`() -> 'str | None'` |
WR_get_screenshot_as_base64 |
`() -> 'str | None'` |
WR_get_screenshot_as_png |
`() -> 'bytes | None'` |
WR_get_title |
`() -> 'str | None'` |
WR_get_webdriver_manager |
`(webdriver_name: str, options: list[str] | None = None, **kwargs) -> None` |
WR_get_window_handles |
`() -> 'list[str] | None'` |
WR_get_window_position |
`(window_handle='current') -> 'dict | None'` |
WR_get_window_rect |
`() -> 'dict | None'` |
WR_gh_emit_failures |
`(stream: 'IO[str] | None' = None, file: 'str |
WR_gh_emit_from_junit_xml |
`(junit_path: 'str', stream: 'IO[str] | None' = None) -> 'list[str]'` |
WR_gh_format_error |
`(message: 'str', file: 'str | None' = None, line: 'int |
WR_grant_permissions |
`(permissions: 'list[str]', origin: 'str | None' = None) -> 'None'` |
WR_http_assert_json_contains |
(key: 'str', expected: 'Any') -> 'None' |
斷言上一次 JSON 回應於 key 的值等於 expected |
WR_http_assert_status |
(expected: 'int') -> 'None' |
斷言上一次回應的 HTTP 狀態碼 |
WR_http_delete |
(url: 'str', **kwargs: 'Any') -> 'dict[str, Any]' |
|
WR_http_get |
(url: 'str', **kwargs: 'Any') -> 'dict[str, Any]' |
|
WR_http_patch |
(url: 'str', **kwargs: 'Any') -> 'dict[str, Any]' |
|
WR_http_post |
(url: 'str', **kwargs: 'Any') -> 'dict[str, Any]' |
|
WR_http_put |
(url: 'str', **kwargs: 'Any') -> 'dict[str, Any]' |
|
WR_http_request |
`(method: 'str', url: 'str', timeout: 'int' = 30, headers: 'dict[str, str] | None' = None, params: 'dict[str, Any] |
WR_iframe_back_to_default |
() -> 'None' |
Return Selenium focus to the top-level frame. |
WR_iframe_switch_chain |
(selectors: 'Sequence[str]') -> 'None' |
依序切換進入多層 iframe(每層用 CSS selector 指定) |
WR_implicitly_wait |
(time_to_wait: 'int') -> 'None' |
設定 Selenium 的隱式等待時間 |
WR_indexed_db_drop |
(db_name: 'str') -> 'None' |
Drop an IndexedDB database by name. Best-effort (Promise resolution skipped). |
WR_input_to_element |
(input_value: 'str') -> 'None' |
輸入文字到 WebElement |
WR_jira_create_failure_issues |
`(base_url: 'str', email: 'str', api_token: 'str', project_key: 'str', issue_type: 'str' = 'Bug', build_url: 'str | None' = None) -> 'list[dict[str, Any]]'` |
WR_jira_create_issue |
`(base_url: 'str', email: 'str', api_token: 'str', project_key: 'str', summary: 'str', description: 'str' = '', issue_type: 'str' = 'Bug', extra_fields: 'dict[str, Any] | None' = None, timeout: 'int' = 30) -> 'dict[str, Any]'` |
WR_lambdatest_capabilities |
`(browser_name: 'str' = 'Chrome', browser_version: 'str' = 'latest', platform_name: 'str' = 'Windows 11', build: 'str | None' = None, name: 'str |
WR_ledger_clear |
(ledger_path: 'str') -> 'None' |
Delete the ledger file (no-op if missing). |
WR_ledger_failed_files |
(ledger_path: 'str') -> 'list[str]' |
Return paths whose most recent run was a failure. |
WR_ledger_passed_files |
(ledger_path: 'str') -> 'list[str]' |
Return paths whose most recent run was a pass. |
WR_ledger_record_run |
(ledger_path: 'str', file_path: 'str', passed: 'bool') -> 'None' |
Append one run record to the ledger. |
WR_left_click |
`(element_name: 'str | None' = None) -> 'None'` |
WR_left_click_and_hold |
`(element_name: 'str | None' = None) -> 'None'` |
WR_left_double_click |
`(element_name: 'str | None' = None) -> 'None'` |
WR_lighthouse_assert_scores |
(result: 'dict[str, Any]', thresholds: 'dict[str, float]') -> 'None' |
斷言所有指定分數皆達門檻 |
WR_lighthouse_run |
`(url: 'str', output_path: 'str | None' = None, lighthouse_path: 'str' = 'lighthouse', chrome_flags: 'list[str] |
WR_lint_action |
(data: 'Any') -> 'list[dict[str, Any]]' |
Walk an action structure and return the findings list. |
WR_lint_action_file |
(path: 'str') -> 'list[dict[str, Any]]' |
Read path (UTF-8 JSON) and lint the contents. |
WR_lint_severity_counts |
(findings: 'list[dict[str, Any]]') -> 'dict[str, int]' |
Aggregate {warning: N, info: M} for reporting. |
WR_list_commands |
() -> 'list[str]' |
Just the command names (handy for shell completion). |
WR_list_devices |
() -> 'list[str]' |
The device preset names :meth:emulate_device accepts. |
WR_list_new_downloads |
(directory: 'str', before: 'list[str]') -> 'list[str]' |
回傳 directory 內目前存在但不在 before 清單中的檔案 |
WR_llm_generate_actions |
`(request: 'str', context: 'str | None' = None) -> 'list[Any]'` |
WR_llm_has_callable |
() -> 'bool' |
|
WR_llm_self_heal_locator |
(name: 'str', html_provider: 'Callable[[], str]') -> 'dict[str, str]' |
當既有 fallback locator 都失敗時,呼叫 LLM 提供新的選擇器 |
WR_llm_set_callable |
`(callable_obj: 'Callable[[str], str] | None') -> 'None'` |
WR_llm_suggest_locator |
(html: 'str', description: 'str') -> 'dict[str, str]' |
讓 LLM 從 HTML 推斷一個合理的 locator |
WR_load_cookies |
(file_path: 'str') -> 'int' |
從 JSON 檔讀回 cookies 並逐筆套用 (恢復先前的登入態)。 |
WR_load_dataset_csv |
(path: 'str', encoding: 'str' = 'utf-8') -> 'list[dict[str, str]]' |
讀取 CSV 為 list of dict(首列為欄位名) |
WR_load_dataset_json |
(path: 'str', encoding: 'str' = 'utf-8') -> 'list[dict[str, Any]]' |
讀取 JSON 為 list of dict |
WR_load_env |
`(env_name: 'str | None' = None, env_dir: 'str' = '.', override: 'bool' = False) -> 'str'` |
WR_local_storage_all |
() -> 'dict' |
|
WR_local_storage_clear |
() -> 'None' |
|
WR_local_storage_get |
`(key: 'str') -> 'str | None'` |
WR_local_storage_remove |
(key: 'str') -> 'None' |
|
WR_local_storage_set |
(key: 'str', value: 'str') -> 'None' |
|
WR_locust_build_user_class |
(actions: 'list[dict[str, Any]]', wait_min: 'float' = 1.0, wait_max: 'float' = 3.0) -> 'type' |
依 actions 動態建立一個 HttpUser 子類別 |
WR_locust_run |
(host: 'str', actions: 'list[dict[str, Any]]', num_users: 'int' = 10, spawn_rate: 'float' = 2.0, run_seconds: 'float' = 60.0, wait_min: 'float' = 1.0, wait_max: 'float' = 3.0) -> 'dict[str, Any]' |
無頭模式跑 Locust 並回傳統計 |
WR_match_snapshot |
(name: 'str', value: 'str', snapshot_dir: 'str' = 'snapshots') -> 'str' |
比對快照;首次執行會建立基準。 |
WR_maximize_window |
() -> 'None' |
最大化當前視窗 |
WR_migrate_action |
(data: 'Any') -> 'tuple[Any, list[dict[str, Any]]]' |
將 action 結構內所有舊命令名改寫為新名 |
WR_migrate_action_file |
(path: 'str', dry_run: 'bool' = True) -> 'dict[str, Any]' |
Read path, rewrite legacy names, optionally write back when |
WR_migrate_directory |
(directory: 'str', dry_run: 'bool' = True) -> 'list[dict[str, Any]]' |
遍歷目錄內所有 .json 檔做遷移 |
WR_minimize_window |
() -> 'None' |
最小化當前視窗 |
WR_move_by_offset |
(offset_x: 'int', offset_y: 'int') -> 'None' |
滑鼠移動指定偏移量 |
WR_move_to_element |
(element_name: 'str') |
使用 TestObjectRecord 中的元素名稱,將滑鼠移動到指定元素 |
WR_move_to_element_with_offset |
(element_name: 'str', offset_x: 'int', offset_y: 'int') -> 'None' |
使用 TestObjectRecord 中的元素名稱,將滑鼠移動到指定元素並加上偏移量 |
WR_network_responses |
() -> 'list[dict[str, Any]]' |
{url, status, method, ok} per response collected. |
WR_new_driver |
`(webdriver_name: str, options: list[str] | None = None, **kwargs) -> None` |
WR_new_window |
(type_hint: 'str' = 'tab') -> 'None' |
開啟新的 tab 或 window,並自動切換到該視窗 |
WR_notify_run_summary |
(webhook_url: 'str', header: 'str' = 'WebRunner Run Summary') -> 'int' |
一鍵:取摘要 → Slack 格式 → 送出 |
WR_notify_slack |
`(webhook_url: 'str', summary: 'dict[str, Any] | None' = None, header: 'str' = 'WebRunner Run Summary') -> 'int'` |
WR_notify_webhook |
`(url: 'str', payload: 'dict[str, Any]', timeout: 'int' = 10, headers: 'dict[str, str] | None' = None) -> 'int'` |
WR_oauth_bearer_header |
(access_token: 'str') -> 'dict[str, str]' |
Convenience: build the Authorization header for HTTP commands. |
WR_oauth_clear_cache |
() -> 'None' |
|
WR_oauth_client_credentials |
`(token_url: 'str', client_id: 'str', client_secret: 'str', scope: 'str | None' = None, cache_key: 'str |
WR_oauth_get_cached |
`(cache_key: 'str') -> 'dict[str, Any] | None'` |
WR_oauth_password_grant |
`(token_url: 'str', client_id: 'str', client_secret: 'str', username: 'str', password: 'str', scope: 'str | None' = None, cache_key: 'str |
WR_oauth_refresh_token |
`(token_url: 'str', client_id: 'str', client_secret: 'str', refresh_token: 'str', cache_key: 'str | None' = None, timeout: 'int' = 30) -> 'dict[str, Any]'` |
WR_order_factory |
(default_currency: 'str' = 'USD') -> 'Factory' |
|
WR_parse_shard_spec |
(spec: 'str') -> 'tuple[int, int]' |
把 "1/4" 解析為 (1, 4) |
WR_partition |
(paths: 'Sequence[str]', index: 'int', total: 'int') -> 'list[str]' |
回傳該 shard 應該執行的檔案路徑(依檔名 SHA-1 對 total 取模) |
WR_partition_with_spec |
(paths: 'Sequence[str]', spec: 'str') -> 'list[str]' |
Convenience: parse the spec then partition. |
WR_pause |
(seconds: 'int') -> 'None' |
暫停指定秒數 (注意:可能導致 Selenium 拋出例外) |
WR_perf_assert_within |
(metrics: 'dict[str, Any]', thresholds: 'dict[str, float]') -> 'None' |
斷言所有指標都不超過上限 |
WR_perf_collect |
(observe_ms: 'int' = 1000) -> 'dict[str, Any]' |
透過 execute_async_script 抓取效能指標 |
WR_perform |
() -> 'None' |
執行累積的 ActionChains 動作 |
WR_press_key |
`(keycode_on_key_class, element_name: 'str | None' = None) -> 'None'` |
WR_print_page |
(file_path: 'str', print_options=None) -> 'bool' |
將當前頁面列印為 PDF 並存檔 (Selenium 4 內建 print_page)。 |
WR_product_factory |
() -> 'Factory' |
|
WR_pw_a11y_run_audit |
`(axe_source: 'str', options: 'dict[str, Any] | None' = None) -> 'dict[str, Any]'` |
WR_pw_add_cookies |
(cookies: 'list[dict]') -> 'None' |
|
WR_pw_add_init_script |
(source: 'str') -> 'None' |
|
WR_pw_assert_no_4xx_or_5xx |
() -> 'None' |
|
WR_pw_assert_no_5xx |
() -> 'None' |
|
WR_pw_assert_no_console_errors |
() -> 'None' |
|
WR_pw_back |
() -> 'None' |
|
WR_pw_block_urls |
(patterns: 'list[str]') -> 'None' |
|
WR_pw_bring_to_front |
() -> 'None' |
|
WR_pw_browser_count |
() -> 'int' |
|
WR_pw_cdp |
`(method: 'str', params: 'dict[str, Any] | None' = None) -> 'Any'` |
WR_pw_cdp_reset_sessions |
() -> 'None' |
Drop cached Playwright CDP sessions (e.g. after browser restart). |
WR_pw_check |
(selector: 'str', **options: 'Any') -> 'None' |
|
WR_pw_check_current_page |
(check_dict: 'dict') -> 'None' |
|
WR_pw_clear_cookies |
() -> 'None' |
|
WR_pw_clear_geolocation |
() -> 'None' |
|
WR_pw_clear_permissions |
() -> 'None' |
|
WR_pw_click |
(selector: 'str', **options: 'Any') -> 'None' |
|
WR_pw_clock_install |
`(fake_now_ms: 'float | None' = None) -> 'None'` |
WR_pw_clock_run_for |
(duration_ms: 'float') -> 'None' |
|
WR_pw_clock_set_time |
(time_ms: 'float') -> 'None' |
|
WR_pw_close_browser |
() -> 'None' |
|
WR_pw_close_page |
`(index: 'int | None' = None) -> 'None'` |
WR_pw_connect |
`(ws_endpoint: 'str', browser: 'str' = 'chromium', context_options: 'dict | None' = None) -> 'None'` |
WR_pw_connect_over_cdp |
(endpoint_url: 'str') -> 'None' |
|
WR_pw_console_messages |
() -> 'list[dict[str, Any]]' |
|
WR_pw_content |
() -> 'str' |
|
WR_pw_dblclick |
(selector: 'str', **options: 'Any') -> 'None' |
|
WR_pw_delete_cookie |
(name: 'str') -> 'None' |
|
WR_pw_download |
(selector: 'str', save_to: 'str') -> 'str' |
|
WR_pw_drag_and_drop |
(source_selector: 'str', target_selector: 'str', **options: 'Any') -> 'None' |
|
WR_pw_drag_and_drop_offset |
(selector: 'str', target_x: 'float', target_y: 'float') -> 'None' |
|
WR_pw_element_assert |
(check_dict: 'dict') -> 'None' |
斷言目前元素的欄位;不符時拋出例外 |
WR_pw_element_change |
(element_index: 'int') -> 'None' |
Switch current_element to current_element_list[element_index]. |
WR_pw_element_check |
() -> 'None' |
|
WR_pw_element_clear |
() -> 'None' |
Clear the value (Playwright equivalent of fill('')) . |
WR_pw_element_click |
() -> 'None' |
|
WR_pw_element_dblclick |
() -> 'None' |
|
WR_pw_element_fill |
(input_value: 'str') -> 'None' |
Fill (replace) the element's value. |
WR_pw_element_get_attribute |
`(name: 'str') -> 'str | None'` |
WR_pw_element_get_property |
(name: 'str') |
Read a JS property via the element handle. |
WR_pw_element_hover |
() -> 'None' |
|
WR_pw_element_inner_html |
`() -> 'str | None'` |
WR_pw_element_inner_text |
`() -> 'str | None'` |
WR_pw_element_is_checked |
() -> 'bool' |
|
WR_pw_element_is_enabled |
() -> 'bool' |
|
WR_pw_element_is_visible |
() -> 'bool' |
|
WR_pw_element_press |
(key: 'str') -> 'None' |
|
WR_pw_element_screenshot |
`(filename: 'str') -> 'str | None'` |
WR_pw_element_scroll_into_view |
() -> 'None' |
|
WR_pw_element_select_option |
`(value: 'str | list |
WR_pw_element_submit |
() -> 'None' |
送出目前元素所在的表單(元素本身是表單時送出它) |
WR_pw_element_type_text |
(input_value: 'str', delay: 'float' = 0) -> 'None' |
Type text key-by-key (analogue of Selenium send_keys). |
WR_pw_element_uncheck |
() -> 'None' |
|
WR_pw_element_value_of_css_property |
`(property_name: 'str') -> 'str | None'` |
WR_pw_emulate |
(device_name: 'str') -> 'None' |
|
WR_pw_evaluate |
(expression: 'str', arg: 'Any' = None) |
|
WR_pw_event_capture_clear |
() -> 'None' |
|
WR_pw_event_capture_start |
() -> 'None' |
Attach the singleton EventCapture to the active Playwright page. |
WR_pw_event_capture_stop |
() -> 'None' |
|
WR_pw_extension_args |
(extension_dir: 'str') -> 'list[str]' |
回傳給 pw_launch(args=...) 用的旗標清單(Chromium only) |
WR_pw_fill |
(selector: 'str', value: 'str', **options: 'Any') -> 'None' |
|
WR_pw_find_by |
(by: 'str', value: 'str', wait: 'bool' = True, **options: 'Any') |
|
WR_pw_find_element |
(selector: 'str') |
|
WR_pw_find_element_with_test_object_record |
(element_name: 'str') |
|
WR_pw_find_elements |
(selector: 'str') -> 'list[Any]' |
|
WR_pw_find_elements_with_test_object_record |
(element_name: 'str') |
|
WR_pw_find_with_healing |
(name: 'str') |
Playwright 版自我修復定位 |
WR_pw_forward |
() -> 'None' |
|
WR_pw_frame_locator_chain |
(selectors: 'Sequence[str]') -> 'Any' |
依序連結 page.frame_locator(selector) 形成深層 frame locator |
WR_pw_get_cookie |
`(name: 'str') -> 'dict | None'` |
WR_pw_get_cookies |
() -> 'list[dict]' |
|
WR_pw_grant_permissions |
`(permissions: 'list[str]', origin: 'str | None' = None) -> 'None'` |
WR_pw_hover |
(selector: 'str', **options: 'Any') -> 'None' |
|
WR_pw_indexed_db_drop |
(db_name: 'str') -> 'None' |
|
WR_pw_keyboard_down |
(key: 'str') -> 'None' |
|
WR_pw_keyboard_press |
(key: 'str') -> 'None' |
|
WR_pw_keyboard_type |
(text: 'str', delay: 'float' = 0) -> 'None' |
|
WR_pw_keyboard_up |
(key: 'str') -> 'None' |
|
WR_pw_last_dialog |
`() -> 'dict | None'` |
WR_pw_launch |
(browser: 'str' = 'chromium', headless: 'bool' = True, **options: 'Any') -> 'None' |
|
WR_pw_launch_persistent |
`(user_data_dir: 'str', browser: 'str' = 'chromium', headless: 'bool' = True, extension_paths: 'list[str] | None' = None, **context_options: 'Any') -> 'None'` |
WR_pw_list_devices |
() -> 'list[str]' |
|
WR_pw_local_storage_all |
() -> 'dict' |
|
WR_pw_local_storage_clear |
() -> 'None' |
|
WR_pw_local_storage_get |
`(key: 'str') -> 'str | None'` |
WR_pw_local_storage_remove |
(key: 'str') -> 'None' |
|
WR_pw_local_storage_set |
(key: 'str', value: 'str') -> 'None' |
|
WR_pw_mouse_click |
(x: 'float', y: 'float', button: 'str' = 'left', click_count: 'int' = 1) -> 'None' |
|
WR_pw_mouse_down |
(button: 'str' = 'left', click_count: 'int' = 1) -> 'None' |
|
WR_pw_mouse_move |
(x: 'float', y: 'float', steps: 'int' = 1) -> 'None' |
|
WR_pw_mouse_up |
(button: 'str' = 'left', click_count: 'int' = 1) -> 'None' |
|
WR_pw_network_responses |
() -> 'list[dict[str, Any]]' |
|
WR_pw_new_browser |
(browser: 'str' = 'chromium', headless: 'bool' = True, **launch_kwargs: 'Any') -> 'int' |
|
WR_pw_new_page |
() -> 'int' |
|
WR_pw_page_count |
() -> 'int' |
|
WR_pw_perf_collect |
(observe_ms: 'int' = 1000) -> 'dict[str, Any]' |
透過 page.evaluate 抓取效能指標 |
WR_pw_press |
(selector: 'str', key: 'str', **options: 'Any') -> 'None' |
|
WR_pw_print_page |
(file_path: 'str') -> 'str' |
|
WR_pw_quit |
() -> 'None' |
|
WR_pw_recorder_pull_events |
() |
|
WR_pw_recorder_save |
(output_path, raw_events_path=None) |
|
WR_pw_recorder_start |
() |
|
WR_pw_recorder_stop |
() |
|
WR_pw_refresh |
() -> 'None' |
|
WR_pw_route_clear |
() -> 'None' |
|
WR_pw_route_mock |
(url_pattern: 'str', response: 'dict') -> 'None' |
|
WR_pw_route_mock_json |
(url_pattern: 'str', json_data: 'Any', status: 'int' = 200) -> 'None' |
|
WR_pw_route_unmock |
(url_pattern: 'str') -> 'None' |
|
WR_pw_save_storage_state |
(path: 'str') -> 'str' |
|
WR_pw_save_test_object_to_selector |
(test_object_name: 'str', object_type: 'str' = 'CSS_SELECTOR') -> 'str' |
把 TestObject 存進 test_object_record 並回傳對應的 Playwright selector |
WR_pw_screenshot |
(path: 'str', full_page: 'bool' = False) -> 'str' |
|
WR_pw_screenshot_base64 |
(full_page: 'bool' = False) -> 'str' |
|
WR_pw_screenshot_bytes |
(full_page: 'bool' = False) -> 'bytes' |
|
WR_pw_scroll |
(scroll_x: 'float', scroll_y: 'float') -> 'None' |
|
WR_pw_scroll_to_bottom |
() -> 'None' |
|
WR_pw_scroll_to_top |
() -> 'None' |
|
WR_pw_select_option |
(selector: 'str', value: 'Any', **options: 'Any') -> 'list[str]' |
|
WR_pw_session_storage_clear |
() -> 'None' |
|
WR_pw_session_storage_get |
`(key: 'str') -> 'str | None'` |
WR_pw_session_storage_set |
(key: 'str', value: 'str') -> 'None' |
|
WR_pw_set_cache_disabled |
(disabled: 'bool' = True) -> 'None' |
|
WR_pw_set_context_options |
(**options: 'Any') -> 'None' |
|
WR_pw_set_default_navigation_timeout |
(timeout_ms: 'float') -> 'None' |
|
WR_pw_set_default_timeout |
(timeout_ms: 'float') -> 'None' |
|
WR_pw_set_dialog_policy |
`(action: 'str' = 'accept', prompt_text: 'str | None' = None) -> 'None'` |
WR_pw_set_extra_http_headers |
(headers: 'dict[str, str]') -> 'None' |
|
WR_pw_set_geolocation |
`(latitude: 'float', longitude: 'float', accuracy: 'float | None' = None) -> 'None'` |
WR_pw_set_locale |
`(locale: 'str', accept_language: 'str | None' = None) -> 'None'` |
WR_pw_set_timezone |
(timezone_id: 'str') -> 'None' |
|
WR_pw_set_user_agent |
(user_agent: 'str') -> 'None' |
|
WR_pw_set_viewport_size |
(width: 'int', height: 'int') -> 'None' |
|
WR_pw_shadow_query |
(host_chain: 'Sequence[str]', inner_selector: 'str') |
Resolve the pierce selector against the active Playwright page. |
WR_pw_shadow_selector |
(host_chain: 'Sequence[str]', inner_selector: 'str') -> 'str' |
把 host 鏈與內層 selector 組成 Playwright >>> (pierce) 選擇器 |
WR_pw_start_har_recording |
(har_path: 'str', content: 'str' = 'omit') -> 'None' |
|
WR_pw_stop_emulate |
() -> 'None' |
|
WR_pw_stop_har_recording |
() -> 'None' |
|
WR_pw_sw_bypass |
(bypass: 'bool' = True) -> 'None' |
Bypass the service worker via CDP on the active Playwright page. |
WR_pw_sw_clear_caches |
() -> 'list[str]' |
|
WR_pw_sw_unregister |
() -> 'list[bool]' |
|
WR_pw_switch_browser |
(index: 'int') -> 'None' |
|
WR_pw_switch_to_frame |
`(selectors: 'str | list[str]') -> 'None'` |
WR_pw_switch_to_main_frame |
() -> 'None' |
|
WR_pw_switch_to_page |
(index: 'int') -> 'None' |
|
WR_pw_switch_to_page_by_title |
(pattern: 'str') -> 'bool' |
|
WR_pw_switch_to_page_by_url |
(pattern: 'str') -> 'bool' |
|
WR_pw_switch_to_parent_frame |
() -> 'None' |
|
WR_pw_throttle |
(preset: 'str') -> 'Any' |
Apply preset via the active Playwright page's CDP session. |
WR_pw_throttle_clear |
() -> 'Any' |
|
WR_pw_title |
() -> 'str' |
|
WR_pw_to_url |
(url: 'str', **goto_options: 'Any') -> 'None' |
|
WR_pw_tracing_save_chunk |
(path: 'str') -> 'str' |
|
WR_pw_tracing_start |
(screenshots: 'bool' = True, snapshots: 'bool' = True, sources: 'bool' = False) -> 'None' |
|
WR_pw_tracing_stop |
(path: 'str') -> 'str' |
|
WR_pw_type_text |
(selector: 'str', value: 'str', delay: 'float' = 0, **options: 'Any') -> 'None' |
|
WR_pw_unblock_urls |
() -> 'None' |
|
WR_pw_uncheck |
(selector: 'str', **options: 'Any') -> 'None' |
|
WR_pw_upload_file |
(input_selector: 'str', file_path: 'str') -> 'None' |
對指定的 file input 送入檔案(Playwright) |
WR_pw_url |
() -> 'str' |
|
WR_pw_video_start |
`(video_dir: 'str', width: 'int | None' = None, height: 'int |
WR_pw_video_stop |
() -> 'list[str]' |
|
WR_pw_viewport_size |
`() -> 'dict | None'` |
WR_pw_visual_capture_baseline |
(baseline_path: 'str') -> 'str' |
:func:capture_baseline for the current Playwright page. |
WR_pw_visual_compare |
`(baseline_path: 'str', diff_path: 'str | None' = None, current_path: 'str |
WR_pw_wait_for_load_state |
`(state: 'str' = 'load', timeout: 'float | None' = None) -> 'None'` |
WR_pw_wait_for_selector |
`(selector: 'str', timeout: 'float | None' = None, state: 'str' = 'visible')` |
WR_pw_wait_for_timeout |
(timeout_ms: 'float') -> 'None' |
|
WR_pw_wait_for_url |
`(url: 'str', timeout: 'float | None' = None) -> 'None'` |
WR_quit |
() -> None |
關閉並退出所有 WebDriver |
WR_quit_all |
() -> None |
關閉並退出所有 WebDriver |
WR_quit_current |
() -> 'None' |
關閉並退出 WebDriver |
WR_read_depends_on |
(path: 'str') -> 'list[str]' |
讀取單一檔案的 meta.depends_on 清單(以 basename 表示)。 |
WR_read_metadata |
(path: 'str') -> 'dict[str, Any]' |
讀取 action 檔的 meta 區塊;若檔案不是 dict 或沒有 meta,回傳空 dict |
WR_recorder_pull_events |
() |
|
WR_recorder_save |
(output_path, raw_events_path=None) |
|
WR_recorder_start |
() |
|
WR_recorder_stop |
() |
|
WR_refresh |
() -> 'None' |
重新整理頁面 / Refresh current page |
WR_register_fallback_locator |
(name: 'str', strategy: 'str', value: 'str') -> 'None' |
Public helper for use as a WR_* command. |
WR_register_fallback_locators |
(name: 'str', fallbacks: 'list[Any]') -> 'None' |
Public helper for use as a WR_* command. |
WR_release |
`(element_name: 'str | None' = None) -> 'None'` |
WR_release_key |
`(keycode_on_key_class, element_name: 'str | None' = None) -> 'None'` |
WR_reload |
(ignore_cache: 'bool' = False) -> 'None' |
重新整理頁面,可選擇是否旁路快取 (透過 CDP Page.reload)。 |
WR_report_expected_paths |
`(base_name: 'str', allure_dir: 'str | None' = None) -> 'dict[str, list[str]]'` |
WR_reset_actions |
() -> 'None' |
清除目前累積的 ActionChains 動作(搭配 WR_perform 使用) |
WR_reset_scheduler |
() -> 'None' |
Drop all registered jobs and counts (mainly for tests). |
WR_right_click |
`(element_name: 'str | None' = None) -> 'None'` |
WR_route_clear |
() -> 'None' |
Remove every mock and stop intercepting. |
WR_route_mock |
`(url_pattern: 'str | dict[str, str]', response: 'dict[str, Any]') -> 'None'` |
WR_route_mock_json |
`(url_pattern: 'str | dict[str, str]', json_data: 'Any', status: 'int' = 200) -> 'None'` |
WR_route_unmock |
`(url_pattern: 'str | dict[str, str]') -> 'None'` |
WR_run_ab |
`(action_data: 'Any', setup_a: 'Callable[[], Any] | None' = None, setup_b: 'Callable[[], Any] |
WR_run_for_users |
`(action_data: 'Any', user_setups: 'list[tuple[str, Callable[[], Any] | None]]', runner: 'Callable[[Any], Any] |
WR_run_scheduler_for |
(seconds: 'float') -> 'None' |
|
WR_run_scheduler_forever |
() -> 'None' |
|
WR_run_with_dataset |
(action_data, rows) |
|
WR_saucelabs_capabilities |
`(browser_name: 'str' = 'chrome', browser_version: 'str' = 'latest', platform_name: 'str' = 'Windows 11', build: 'str | None' = None, name: 'str |
WR_save_cookies |
(file_path: 'str') -> 'bool' |
將當前頁面的 cookies 序列化為 JSON 並寫入檔案 (用於 session reuse)。 |
WR_save_full_page_screenshot |
(file_path: 'str') -> 'bool' |
將整個頁面 (含可視範圍外) 截圖儲存為 PNG,透過 CDP |
WR_save_screenshot |
(file_path: 'str') -> 'bool' |
將當前頁面截圖儲存至指定路徑 (PNG) |
WR_save_test_object |
`(test_object_name: str, object_type: str | None = None, **kwargs) -> None` |
WR_SaveTestObject |
`(test_object_name: str, object_type: str | None = None, **kwargs) -> None` |
WR_scan_secrets |
(data: 'Any') -> 'list[dict[str, Any]]' |
掃描 action 結構,回傳所有疑似秘密的位置 |
WR_scan_secrets_file |
(path: 'str') -> 'list[dict[str, Any]]' |
讀取 action JSON 檔並掃描 / Load an action JSON file and scan it. |
WR_schedule |
(name: 'str', interval_seconds: 'float', callback: 'Callable[[], Any]') -> 'None' |
|
WR_scheduler_counts |
() -> 'dict[str, int]' |
|
WR_scroll |
(scroll_x: 'int', scroll_y: 'int') -> 'None' |
滾動頁面 |
WR_scroll_to_bottom |
() -> 'None' |
捲動到頁面最下方 / Scroll to the bottom of the page |
WR_scroll_to_top |
() -> 'None' |
捲動到頁面最上方 / Scroll to the top of the page |
WR_send_keys |
(keys_to_send) -> 'None' |
發送鍵盤按鍵 (按下並釋放) |
WR_send_keys_to_element |
(element_name: 'str', keys_to_send) -> 'None' |
使用 TestObject 名稱找到元素並發送鍵盤按鍵 |
WR_session_storage_clear |
() -> 'None' |
|
WR_session_storage_get |
`(key: 'str') -> 'str | None'` |
WR_session_storage_set |
(key: 'str', value: 'str') -> 'None' |
|
WR_set_action_span_factory |
(factory: Optional[Callable[[str], Any]]) -> None |
登錄一個 context-manager factory,每個 action 會被它包起來 |
WR_set_allow_arbitrary_script |
(enabled: bool) -> None |
切換是否允許 WR_execute_script / WR_pw_evaluate / CDP 命令 |
WR_set_cache_disabled |
(disabled: 'bool' = True) -> 'None' |
透過 CDP Network.setCacheDisabled 切換 HTTP 快取。 |
WR_set_device_metrics |
(width: 'int', height: 'int', device_scale_factor: 'float' = 1, mobile: 'bool' = False) -> 'None' |
以 CDP Emulation.setDeviceMetricsOverride 覆寫裝置外觀 (viewport / DPR / mobile)。 |
WR_set_download_directory |
(download_path: 'str', behavior: 'str' = 'allow') -> 'None' |
透過 CDP Browser.setDownloadBehavior 指定下載資料夾 (headless 必備)。 |
WR_set_driver |
`(webdriver_name: 'str', webdriver_manager_option_dict: 'dict | None' = None, options: 'list[str] |
WR_set_extra_http_headers |
(headers: 'dict') -> 'None' |
以 CDP Network.setExtraHTTPHeaders 為所有後續請求附加 header。 |
WR_set_failure_screenshot_dir |
`(path: str | None) -> None` |
WR_set_geolocation |
(latitude: 'float', longitude: 'float', accuracy: 'float' = 100) -> 'None' |
以 CDP Emulation.setGeolocationOverride 覆寫地理位置。 |
WR_set_locale |
(locale: 'str') -> 'None' |
以 CDP Emulation.setLocaleOverride 覆寫語系。 |
WR_set_network_conditions |
(offline: 'bool' = False, latency: 'float' = 0, download_throughput: 'float' = -1, upload_throughput: 'float' = -1) -> 'None' |
以 CDP Network.emulateNetworkConditions 模擬網路條件 (離線、節流)。 |
WR_set_page_load_timeout |
(time_to_wait: 'int') -> 'None' |
設定頁面載入最大等待時間 / Set max page load wait time |
WR_set_raise_wrapper_errors |
(enabled: bool) -> None |
設定 Selenium wrapper 失敗時是否讓動作失敗 |
WR_set_record_enable |
(set_enable: bool = True) |
開啟或關閉紀錄功能 |
WR_set_retry_policy |
(retries: int = 0, backoff: float = 0.0) -> None |
設定全域重試策略 |
WR_set_script_timeout |
(time_to_wait: 'int') -> 'None' |
設定 script 最大執行時間 / Set max script execution time |
WR_set_timezone |
(timezone_id: 'str') -> 'None' |
以 CDP Emulation.setTimezoneOverride 覆寫時區。 |
WR_set_user_agent |
(user_agent: 'str') -> 'None' |
以 CDP Network.setUserAgentOverride 動態覆寫 User-Agent。 |
WR_set_webdriver_options_capability |
`(key_and_vale_dict: 'dict') -> 'Options | None'` |
WR_set_window_position |
`(x: 'int', y: 'int', window_handle: 'str' = 'current') -> 'dict | None'` |
WR_set_window_rect |
`(x: 'int | None' = None, y: 'int |
WR_set_window_size |
(width: 'int', height: 'int', window_handle: 'str' = 'current') -> 'None' |
設定視窗大小 |
WR_shadow_query |
(host_chain: 'Sequence[str]', inner_selector: 'str') -> 'Any' |
在巢狀 Shadow DOM 中查詢 |
WR_single_quit |
() -> 'None' |
關閉並退出 WebDriver |
WR_skip_dependents_of_failed |
(graph: 'dict[str, list[str]]', failed: 'Iterable[str]') -> 'list[str]' |
回傳因為上游失敗而應該跳過的檔案 |
WR_sleep |
`(seconds: 'int | float' = 1) -> 'float'` |
WR_snapshot_directory |
(directory: 'str') -> 'list[str]' |
Take a snapshot of resolved file paths under directory. |
WR_start_har_recording |
() -> 'None' |
Start recording every request and response of the driver into a HAR log. |
WR_start_remote_driver |
(hub_url: 'str', capabilities: 'dict[str, Any]', register: 'bool' = True) -> 'WebDriver' |
啟動 Remote WebDriver;預設將其註冊到 webdriver_wrapper_instance |
WR_stop_har_recording |
`(har_path: 'str | None') -> 'str |
WR_stop_scheduler |
() -> 'None' |
|
WR_summarise_run |
() -> 'dict[str, Any]' |
從 test_record_instance 產生 pass/fail 統計 |
WR_sw_bypass |
(bypass: 'bool' = True) -> 'None' |
透過 CDP 設定 ServiceWorker bypass(僅 Chromium 系) |
WR_sw_clear_caches |
() -> 'list[str]' |
清空 Cache Storage |
WR_sw_unregister |
() -> 'list[bool]' |
解除註冊當前頁面所有 Service Worker |
WR_switch |
`(switch_type: 'str', switch_target_name: 'str | None' = None)` |
WR_switch_to_window_by_title |
(pattern: 'str') -> 'bool' |
遍歷所有 window handle,切換到第一個 title 含 pattern 子字串的視窗。 |
WR_switch_to_window_by_url |
(pattern: 'str') -> 'bool' |
遍歷所有 window handle,切換到第一個 URL 含 pattern 子字串的視窗。 |
WR_tc_cleanup_all |
() -> 'None' |
Stop every container started by this module. |
WR_tc_generic |
`(image: 'str', ports: 'dict[int, int] | None' = None) -> 'Any'` |
WR_tc_postgres |
(image: 'str' = 'postgres:16-alpine', username: 'str' = 'test', password: 'str' = 'test', dbname: 'str' = 'test') -> 'Any' |
啟動暫存 Postgres,回傳 container 實例(含 get_connection_url()) |
WR_tc_redis |
(image: 'str' = 'redis:7-alpine') -> 'Any' |
|
WR_tc_started_count |
() -> 'int' |
How many containers are tracked as live by this module. |
WR_tc_stop |
(container: 'Any') -> 'None' |
Stop a single container started by this module. |
WR_testrail_close_run |
(base_url: 'str', username: 'str', api_key: 'str', run_id: 'int', timeout: 'int' = 30) -> 'dict[str, Any]' |
關閉指定的 TestRail run |
WR_testrail_results_from_pairs |
(pairs: 'Iterable[dict[str, Any]]', comment_field: 'str' = 'comment') -> 'list[dict[str, Any]]' |
把 [{case_id, passed, comment?}] 轉成 TestRail status_id 格式 |
WR_testrail_send_results |
(base_url: 'str', username: 'str', api_key: 'str', run_id: 'int', results: 'list[dict[str, Any]]', timeout: 'int' = 30) -> 'dict[str, Any]' |
將結果送到 add_results_for_cases/{run_id} |
WR_throttle |
(preset: 'str') -> 'Any' |
Apply preset via the active Selenium driver's CDP channel. |
WR_throttle_clear |
() -> 'Any' |
Convenience for the no_throttling preset. |
WR_throttle_presets |
() -> 'list' |
Return all registered preset names. |
WR_to_url |
(url: 'str') -> 'None' |
導航到指定 URL |
WR_topological_order |
(graph: 'dict[str, list[str]]') -> 'list[str]' |
Kahn 演算法拓樸排序;偵測環時拋例外 |
WR_unblock_urls |
() -> 'None' |
清空 block_urls 列表。 |
WR_update_snapshot |
(name: 'str', value: 'str', snapshot_dir: 'str' = 'snapshots') -> 'str' |
強制覆蓋基準 |
WR_upload_file |
(input_selector: 'str', file_path: 'str') -> 'None' |
對 <input type="file"> 送入檔案路徑(Selenium) |
WR_user_factory |
(prefix: 'str' = 'user') -> 'Factory' |
Default user shape: id / name / email / password. |
WR_validate_action_file |
(json_file_path: 'str') -> 'bool' |
讀取並驗證動作 JSON 檔案 |
WR_validate_action_json |
`(data: 'list | dict') -> 'bool'` |
WR_visual_capture_baseline |
(baseline_path: 'str', screenshot: 'Callable[[], bytes]' = <function _selenium_png at 0x000002232B775080>) -> 'str' |
擷取當前頁面並儲存為基準圖 |
WR_visual_compare |
`(baseline_path: 'str', diff_path: 'str | None' = None, current_path: 'str |
WR_wait_for_download |
`(directory: 'str', timeout: 'float' = 60.0, suffix: 'str | None' = None, poll_seconds: 'float' = 0.5) -> 'str'` |
WR_wait_for_element |
(selector: 'str', by: 'str' = 'css selector', timeout: 'float' = 10.0, state: 'str' = 'visible') -> 'Any' |
等元素出現(present / visible / clickable)或消失(hidden) |
WR_wait_for_ready_state |
(timeout: 'float' = 30.0) -> 'bool' |
Wait until document.readyState is complete. |
WR_wait_for_title |
(pattern: 'str', timeout: 'float' = 10.0) -> 'bool' |
Wait until the page title contains pattern. |
WR_wait_for_url |
(pattern: 'str', timeout: 'float' = 10.0) -> 'bool' |
Wait until the current URL contains pattern. |
WR_write_pom_to_file |
(source: 'str', output_path: 'str') -> 'str' |
Write generated source to output_path; returns the path written. |