SurfCustomCalabash 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/lib/SurfCustomCalabash.rb +2 -2
- data/lib/SurfCustomCalabash/CommonMethods.rb +25 -9
- data/lib/SurfCustomCalabash/{DroidCommon.rb → DroidMethods.rb} +1 -21
- data/lib/SurfCustomCalabash/{IosCommon.rb → IosMethods.rb} +1 -20
- data/lib/SurfCustomCalabash/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e73d1efe2c27051f07e282d3333f7591546657a6
|
4
|
+
data.tar.gz: 9222e603e080d754d57fcc558442ecfe9bd8506b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d67946642ce9a73eead39a8da90222da783c4207bd2b158abd6be37a8e13093009148769065311e59b2a10e6856bd7ce1fea30c39d99aefae733a2520d88e785
|
7
|
+
data.tar.gz: 9831c0ea47f2f93877ec466762efac94398b5b5fd462047cf4d5aa4eb0bf90fb51df61846d7223f4a0684f4a8fb13d37777262a8271beeb4dbba2d0df0bd9e0e
|
data/Gemfile
CHANGED
data/lib/SurfCustomCalabash.rb
CHANGED
@@ -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/
|
7
|
-
require 'SurfCustomCalabash/
|
6
|
+
require 'SurfCustomCalabash/DroidMethods'
|
7
|
+
require 'SurfCustomCalabash/IosMethods'
|
8
8
|
require 'SurfCustomCalabash/CommonMethods'
|
9
9
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
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
|
-
|
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
|
-
|
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'
|
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.
|
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-
|
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/
|
75
|
-
- lib/SurfCustomCalabash/
|
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:
|