Sha256: 9f50aa0bf86fce5d03ff6d988c60a6dbf734734064ea0d8771d44d78d852ec18
Contents?: true
Size: 873 Bytes
Versions: 19
Compression:
Stored size: 873 Bytes
Contents
module Calabash module Cucumber module QueryHelpers def escape_quotes(str) str.gsub("'", "\\\\'") end def point_from(query_result, options={}) offset_x = 0 offset_y = 0 if options[:offset] offset_x += options[:offset][:x] || 0 offset_y += options[:offset][:y] || 0 end x = offset_x y = offset_y rect = query_result['rect'] || query_result[:rect] if rect x += rect['center_x'] || rect[:center_x] || rect[:x] || 0 y += rect['center_y'] || rect[:center_y] || rect[:y] || 0 else x += query_result['center_x'] || query_result[:center_x] || query_result[:x] || 0 y += query_result['center_y'] || query_result[:center_y] || query_result[:y] || 0 end {:x => x, :y => y} end end end end
Version data entries
19 entries across 19 versions & 1 rubygems