marty_rspec 0.0.6 → 0.0.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 +4 -4
- data/lib/marty_rspec/util.rb +11 -8
- data/lib/marty_rspec/version.rb +1 -1
- data/spec/marty_rspec_spec.rb +1 -2
- data/spec/spec_helper.rb +0 -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: 9bcf7bb4bb58a1894fd93aa572aae218e085a4a8
|
4
|
+
data.tar.gz: 78355bce7fe0eecd7d55d21cf22caf66d2d3c7ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22b9b19a99f871b8fb62e8690017fea55beaad444b15e92eea3b68126c0f27763047d926a0f340c55d3f8c47a0a0d5200329bd98a7e5548bf7a03fbc42b30ac5
|
7
|
+
data.tar.gz: 2e6f10e5b71edc89f12cbb69439e879d7588f97649693a18d5daabac3db5d1dc12e39fbc7a577b74b3a4a48fcb9eb39d14f4c111a4658e6eb9471e73f4b3701b
|
data/lib/marty_rspec/util.rb
CHANGED
@@ -27,11 +27,13 @@ module MartyRSpec
|
|
27
27
|
press("Sign out")
|
28
28
|
end
|
29
29
|
|
30
|
-
def press button_name,
|
30
|
+
def press button_name, args = {}
|
31
|
+
index_of = args[:index_of] || 0
|
32
|
+
strict = args[:strict] || false
|
31
33
|
wait_for_element do
|
32
34
|
begin
|
33
35
|
cmp = first("a[data-qtip='#{button_name}']")
|
34
|
-
cmp ||= first(:xpath, ".//a", text: "#{button_name}")
|
36
|
+
cmp ||= first(:xpath, ".//a", text: "#{button_name}") unless strict
|
35
37
|
cmp ||= find(:btn, button_name, match: :first)
|
36
38
|
cmp.click
|
37
39
|
true
|
@@ -175,23 +177,24 @@ module MartyRSpec
|
|
175
177
|
end
|
176
178
|
|
177
179
|
# Field edit/Key in Helpers
|
178
|
-
def type_in(type_s,
|
179
|
-
|
180
|
+
def type_in(type_s, el, args = {})
|
181
|
+
extra_keys = args[:extra_keys] || [:enter]
|
182
|
+
el = find_by_id("#{el}") if el.is_a? String
|
180
183
|
el.native.clear()
|
181
184
|
type_s.each_char do |key|
|
182
185
|
el.native.send_keys(key)
|
183
186
|
end
|
184
|
-
el.send_keys(
|
187
|
+
el.send_keys(extra_keys)
|
185
188
|
end
|
186
189
|
|
187
|
-
def press_key_in(key,
|
190
|
+
def press_key_in(key, el)
|
188
191
|
kd = key.downcase
|
189
192
|
use_key = ['enter', 'return'].include?(kd) ? kd.to_sym : key
|
190
|
-
el = find_by_id("#{
|
193
|
+
el = find_by_id("#{el}") if el.is_a? String
|
191
194
|
el.native.send_keys(use_key)
|
192
195
|
end
|
193
196
|
|
194
|
-
# Netzke component lookups, arguments for helper methods
|
197
|
+
# Netzke component lookups, arguments for helper methods
|
195
198
|
# (i.e. component) require JS scripts instead of objects
|
196
199
|
def ext_arg(component, c_args = {})
|
197
200
|
res = component
|
data/lib/marty_rspec/version.rb
CHANGED
data/spec/marty_rspec_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marty_rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Matsuo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|