Created
March 16, 2015 07:17
-
-
Save saikrishna321/231840bee2d81d822d31 to your computer and use it in GitHub Desktop.
Validate if keyboard is visible in calabash android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then(/^i should see the keyboard on the screen$/) do | |
assert_true(keyboard_visible?, 'Keyboard was not displayed') | |
end | |
def keyboard_visible? | |
system('adb shell dumpsys input_method > system_prop.txt') | |
if File.open('system_prop.txt').lines.any? { |line| line.include?('mInputShown=true') } | |
return true | |
else | |
return false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment