android_tests/lib/android/specs/common/device.rb in appium_lib-6.0.0 vs android_tests/lib/android/specs/common/device.rb in appium_lib-7.0.0
- old
+ new
@@ -1,16 +1,16 @@
# rake android[common/device]
describe 'common/device' do
# Not yet implemented
t 'shake' do
- # todo: write test
+ # TODO: write test
end
t 'remove & install' do
- # todo: write test
- #remove 'com.example.android.apis'
- #install ENV['APP_PATH']
+ # TODO: write test
+ # remove 'com.example.android.apis'
+ # install ENV['APP_PATH']
end
t 'background_app' do
wait { background_app 5 }
end
@@ -22,33 +22,40 @@
start_activity app_package: 'com.android.settings', app_activity: '.Settings',
app_wait_package: 'com.android.settings', app_wait_activity: '.Settings'
wait { current_activity.include?('Settings').must_equal true }
end
- t 'is_installed' do
- wait { is_installed?('fake_app').must_equal false }
+ t 'installed' do
+ wait { app_installed?('fake_app').must_equal false }
end
t 'reset' do
reset
wait { text(1).text.must_equal 'API Demos' }
end
+ t 'device_locked?' do
+ lock 5
+ wait { device_locked?.must_equal true }
+ press_keycode 82
+ wait { device_locked?.must_equal false }
+ end
+
t 'close & launch' do
close_app
launch_app
end
t 'current_activity' do
wait { current_activity.must_equal '.ApiDemos' }
end
t 'app_strings' do
- wait_true { app_strings.has_key? 'activity_save_restore' }
+ wait_true { app_strings.key? 'activity_save_restore' }
end
- def must_return_element element
+ def must_return_element(element)
element.class.must_equal Selenium::WebDriver::Element
end
t 'press_keycode' do
# http://developer.android.com/reference/android/view/KeyEvent.html
@@ -101,6 +108,6 @@
t 'pull_folder' do
data = pull_folder '/data/local/tmp'
data.length.must_be :>, 100
end
-end
\ No newline at end of file
+end