Skip to content

Instantly share code, notes, and snippets.

@saikrishna321
Created March 16, 2015 07:17
Show Gist options
  • Save saikrishna321/231840bee2d81d822d31 to your computer and use it in GitHub Desktop.
Save saikrishna321/231840bee2d81d822d31 to your computer and use it in GitHub Desktop.
Validate if keyboard is visible in calabash android
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