92 lines
2.1 KiB
YAML
92 lines
2.1 KiB
YAML
|
|
params:
|
||
|
|
baidu_url: www.baidu.com
|
||
|
|
search_text: "你好"
|
||
|
|
|
||
|
|
steps:
|
||
|
|
- id: wait_new_tab_chrome
|
||
|
|
action: wait_for
|
||
|
|
timeout_ms: 10000
|
||
|
|
target:
|
||
|
|
window_title: "新标签页 - Google Chrome"
|
||
|
|
class_name: Chrome_WidgetWin_1
|
||
|
|
control_type: WindowControl
|
||
|
|
|
||
|
|
- id: focus_address_bar
|
||
|
|
action: click
|
||
|
|
waits:
|
||
|
|
- type: wait_for
|
||
|
|
selector:
|
||
|
|
name: 地址和搜索栏
|
||
|
|
class_name: Chrome_WidgetWin_1
|
||
|
|
control_type: EditControl
|
||
|
|
timeout_ms: 5000
|
||
|
|
target:
|
||
|
|
name: 地址和搜索栏
|
||
|
|
class_name: Chrome_WidgetWin_1
|
||
|
|
control_type: EditControl
|
||
|
|
|
||
|
|
- id: type_baidu_url
|
||
|
|
action: type
|
||
|
|
text_param: baidu_url
|
||
|
|
send_enter: true
|
||
|
|
waits:
|
||
|
|
- type: wait_for
|
||
|
|
selector:
|
||
|
|
window_title: "百度一下,你就知道 - Google Chrome"
|
||
|
|
class_name: Chrome_WidgetWin_1
|
||
|
|
control_type: WindowControl
|
||
|
|
timeout_ms: 15000
|
||
|
|
target:
|
||
|
|
name: 地址和搜索栏
|
||
|
|
class_name: Chrome_WidgetWin_1
|
||
|
|
control_type: EditControl
|
||
|
|
|
||
|
|
- id: click_baidu_search_box
|
||
|
|
action: click
|
||
|
|
waits:
|
||
|
|
- type: wait_for
|
||
|
|
selector:
|
||
|
|
control_type: EditControl
|
||
|
|
timeout_ms: 5000
|
||
|
|
target:
|
||
|
|
control_type: EditControl
|
||
|
|
|
||
|
|
- id: type_search_text
|
||
|
|
action: type
|
||
|
|
text_param: search_text
|
||
|
|
send_enter: true
|
||
|
|
waits:
|
||
|
|
- type: wait_for
|
||
|
|
selector:
|
||
|
|
window_title_contains_param: search_text
|
||
|
|
class_name: Chrome_WidgetWin_1
|
||
|
|
control_type: WindowControl
|
||
|
|
timeout_ms: 15000
|
||
|
|
target:
|
||
|
|
control_type: EditControl
|
||
|
|
|
||
|
|
assertions:
|
||
|
|
- id: assert_baidu_home_opened
|
||
|
|
action: assert_exists
|
||
|
|
selector:
|
||
|
|
window_title: "百度一下,你就知道 - Google Chrome"
|
||
|
|
class_name: Chrome_WidgetWin_1
|
||
|
|
control_type: WindowControl
|
||
|
|
timeout_ms: 5000
|
||
|
|
|
||
|
|
- id: assert_search_result_page
|
||
|
|
action: assert_exists
|
||
|
|
selector:
|
||
|
|
window_title_contains_param: search_text
|
||
|
|
class_name: Chrome_WidgetWin_1
|
||
|
|
control_type: WindowControl
|
||
|
|
timeout_ms: 10000
|
||
|
|
|
||
|
|
retry_policy:
|
||
|
|
max_attempts: 2
|
||
|
|
interval: 1.0
|
||
|
|
|
||
|
|
waits:
|
||
|
|
appear: 5.0
|
||
|
|
disappear: 5.0
|