wist 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/wist.rb +11 -4
- data/test/tests/wist_test.rb +5 -1
- data/wist.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4aa5f441eb74f8fae874d4e3493410d32fdb11a1
|
4
|
+
data.tar.gz: eea7f1657d43671176f1ce373daf62f0742d190e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 565621550f29574538d051cbf9176682894b97a1379fc54914cdf26eb8a694bf856e49fdb28b7873346516163c595b22fd5505a7a0eba85ba0b6b611db3ddffb
|
7
|
+
data.tar.gz: 18b403d2a1634b5beb53e6bd54cda75ef42842ac2e4e6ddc740604f5467e14ae12e4bccfcb88dff8ecf7e06c9b512bc20e4c2a6c78532323f6ef365656a809e4
|
data/Gemfile.lock
CHANGED
data/lib/wist.rb
CHANGED
@@ -128,14 +128,21 @@ module Wist
|
|
128
128
|
klass.split(' ').include?(class_name)
|
129
129
|
end
|
130
130
|
|
131
|
+
def process_el_or_selector(el_or_selector)
|
132
|
+
if el_or_selector.is_a?(String)
|
133
|
+
find(el_or_selector, visible: true)
|
134
|
+
else
|
135
|
+
el_or_selector
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
131
139
|
def wait_for_new_url(element_to_click = nil)
|
132
140
|
old_url = current_url
|
133
141
|
|
134
142
|
if element_to_click.nil?
|
135
143
|
yield
|
136
144
|
else
|
137
|
-
|
138
|
-
element_to_click.click
|
145
|
+
process_el_or_selector(element_to_click).click
|
139
146
|
end
|
140
147
|
|
141
148
|
sleep 1
|
@@ -180,8 +187,8 @@ module Wist
|
|
180
187
|
raise "visit #{url} failed" unless status == 'success'
|
181
188
|
end
|
182
189
|
|
183
|
-
def assert_text(text,
|
184
|
-
wist_assert(
|
190
|
+
def assert_text(text, el_or_selector)
|
191
|
+
wist_assert(process_el_or_selector(el_or_selector).text, text)
|
185
192
|
end
|
186
193
|
|
187
194
|
def assert_text_include(text, el)
|
data/test/tests/wist_test.rb
CHANGED
@@ -98,6 +98,10 @@ class WistTest < CapybaraTestCase
|
|
98
98
|
verify_test_page(1)
|
99
99
|
end
|
100
100
|
|
101
|
+
def test_process_el_or_selector
|
102
|
+
assert_equal(process_el_or_selector('body'), process_el_or_selector(find('body')))
|
103
|
+
end
|
104
|
+
|
101
105
|
def test_wait_for_new_url_with_block
|
102
106
|
wait_for_new_url { click('#wait_for_new_url_test') }
|
103
107
|
verify_test_page(1)
|
@@ -219,4 +223,4 @@ class WistTest < CapybaraTestCase
|
|
219
223
|
assert_el_has_link('#switch_window_test', 'foo')
|
220
224
|
end
|
221
225
|
end
|
222
|
-
end
|
226
|
+
end
|
data/wist.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lihan Li
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|