SurfCustomCalabash 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8782b3ba7379e77beba7c31b9228786433cc91fd
4
- data.tar.gz: ecdc8ed6ea807fb080178260f3d8804f3d563e4a
3
+ metadata.gz: e73d1efe2c27051f07e282d3333f7591546657a6
4
+ data.tar.gz: 9222e603e080d754d57fcc558442ecfe9bd8506b
5
5
  SHA512:
6
- metadata.gz: 699a83b0f4263972ccabe4e79853d025e0d0d6b2bbbf4357f5b0ea846583f48ffb5cc560283f63499060fb8e17505666a1d22d8f6625e9b0be396d1613747166
7
- data.tar.gz: 4fba7507932a38fa1df61b3e738ca81392c752959321e98eb7aabad81ae583f5315d0dab729e62121bbd78d5363a9a330dca211cfa329840b168a793b47a436d
6
+ metadata.gz: d67946642ce9a73eead39a8da90222da783c4207bd2b158abd6be37a8e13093009148769065311e59b2a10e6856bd7ce1fea30c39d99aefae733a2520d88e785
7
+ data.tar.gz: 9831c0ea47f2f93877ec466762efac94398b5b5fd462047cf4d5aa4eb0bf90fb51df61846d7223f4a0684f4a8fb13d37777262a8271beeb4dbba2d0df0bd9e0e
data/Gemfile CHANGED
@@ -6,5 +6,4 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6
6
  gemspec
7
7
 
8
8
  gem 'calabash-android'
9
- gem 'rspec/expectations'
10
- gem 'unicode'
9
+ gem 'rspec/expectations'
@@ -3,7 +3,7 @@ require "SurfCustomCalabash/version"
3
3
  module SurfCustomCalabash
4
4
  class Error < StandardError; end
5
5
  # Your code goes here...
6
- require 'SurfCustomCalabash/DroidCommon'
7
- require 'SurfCustomCalabash/IosCommon'
6
+ require 'SurfCustomCalabash/DroidMethods'
7
+ require 'SurfCustomCalabash/IosMethods'
8
8
  require 'SurfCustomCalabash/CommonMethods'
9
9
  end
@@ -1,4 +1,4 @@
1
- require 'unicode'
1
+ require 'rspec/expectations'
2
2
 
3
3
  module CommonMethods
4
4
 
@@ -149,14 +149,6 @@ module CommonMethods
149
149
  return get_random_text_string(7) + "@" + get_random_text_string(2) + ".test"
150
150
  end
151
151
 
152
- def down_case(text)
153
- Unicode::downcase text
154
- end
155
-
156
- def up_case(text)
157
- Unicode::upcase text
158
- end
159
-
160
152
  # get text from first element
161
153
  def remember(element)
162
154
  wait_for_element_exists(element, :timeout => 5)
@@ -213,4 +205,28 @@ module CommonMethods
213
205
  return cross
214
206
  end
215
207
 
208
+ # if apps support two localization, this method check exists text in different locations
209
+ def text_with_locale(text_locale1, text_locale2)
210
+ if element_exists("* {text BEGINSWITH '#{text_locale2}'}")
211
+ puts (element_exists("* {text BEGINSWITH '#{text_locale2}'}"))
212
+ return "* {text BEGINSWITH '#{text_locale2}'}"
213
+ elsif element_exists("* {text BEGINSWITH '#{text_locale1}'}")
214
+ puts(element_exists("* {text BEGINSWITH '#{text_locale1}'}"))
215
+ return "* {text BEGINSWITH '#{text_locale1}'}"
216
+ else
217
+ return ("No such query!")
218
+ end
219
+ end
220
+
221
+ # if apps support two localization, this method check exists label in different locations
222
+ def label_with_locale(mark1, mark2)
223
+ if element_exists("* marked:'#{mark1}'")
224
+ return "* marked:'#{mark1}'"
225
+ elsif element_exists("* marked:'#{mark2}'")
226
+ return "* marked:'#{mark2}'"
227
+ else
228
+ return false
229
+ end
230
+ end
231
+
216
232
  end
@@ -1,30 +1,10 @@
1
1
  require 'calabash-android'
2
- require 'rspec/expectations'
3
2
  require 'SurfCustomCalabash/CommonMethods'
4
3
 
5
- class DroidCommon
6
-
4
+ module DroidMethods
7
5
  include Calabash::Android::Operations
8
6
  include CommonMethods
9
7
 
10
- def initialize(driver)
11
- @driver = driver
12
- end
13
-
14
- def method_missing (sym, *args, &block)
15
- @driver.send sym, *args, &block
16
- end
17
-
18
- def self.element(name, &block)
19
- define_method(name.to_s, &block)
20
- end
21
-
22
- class << self
23
- alias :value :element
24
- alias :action :element
25
- alias :trait :element
26
- end
27
-
28
8
  def close_keyboard
29
9
  if keyboard_visible?
30
10
  hide_soft_keyboard
@@ -1,28 +1,9 @@
1
1
  require 'calabash-cucumber/ibase'
2
2
  require 'SurfCustomCalabash/CommonMethods'
3
3
 
4
- class IosCommon < Calabash::IBase
5
-
4
+ module IosMethods
6
5
  include CommonMethods
7
6
 
8
- def initialize(driver)
9
- @driver = driver
10
- end
11
-
12
- def method_missing (sym, *args, &block)
13
- @driver.send sym, *args, &block
14
- end
15
-
16
- def self.element(name, &block)
17
- define_method(name.to_s, &block)
18
- end
19
-
20
- class << self
21
- alias :value :element
22
- alias :action :element
23
- alias :trait :element
24
- end
25
-
26
7
  #----------------------------------------------Custom Swipe iOS-------------------------------------------------------
27
8
  def strong_swipe(dir)
28
9
  if dir == 'left'
@@ -1,3 +1,3 @@
1
1
  module SurfCustomCalabash
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SurfCustomCalabash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Hripunov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-14 00:00:00.000000000 Z
11
+ date: 2019-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -71,8 +71,8 @@ files:
71
71
  - bin/setup
72
72
  - lib/SurfCustomCalabash.rb
73
73
  - lib/SurfCustomCalabash/CommonMethods.rb
74
- - lib/SurfCustomCalabash/DroidCommon.rb
75
- - lib/SurfCustomCalabash/IosCommon.rb
74
+ - lib/SurfCustomCalabash/DroidMethods.rb
75
+ - lib/SurfCustomCalabash/IosMethods.rb
76
76
  - lib/SurfCustomCalabash/version.rb
77
77
  homepage: https://github.com/alexeyhripunov/SurfCustomCalabash
78
78
  licenses: