splinter 0.0.8 → 0.1.0
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/splinter/capybara/actions.rb +5 -13
- data/lib/splinter/rspec.rb +2 -2
- data/lib/splinter/version.rb +1 -1
- data/spec/splinter/capybara/actions_spec.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7f9a91d2107588dae76e0904e8c5c27b5a4649e
|
4
|
+
data.tar.gz: def9ed48cc1a20aa7bb5269793cb915dee364e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d24c3bc71bb5cde5028a084d3f50ffd5354d8bec53ec543e7875e46dc0e19d7c433a305668c7ae89d78c3fee4e04de62f9e257eca2a53eae3214b2647205b55
|
7
|
+
data.tar.gz: db71ccb0aeaacbf25ec50b9c1f02a451b89aa70beb0d25703dd3c7b8ea533d4bf96f22df7f93471ca77ebdbaf0b01fbade572c121180742b7e1bef271e354553
|
@@ -107,13 +107,10 @@ module Splinter
|
|
107
107
|
# select_id - CSS ID to check, do *not* include #
|
108
108
|
# value - The value to select.
|
109
109
|
def find_and_select_option(select_id, value)
|
110
|
-
|
111
|
-
option_err = "cannot select option, no option with text '#{value}' in select box '##{select_id}'"
|
112
|
-
|
113
|
-
select = find(:css, "##{select_id}", :message => select_err)
|
110
|
+
select = find(:css, "##{select_id}")
|
114
111
|
path = ".//option[contains(./@value, '#{value}')]"
|
115
112
|
|
116
|
-
select.find(:xpath, path
|
113
|
+
select.find(:xpath, path).select_option
|
117
114
|
end
|
118
115
|
|
119
116
|
# Simulates a javascript alert confirmation. You need to pass in a block that will
|
@@ -145,17 +142,12 @@ module Splinter
|
|
145
142
|
raise ArgumentError, "You must supply either :from or :id_prefix option"
|
146
143
|
end
|
147
144
|
|
148
|
-
|
149
|
-
select_prefix ||= find_prefix_by_label(options[:from])
|
150
|
-
|
151
|
-
select_prefix
|
145
|
+
options[:id_prefix] || find_prefix_by_label(options[:from])
|
152
146
|
end
|
153
147
|
|
154
148
|
def find_prefix_by_label(label)
|
155
|
-
|
156
|
-
path
|
157
|
-
|
158
|
-
find(:xpath, path, :message => message).text.sub(/_\di$/, '')
|
149
|
+
path = "//label[contains(normalize-space(string(.)), '#{label}')]/@for"
|
150
|
+
find(:xpath, path).text(:all).sub(/_\di$/, '')
|
159
151
|
end
|
160
152
|
end
|
161
153
|
end
|
data/lib/splinter/rspec.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require "splinter/capybara"
|
2
2
|
|
3
3
|
RSpec.configure do |config|
|
4
|
-
config.include Splinter::Capybara::Actions, :type => :
|
4
|
+
config.include Splinter::Capybara::Actions, :type => :feature
|
5
5
|
|
6
|
-
config.after :each, :type => :
|
6
|
+
config.after :each, :type => :feature do
|
7
7
|
take_screenshot! if Splinter.screenshot_directory &&
|
8
8
|
example.exception && example.metadata[:js]
|
9
9
|
|
data/lib/splinter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: splinter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Priddle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.13.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.13.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sinatra
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|