android_tests/lib/android/specs/common/device.rb in appium_lib-1.0.0 vs android_tests/lib/android/specs/common/device.rb in appium_lib-2.0.0
- old
+ new
@@ -18,11 +18,11 @@
wait { is_installed?('fake_app').must_equal false }
end
t 'reset' do
reset
- wait { s_text(1).text.must_equal 'API Demos' }
+ wait { text(1).text.must_equal 'API Demos' }
end
t 'close & launch' do
close_app
launch
@@ -38,15 +38,20 @@
t 'current_context' do
wait { current_context.must_equal 'NATIVE_APP' }
end
- t 'current_context=' do
+ t 'set_context' do
wait do
- current_context= 'WEBVIEW'
- current_context.must_equal 'WEBVIEW'
+ scroll_to('Views').click
+ scroll_to('WebView').click
+ set_context 'WEBVIEW'
+ current_context.must_equal 'WEBVIEW_1'
end
+
+ set_context 'NATIVE_APP'
+ 2.times { back; sleep 1 }
end
t 'within_context' do
$driver.within_context 'NATIVE_APP' do
wait { current_context.must_equal 'NATIVE_APP' }
@@ -88,19 +93,24 @@
e = find_element(:name, 'Accessibility')
Appium::TouchAction.new.press(:element => e, x: 0.5, y: 0.5).release(:element => e).perform
end
wait { find_element(:name, 'Custom View') }
back
+ wait { text_exact 'NFC' }
end
t 'swipe' do
wait { Appium::TouchAction.new.swipe(start_x: 0.75, start_y: 0.25, end_x: 0.75, end_y: 0.5, duration: 1.5).perform }
+ wait { !exists { text_exact 'NFC' } }
+ back
+ wait { text_exact 'NFC' }
end
t 'pinch & zoom' do
+ wait { text_exact 'NFC' }
+ wait { text_exact('Graphics').click }
+ wait { text('BitmapMesh').click }
wait do
- s_text('Graphics').click
- s_text('BitmapMesh').click
zoom 200
pinch 75
end
end
\ No newline at end of file