splinter 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -121,6 +121,14 @@ module Splinter
|
|
121
121
|
page.evaluate_script("window.confirm = window.original_confirm;")
|
122
122
|
end
|
123
123
|
|
124
|
+
# Finds a link inside a row and clicks it.
|
125
|
+
#
|
126
|
+
# lookup - the link text to look for
|
127
|
+
# row_content - the text to use when looking for a row
|
128
|
+
def click_link_inside_row(lookup, row_content)
|
129
|
+
find(:xpath, "//tr[contains(.,'#{row_content}')]/td/a", :text => lookup).click
|
130
|
+
end
|
131
|
+
|
124
132
|
private
|
125
133
|
|
126
134
|
def select_prefix_from_options(options)
|
data/lib/splinter/version.rb
CHANGED
@@ -95,4 +95,16 @@ describe Splinter, :type => :request do
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
98
|
+
|
99
|
+
describe "#click_link_inside_row" do
|
100
|
+
before do
|
101
|
+
visit "/"
|
102
|
+
end
|
103
|
+
|
104
|
+
it "finds and click a link" do
|
105
|
+
click_link_inside_row "World", "Hello"
|
106
|
+
|
107
|
+
current_path.should == "/click_link_inside_row"
|
108
|
+
end
|
109
|
+
end
|
98
110
|
end
|
data/spec/test_app/server.rb
CHANGED
@@ -267,6 +267,16 @@
|
|
267
267
|
</p>
|
268
268
|
</form>
|
269
269
|
|
270
|
+
<table id="click_link_inside_row">
|
271
|
+
<tr>
|
272
|
+
<td>Some</td>
|
273
|
+
<td><a href="#">Link</a></td>
|
274
|
+
</tr>
|
275
|
+
<tr>
|
276
|
+
<td>Hello</td>
|
277
|
+
<td><a href="/click_link_inside_row">World</a></td>
|
278
|
+
</tr>
|
279
|
+
</table>
|
270
280
|
|
271
281
|
</body>
|
272
282
|
</html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: splinter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capybara
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 1.1.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 1.1.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rspec
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,3 +140,4 @@ signing_key:
|
|
140
140
|
specification_version: 3
|
141
141
|
summary: Splinter is a Capybara Ninja
|
142
142
|
test_files: []
|
143
|
+
has_rdoc:
|