android_tests/lib/android/specs/common/device.rb in appium_lib-2.1.0 vs android_tests/lib/android/specs/common/device.rb in appium_lib-3.0.0
- old
+ new
@@ -39,18 +39,18 @@
t 'current_context' do
wait { current_context.must_equal 'NATIVE_APP' }
end
t 'set_context' do
- wait do
- scroll_to('Views').click
- scroll_to('WebView').click
- set_context 'WEBVIEW'
- current_context.must_equal 'WEBVIEW_1'
- end
+ wait { scroll_to('Views').click }
+ wait { scroll_to('WebView').click }
+ wait { set_context 'WEBVIEW' }
+ wait { current_context.must_equal 'WEBVIEW_1' }
- set_context 'NATIVE_APP'
+ wait { set_context 'NATIVE_APP' }
+ wait { current_context.must_equal 'NATIVE_APP' }
+
2.times { back; sleep 1 }
end
t 'within_context' do
$driver.within_context 'NATIVE_APP' do
@@ -64,14 +64,11 @@
current_context.must_equal 'NATIVE_APP'
end
end
t 'app_strings' do
- wait do
- strs = app_strings
- strs.has_key?('activity_save_restore').must_equal true
- end
+ wait_true { app_strings.has_key? 'activity_save_restore' }
end
def must_return_element element
element.class.must_equal Selenium::WebDriver::Element
end
@@ -114,12 +111,12 @@
pinch 75
end
end
t 'push and pull file' do
+ file = 'A Fine Day'
+ path = '/data/local/tmp/remote.txt'
wait do
- file = "A Fine Day"
- path = "/data/local/tmp/remote.txt"
push_file path, file
read_file = pull_file path
read_file.must_equal file
end
end
\ No newline at end of file