SurfCustomCalabash 0.1.7 → 0.1.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e4de4a6c1d6a35f5de695fa6b77244fef2274f8
|
4
|
+
data.tar.gz: 46d22f0d943ea780e1473260c9c417ac25ced891
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63b95cd838c704068f02b7cb151e7a6bc2f7fb720edd861bc6f0e3f71d299acf16564105a28e096ed2b763c53d9d6966e9c546e1f905b8a3cad75365231cf549
|
7
|
+
data.tar.gz: 80f508a5a6e11806174305f88206a0f6ad76a5056b20dcf27bcab795c2833cb50c485a8baaf7a4857d140b068a94168628ccaf189a793c221b248a70003b7323
|
@@ -7,9 +7,9 @@ require 'rspec/expectations'
|
|
7
7
|
|
8
8
|
# ----------------------------------------------Custom Taps-----------------------------------------------------------
|
9
9
|
# wait element and tap
|
10
|
-
|
11
|
-
wait_for_elements_exist(element, :timeout=>
|
12
|
-
sleep(
|
10
|
+
def tap_on(element, timeout_duration: 15, sleep_duration: 0.5)
|
11
|
+
wait_for_elements_exist(element, :timeout=>timeout_duration, :retry_frequency=>5)
|
12
|
+
sleep(sleep_duration)
|
13
13
|
touch(element)
|
14
14
|
end
|
15
15
|
|
@@ -18,90 +18,92 @@ require 'rspec/expectations'
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# if element exists - tap, if not - swipe until element exists and tap
|
21
|
-
|
21
|
+
def tap_or_swipe(element, timeout_duration: 30)
|
22
22
|
if element_exists(element)
|
23
|
-
sleep(
|
23
|
+
sleep(2)
|
24
24
|
touch(element)
|
25
25
|
else
|
26
|
-
until_element_exists(element,:action => lambda{light_swipe('down')}, :timeout =>
|
26
|
+
until_element_exists(element,:action => lambda{light_swipe('down')}, :timeout => timeout_duration)
|
27
27
|
light_swipe('down')
|
28
|
-
sleep(
|
28
|
+
sleep(2)
|
29
29
|
touch(element)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
# ----------------------------------------------------Custom Waits----------------------------------------------------
|
34
|
-
def wait_element(element)
|
35
|
-
wait_for_element_exists(element, :timeout=>
|
34
|
+
def wait_element(element, timeout_duration: 15)
|
35
|
+
wait_for_element_exists(element, :timeout=>timeout_duration)
|
36
36
|
end
|
37
37
|
|
38
|
-
def wait_no_element(element)
|
39
|
-
wait_for_element_does_not_exist(element, :timeout=>
|
38
|
+
def wait_no_element(element, timeout_duration: 15)
|
39
|
+
wait_for_element_does_not_exist(element, :timeout=>timeout_duration)
|
40
40
|
end
|
41
41
|
|
42
42
|
# wait trait-element on screen
|
43
|
-
def wait_for_screen
|
44
|
-
wait_for_elements_exist(trait, :timeout=>
|
43
|
+
def wait_for_screen(timeout_duration: 25)
|
44
|
+
wait_for_elements_exist(trait, :timeout=>timeout_duration)
|
45
45
|
end
|
46
46
|
|
47
47
|
# ----------------------------------------------------Custom Swipe----------------------------------------------------
|
48
|
-
def strong_swipe_until_not_exist(dir, element_destination)
|
48
|
+
def strong_swipe_until_not_exist(dir, element_destination, timeout_duration: 40)
|
49
49
|
until_element_does_not_exist(element_destination,
|
50
|
-
:action => lambda{strong_swipe(dir)})
|
50
|
+
:action => lambda{strong_swipe(dir)}, :timeout => timeout_duration)
|
51
51
|
end
|
52
52
|
|
53
|
-
def normal_swipe_until_not_exist(dir, element_destination)
|
53
|
+
def normal_swipe_until_not_exist(dir, element_destination, timeout_duration: 40)
|
54
54
|
until_element_does_not_exist(element_destination,
|
55
|
-
:action => lambda{normal_swipe(dir)})
|
55
|
+
:action => lambda{normal_swipe(dir)}, :timeout => timeout_duration)
|
56
56
|
end
|
57
57
|
|
58
|
-
def light_swipe_until_not_exist(dir, element_destination)
|
58
|
+
def light_swipe_until_not_exist(dir, element_destination, timeout_duration: 40)
|
59
59
|
until_element_does_not_exist(element_destination,
|
60
|
-
:action => lambda{light_swipe( dir)})
|
60
|
+
:action => lambda{light_swipe( dir)}, :timeout => timeout_duration)
|
61
61
|
end
|
62
62
|
|
63
|
-
def strong_swipe_until_exists(dir, element_destination)
|
63
|
+
def strong_swipe_until_exists(dir, element_destination, timeout_duration: 40)
|
64
64
|
until_element_exists(element_destination,
|
65
|
-
:action => lambda{strong_swipe( dir)})
|
65
|
+
:action => lambda{strong_swipe( dir)}, :timeout => timeout_duration)
|
66
66
|
end
|
67
67
|
|
68
|
-
def normal_swipe_until_exists(dir, element_destination)
|
68
|
+
def normal_swipe_until_exists(dir, element_destination, sleep_duration: 2, timeout_duration: 40)
|
69
69
|
until_element_exists(element_destination,
|
70
|
-
:action => lambda{normal_swipe( dir); sleep(
|
70
|
+
:action => lambda{normal_swipe( dir); sleep(sleep_duration)}, :timeout=>timeout_duration)
|
71
71
|
end
|
72
72
|
|
73
|
-
def light_swipe_until_exists(dir, element_destination)
|
73
|
+
def light_swipe_until_exists(dir, element_destination, sleep_duration: 2, timeout_duration: 40)
|
74
74
|
until_element_exists(element_destination,
|
75
|
-
:action => lambda{light_swipe( dir); sleep(
|
75
|
+
:action => lambda{light_swipe( dir); sleep(sleep_duration)}, :timeout=>timeout_duration)
|
76
76
|
|
77
77
|
end
|
78
78
|
|
79
|
-
def strong_swipe_element_until_exists(dir, element, element_destination)
|
79
|
+
def strong_swipe_element_until_exists(dir, element, element_destination, timeout_duration: 40)
|
80
80
|
until_element_exists(element_destination,
|
81
|
-
:action => lambda{strong_swipe_element(element, dir)})
|
81
|
+
:action => lambda{strong_swipe_element(element, dir)}, :timeout=>timeout_duration)
|
82
82
|
end
|
83
83
|
|
84
|
-
def light_swipe_element_until_exists(dir, element, element_destination)
|
84
|
+
def light_swipe_element_until_exists(dir, element, element_destination, timeout_duration: 40)
|
85
85
|
until_element_exists(element_destination,
|
86
|
-
:action => lambda{light_swipe_element(element, dir)}, :timeout=>
|
86
|
+
:action => lambda{light_swipe_element(element, dir)}, :timeout=>timeout_duration)
|
87
87
|
end
|
88
88
|
|
89
|
-
def strong_swipe_element_until_not_exists(dir, element, element_destination)
|
89
|
+
def strong_swipe_element_until_not_exists(dir, element, element_destination, timeout_duration: 40)
|
90
90
|
until_element_does_not_exist(element_destination,
|
91
|
-
:action => lambda{pan(element, dir)})
|
91
|
+
:action => lambda{pan(element, dir)}, :timeout=>timeout_duration)
|
92
92
|
end
|
93
93
|
|
94
|
-
def light_swipe_element_until_not_exists(dir, element, element_destination)
|
94
|
+
def light_swipe_element_until_not_exists(dir, element, element_destination, timeout_duration: 40)
|
95
95
|
until_element_does_not_exist(element_destination,
|
96
|
-
:action => lambda{light_swipe_element(element, dir)}, :timeout=>
|
96
|
+
:action => lambda{light_swipe_element(element, dir)}, :timeout=>timeout_duration)
|
97
97
|
end
|
98
98
|
|
99
|
-
def swipe_to_text(dir, text)
|
99
|
+
def swipe_to_text(dir, text, timeout_duration: 60)
|
100
100
|
sleep(1)
|
101
|
-
if dir == '
|
102
|
-
until_element_exists("* {text CONTAINS'#{text}'}", :action => lambda{light_swipe('up');
|
103
|
-
|
104
|
-
|
101
|
+
if dir == 'up'
|
102
|
+
until_element_exists("* {text CONTAINS'#{text}'}", :action => lambda{light_swipe('up');
|
103
|
+
sleep(1)}, :timeout => timeout_duration)
|
104
|
+
elsif dir == 'down'
|
105
|
+
until_element_exists("* {text CONTAINS'#{text}'}", :action => lambda{light_swipe('down');
|
106
|
+
sleep(1.5)}, :timeout => timeout_duration)
|
105
107
|
end
|
106
108
|
end
|
107
109
|
|
@@ -110,7 +112,7 @@ require 'rspec/expectations'
|
|
110
112
|
begin
|
111
113
|
expect(element1).to eq(element2)
|
112
114
|
true
|
113
|
-
rescue
|
115
|
+
rescue RSpec::Expectations::ExpectationNotMetError
|
114
116
|
false
|
115
117
|
end
|
116
118
|
end
|
@@ -169,8 +171,8 @@ require 'rspec/expectations'
|
|
169
171
|
end
|
170
172
|
|
171
173
|
# get text from first element
|
172
|
-
def remember(element)
|
173
|
-
wait_for_element_exists(element, :timeout =>
|
174
|
+
def remember(element, timeout_duration: 5)
|
175
|
+
wait_for_element_exists(element, :timeout => timeout_duration)
|
174
176
|
sleep(1.5)
|
175
177
|
name = query(element)
|
176
178
|
save_name = name.first['text']
|
@@ -179,8 +181,8 @@ require 'rspec/expectations'
|
|
179
181
|
end
|
180
182
|
|
181
183
|
# get text from last element
|
182
|
-
def remember_last_text(element)
|
183
|
-
wait_for_element_exists(element, :timeout =>
|
184
|
+
def remember_last_text(element, timeout_duration: 5)
|
185
|
+
wait_for_element_exists(element, :timeout => timeout_duration)
|
184
186
|
sleep(1.5)
|
185
187
|
name = query(element)
|
186
188
|
save_name = name.last['text']
|
@@ -189,12 +191,12 @@ require 'rspec/expectations'
|
|
189
191
|
end
|
190
192
|
|
191
193
|
# wait text
|
192
|
-
def check_text(text)
|
193
|
-
wait_for_element_exists("* {text CONTAINS'#{text}'}", :timeout =>
|
194
|
+
def check_text(text, timeout_duration: 5)
|
195
|
+
wait_for_element_exists("* {text CONTAINS'#{text}'}", :timeout => timeout_duration, :retry_frequency => 2)
|
194
196
|
end
|
195
197
|
|
196
|
-
def no_check_text(text)
|
197
|
-
wait_for_element_does_not_exist("* {text CONTAINS'#{text}'}", :timeout =>
|
198
|
+
def no_check_text(text, timeout_duration: 5)
|
199
|
+
wait_for_element_does_not_exist("* {text CONTAINS'#{text}'}", :timeout => timeout_duration, :retry_frequency => 5)
|
198
200
|
end
|
199
201
|
|
200
202
|
# get element's coordinates
|
@@ -77,9 +77,9 @@ require 'SurfCustomCalabash/CommonMethods'
|
|
77
77
|
end
|
78
78
|
|
79
79
|
# swipe trait-element from element_destination
|
80
|
-
def light_swipe_trait_until_exists(dir, element_destination)
|
80
|
+
def light_swipe_trait_until_exists(dir, element_destination, timeout_duration: 50)
|
81
81
|
until_element_exists(element_destination,
|
82
|
-
:action => lambda{light_swipe_element(trait, dir)}, :timeout=>
|
82
|
+
:action => lambda{light_swipe_element(trait, dir)}, :timeout=>timeout_duration)
|
83
83
|
end
|
84
84
|
|
85
85
|
# pull-to-refresh screen
|
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.8
|
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-
|
11
|
+
date: 2019-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|