bauxite 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Bauxite/Action.html +102 -1
- data/doc/Bauxite/ActionModule.html +1 -1
- data/doc/Bauxite/Application.html +1 -1
- data/doc/Bauxite/Context.html +1 -1
- data/doc/Bauxite/Errors/AssertionError.html +1 -1
- data/doc/Bauxite/Errors/FileNotFoundError.html +1 -1
- data/doc/Bauxite/Errors/FormatError.html +1 -1
- data/doc/Bauxite/Errors.html +1 -1
- data/doc/Bauxite/Loggers/CompositeLogger.html +1 -1
- data/doc/Bauxite/Loggers/EchoLogger.html +1 -1
- data/doc/Bauxite/Loggers/FileLogger.html +1 -1
- data/doc/Bauxite/Loggers/NullLogger.html +1 -1
- data/doc/Bauxite/Loggers/TerminalLogger.html +1 -1
- data/doc/Bauxite/Loggers/XtermLogger.html +1 -1
- data/doc/Bauxite/Loggers.html +1 -1
- data/doc/Bauxite/Parser.html +1 -1
- data/doc/Bauxite/ParserModule.html +1 -1
- data/doc/Bauxite/Selector.html +85 -1
- data/doc/Bauxite/SelectorModule.html +1 -1
- data/doc/Bauxite.html +1 -1
- data/doc/README_md.html +1 -1
- data/doc/created.rid +46 -43
- data/doc/index.html +1 -1
- data/doc/js/jquery.js +18 -4
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +63 -48
- data/lib/bauxite/actions/select.rb +48 -0
- data/lib/bauxite/actions/submit.rb +37 -0
- data/lib/bauxite/selectors/smart.rb +74 -0
- data/lib/bauxite.rb +1 -1
- data/test/select/page.html +9 -0
- data/test/select.bxt +9 -0
- data/test/smart_selector/page.html +13 -0
- data/test/smart_selector.bxt +11 -0
- data/test/submit/page.html +7 -0
- data/test/submit/page2.html +5 -0
- data/test/submit.bxt +4 -0
- metadata +11 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff6775d805df3867861598c574b723a829915881
|
4
|
+
data.tar.gz: b89f4a63f828908954334e3007bb2db4beb980aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c6d221343fd711016288d105ffb1f14d905527c23d5a4c62759a8837ac526ecba48dfdec2dcef920a1e377fe73f61f0df82d02eff2c1f7a8999c1e67e4e8e42
|
7
|
+
data.tar.gz: 2d9df0072b5841c102b4185e9118ee932f4656e83894a5cd7ebed4d956f3d23cda61be50b2106200b1dc8e33deabfd7945dc12ec06c02d52cd50578a09e1d2d9
|
data/doc/Bauxite/Action.html
CHANGED
@@ -127,12 +127,16 @@
|
|
127
127
|
|
128
128
|
<li ><a href="#method-i-ruby">#ruby</a>
|
129
129
|
|
130
|
+
<li ><a href="#method-i-select">#select</a>
|
131
|
+
|
130
132
|
<li ><a href="#method-i-set">#set</a>
|
131
133
|
|
132
134
|
<li ><a href="#method-i-source">#source</a>
|
133
135
|
|
134
136
|
<li ><a href="#method-i-store">#store</a>
|
135
137
|
|
138
|
+
<li ><a href="#method-i-submit">#submit</a>
|
139
|
+
|
136
140
|
<li ><a href="#method-i-test">#test</a>
|
137
141
|
|
138
142
|
<li ><a href="#method-i-tryload">#tryload</a>
|
@@ -1096,6 +1100,61 @@ href="Context.html">Context</a> instance as its only argument.</p>
|
|
1096
1100
|
|
1097
1101
|
|
1098
1102
|
|
1103
|
+
</div>
|
1104
|
+
|
1105
|
+
|
1106
|
+
<div id="method-i-select" class="method-detail ">
|
1107
|
+
|
1108
|
+
<div class="method-heading">
|
1109
|
+
<span class="method-name">select</span><span
|
1110
|
+
class="method-args">(selector, text)</span>
|
1111
|
+
|
1112
|
+
<span class="method-click-advice">click to toggle source</span>
|
1113
|
+
|
1114
|
+
</div>
|
1115
|
+
|
1116
|
+
|
1117
|
+
<div class="method-description">
|
1118
|
+
|
1119
|
+
<p>Sets the value of the selected <code>HTMLSelect</code> to
|
1120
|
+
<code>text</code>.</p>
|
1121
|
+
|
1122
|
+
<p><code>text</code> can be the <code>value</code> or the <code>text</code> of
|
1123
|
+
the target <code>HTMLOption</code>.</p>
|
1124
|
+
|
1125
|
+
<p>For example:</p>
|
1126
|
+
|
1127
|
+
<pre class="ruby"><span class="ruby-comment"># assuming <select id="s"></span>
|
1128
|
+
<span class="ruby-comment"># <option value="one">First</option></span>
|
1129
|
+
<span class="ruby-comment"># <option value="two">Second</option></span>
|
1130
|
+
<span class="ruby-comment"># </select></span>
|
1131
|
+
<span class="ruby-identifier">select</span> <span class="ruby-identifier">s</span> <span class="ruby-constant">Second</span>
|
1132
|
+
<span class="ruby-identifier">select</span> <span class="ruby-identifier">s</span> <span class="ruby-identifier">two</span>
|
1133
|
+
<span class="ruby-comment"># => both actions select the second option.</span>
|
1134
|
+
</pre>
|
1135
|
+
|
1136
|
+
|
1137
|
+
|
1138
|
+
|
1139
|
+
<div class="method-source-code" id="select-source">
|
1140
|
+
<pre><span class="ruby-comment"># File lib/bauxite/actions/select.rb, line 38</span>
|
1141
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-identifier">text</span>)
|
1142
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
|
1143
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Support</span><span class="ruby-operator">::</span><span class="ruby-constant">Select</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">e</span>)
|
1144
|
+
<span class="ruby-keyword">begin</span>
|
1145
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">select_by</span>(<span class="ruby-value">:value</span>, <span class="ruby-identifier">text</span>)
|
1146
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">NoSuchElementError</span>
|
1147
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">select_by</span>(<span class="ruby-value">:text</span>, <span class="ruby-identifier">text</span>)
|
1148
|
+
<span class="ruby-keyword">end</span>
|
1149
|
+
<span class="ruby-keyword">end</span>
|
1150
|
+
<span class="ruby-keyword">end</span></pre>
|
1151
|
+
</div>
|
1152
|
+
|
1153
|
+
</div>
|
1154
|
+
|
1155
|
+
|
1156
|
+
|
1157
|
+
|
1099
1158
|
</div>
|
1100
1159
|
|
1101
1160
|
|
@@ -1237,6 +1296,48 @@ href="Context.html#method-i-expand">Bauxite::Context#expand</a>).</p>
|
|
1237
1296
|
|
1238
1297
|
|
1239
1298
|
|
1299
|
+
</div>
|
1300
|
+
|
1301
|
+
|
1302
|
+
<div id="method-i-submit" class="method-detail ">
|
1303
|
+
|
1304
|
+
<div class="method-heading">
|
1305
|
+
<span class="method-name">submit</span><span
|
1306
|
+
class="method-args">(selector)</span>
|
1307
|
+
|
1308
|
+
<span class="method-click-advice">click to toggle source</span>
|
1309
|
+
|
1310
|
+
</div>
|
1311
|
+
|
1312
|
+
|
1313
|
+
<div class="method-description">
|
1314
|
+
|
1315
|
+
<p>Submits the form that contains the selected element.</p>
|
1316
|
+
|
1317
|
+
<p>For example:</p>
|
1318
|
+
|
1319
|
+
<pre class="ruby"><span class="ruby-comment"># assuming <form><input id="i"/></form></span>
|
1320
|
+
<span class="ruby-identifier">submit</span> <span class="ruby-identifier">i</span>
|
1321
|
+
<span class="ruby-comment"># => this would submit the form</span>
|
1322
|
+
</pre>
|
1323
|
+
|
1324
|
+
|
1325
|
+
|
1326
|
+
|
1327
|
+
<div class="method-source-code" id="submit-source">
|
1328
|
+
<pre><span class="ruby-comment"># File lib/bauxite/actions/submit.rb, line 32</span>
|
1329
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">submit</span>(<span class="ruby-identifier">selector</span>)
|
1330
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
|
1331
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">submit</span>
|
1332
|
+
<span class="ruby-keyword">end</span>
|
1333
|
+
<span class="ruby-keyword">end</span></pre>
|
1334
|
+
</div>
|
1335
|
+
|
1336
|
+
</div>
|
1337
|
+
|
1338
|
+
|
1339
|
+
|
1340
|
+
|
1240
1341
|
</div>
|
1241
1342
|
|
1242
1343
|
|
@@ -1461,7 +1562,7 @@ href="Context.html#method-i-expand">Bauxite::Context#expand</a>).</p>
|
|
1461
1562
|
|
1462
1563
|
<footer id="validator-badges" role="contentinfo">
|
1463
1564
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
1464
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
1565
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
1465
1566
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1466
1567
|
</footer>
|
1467
1568
|
|
@@ -336,7 +336,7 @@ might yield different results.</p>
|
|
336
336
|
|
337
337
|
<footer id="validator-badges" role="contentinfo">
|
338
338
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
339
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
339
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
340
340
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
341
341
|
</footer>
|
342
342
|
|
@@ -245,7 +245,7 @@ indicates success).</p>
|
|
245
245
|
|
246
246
|
<footer id="validator-badges" role="contentinfo">
|
247
247
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
248
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
248
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
249
249
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
250
250
|
</footer>
|
251
251
|
|
data/doc/Bauxite/Context.html
CHANGED
@@ -1482,7 +1482,7 @@ variables is restored.</p>
|
|
1482
1482
|
|
1483
1483
|
<footer id="validator-badges" role="contentinfo">
|
1484
1484
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
1485
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
1485
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
1486
1486
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1487
1487
|
</footer>
|
1488
1488
|
|
@@ -101,7 +101,7 @@
|
|
101
101
|
|
102
102
|
<footer id="validator-badges" role="contentinfo">
|
103
103
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
104
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
104
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
105
105
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
106
106
|
</footer>
|
107
107
|
|
@@ -101,7 +101,7 @@
|
|
101
101
|
|
102
102
|
<footer id="validator-badges" role="contentinfo">
|
103
103
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
104
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
104
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
105
105
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
106
106
|
</footer>
|
107
107
|
|
@@ -101,7 +101,7 @@
|
|
101
101
|
|
102
102
|
<footer id="validator-badges" role="contentinfo">
|
103
103
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
104
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
104
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
105
105
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
106
106
|
</footer>
|
107
107
|
|
data/doc/Bauxite/Errors.html
CHANGED
@@ -94,7 +94,7 @@
|
|
94
94
|
|
95
95
|
<footer id="validator-badges" role="contentinfo">
|
96
96
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
97
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
97
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
98
98
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
99
99
|
</footer>
|
100
100
|
|
@@ -319,7 +319,7 @@ first logger.</p>
|
|
319
319
|
|
320
320
|
<footer id="validator-badges" role="contentinfo">
|
321
321
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
322
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
322
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
323
323
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
324
324
|
</footer>
|
325
325
|
|
@@ -159,7 +159,7 @@ action succeeded, failed or was skipped).</p>
|
|
159
159
|
|
160
160
|
<footer id="validator-badges" role="contentinfo">
|
161
161
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
162
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
162
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
163
163
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
164
164
|
</footer>
|
165
165
|
|
@@ -209,7 +209,7 @@ file specified in the <code>file</code> logger option.</p>
|
|
209
209
|
|
210
210
|
<footer id="validator-badges" role="contentinfo">
|
211
211
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
212
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
212
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
213
213
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
214
214
|
</footer>
|
215
215
|
|
@@ -328,7 +328,7 @@ href="../Context.html#method-i-debug">Bauxite::Context#debug</a>).</p>
|
|
328
328
|
|
329
329
|
<footer id="validator-badges" role="contentinfo">
|
330
330
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
331
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
331
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
332
332
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
333
333
|
</footer>
|
334
334
|
|
@@ -585,7 +585,7 @@
|
|
585
585
|
|
586
586
|
<footer id="validator-badges" role="contentinfo">
|
587
587
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
588
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
588
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
589
589
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
590
590
|
</footer>
|
591
591
|
|
@@ -283,7 +283,7 @@
|
|
283
283
|
|
284
284
|
<footer id="validator-badges" role="contentinfo">
|
285
285
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
286
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
286
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
287
287
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
288
288
|
</footer>
|
289
289
|
|
data/doc/Bauxite/Loggers.html
CHANGED
@@ -97,7 +97,7 @@ module.</p>
|
|
97
97
|
|
98
98
|
<footer id="validator-badges" role="contentinfo">
|
99
99
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
100
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
100
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
101
101
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
102
102
|
</footer>
|
103
103
|
|
data/doc/Bauxite/Parser.html
CHANGED
@@ -371,7 +371,7 @@ parser can't handle the file.</p>
|
|
371
371
|
|
372
372
|
<footer id="validator-badges" role="contentinfo">
|
373
373
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
374
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
374
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
375
375
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
376
376
|
</footer>
|
377
377
|
|
@@ -197,7 +197,7 @@
|
|
197
197
|
|
198
198
|
<footer id="validator-badges" role="contentinfo">
|
199
199
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
200
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
200
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
201
201
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
202
202
|
</footer>
|
203
203
|
|
data/doc/Bauxite/Selector.html
CHANGED
@@ -101,6 +101,8 @@
|
|
101
101
|
|
102
102
|
<li ><a href="#method-i-frame">#frame</a>
|
103
103
|
|
104
|
+
<li ><a href="#method-i-smart">#smart</a>
|
105
|
+
|
104
106
|
</ul>
|
105
107
|
</div>
|
106
108
|
|
@@ -407,6 +409,88 @@ selector.</p>
|
|
407
409
|
|
408
410
|
|
409
411
|
|
412
|
+
</div>
|
413
|
+
|
414
|
+
|
415
|
+
<div id="method-i-smart" class="method-detail ">
|
416
|
+
|
417
|
+
<div class="method-heading">
|
418
|
+
<span class="method-name">smart</span><span
|
419
|
+
class="method-args">(arg) { |target| ... }</span>
|
420
|
+
|
421
|
+
<span class="method-click-advice">click to toggle source</span>
|
422
|
+
|
423
|
+
</div>
|
424
|
+
|
425
|
+
|
426
|
+
<div class="method-description">
|
427
|
+
|
428
|
+
<p>Select an element by applying different <a
|
429
|
+
href="Selector.html">Selector</a> strategies.</p>
|
430
|
+
|
431
|
+
<p>This selector tries to find elements by using the following strategies:</p>
|
432
|
+
<ol><li>
|
433
|
+
<p>default (id suffix)</p>
|
434
|
+
</li><li>
|
435
|
+
<p>by <code>name</code></p>
|
436
|
+
</li><li>
|
437
|
+
<p>by <code>class_name</code></p>
|
438
|
+
</li><li>
|
439
|
+
<p>by <code>id</code> fragment (the <code>id</code> contains the text
|
440
|
+
specified)</p>
|
441
|
+
</li><li>
|
442
|
+
<p>by <code>placeholder</code> attribute</p>
|
443
|
+
</li><li>
|
444
|
+
<p>by text content (unless the element is a label)</p>
|
445
|
+
</li><li>
|
446
|
+
<p>by radio/checkbox button value</p>
|
447
|
+
</li><li>
|
448
|
+
<p>by referenced element (find a label by its text, then find the element
|
449
|
+
pointed by the label's <code>for</code> attribute)</p>
|
450
|
+
</li><li>
|
451
|
+
<p>by child element (find a label by its text, then find the first element
|
452
|
+
child control element, including input, select, textarea and button).</p>
|
453
|
+
</li></ol>
|
454
|
+
|
455
|
+
<p>For example:</p>
|
456
|
+
|
457
|
+
<pre class="ruby"><span class="ruby-comment"># assuming <label>By label parent<input type="text" value="By label parent"/></label></span>
|
458
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-string">"smart=By label parent"</span> <span class="ruby-string">"By label parent"</span>
|
459
|
+
<span class="ruby-comment"># => the assertion succeeds.</span>
|
460
|
+
</pre>
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
<div class="method-source-code" id="smart-source">
|
466
|
+
<pre><span class="ruby-comment"># File lib/bauxite/selectors/smart.rb, line 46</span>
|
467
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">smart</span>(<span class="ruby-identifier">arg</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
468
|
+
<span class="ruby-identifier">b</span> = <span class="ruby-identifier">lambda</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span> }
|
469
|
+
<span class="ruby-identifier">target</span> = <span class="ruby-identifier">_smart_try_find</span> { <span class="ruby-identifier">default</span>(<span class="ruby-identifier">arg</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">b</span>) }
|
470
|
+
<span class="ruby-identifier">target</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">_smart_try_find</span> { <span class="ruby-identifier">selenium_find</span>(<span class="ruby-value">:name</span>, <span class="ruby-identifier">arg</span>) }
|
471
|
+
<span class="ruby-identifier">target</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">_smart_try_find</span> { <span class="ruby-identifier">selenium_find</span>(<span class="ruby-value">:class_name</span>, <span class="ruby-identifier">arg</span>) }
|
472
|
+
<span class="ruby-identifier">target</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">_smart_try_find</span> { <span class="ruby-identifier">attr</span>(<span class="ruby-string">"id*:"</span><span class="ruby-operator">+</span><span class="ruby-identifier">arg</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">b</span>) }
|
473
|
+
<span class="ruby-identifier">target</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">_smart_try_find</span> { <span class="ruby-identifier">attr</span>(<span class="ruby-string">"placeholder:"</span><span class="ruby-operator">+</span><span class="ruby-identifier">arg</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">b</span>) }
|
474
|
+
<span class="ruby-identifier">quoted_arg</span> = <span class="ruby-string">"'"</span><span class="ruby-operator">+</span><span class="ruby-identifier">arg</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">"'"</span>, <span class="ruby-string">"\\'"</span>)<span class="ruby-operator">+</span><span class="ruby-string">"'"</span>
|
475
|
+
<span class="ruby-identifier">target</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">_smart_try_find</span> { <span class="ruby-identifier">selenium_find</span>(<span class="ruby-value">:css</span>, <span class="ruby-node">"input[type='checkbox'][value=#{quoted_arg}],input[type='radio'][value=#{quoted_arg}]"</span>) }
|
476
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">target</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">target</span>
|
477
|
+
|
478
|
+
<span class="ruby-identifier">target</span> = <span class="ruby-identifier">selenium_find</span>(<span class="ruby-value">:xpath</span>, <span class="ruby-node">"//*[contains(text(), '#{arg.gsub("'", "\\'")}')]"</span>)
|
479
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">target</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">tag_name</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-string">'label'</span>
|
480
|
+
<span class="ruby-identifier">label</span> = <span class="ruby-identifier">target</span>
|
481
|
+
<span class="ruby-identifier">id</span> = <span class="ruby-identifier">label</span>[<span class="ruby-string">'for'</span>]
|
482
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">selenium_find</span>(<span class="ruby-value">:id</span>, <span class="ruby-identifier">id</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">id</span>
|
483
|
+
|
484
|
+
<span class="ruby-identifier">target</span> = <span class="ruby-identifier">_smart_try_find</span> { <span class="ruby-identifier">label</span>.<span class="ruby-identifier">find_element</span>(<span class="ruby-value">:css</span>, <span class="ruby-string">"input, select, textarea, button"</span>) }
|
485
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">target</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">target</span>
|
486
|
+
<span class="ruby-keyword">end</span></pre>
|
487
|
+
</div>
|
488
|
+
|
489
|
+
</div>
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
410
494
|
</div>
|
411
495
|
|
412
496
|
|
@@ -418,7 +502,7 @@ selector.</p>
|
|
418
502
|
|
419
503
|
<footer id="validator-badges" role="contentinfo">
|
420
504
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
421
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
505
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
422
506
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
423
507
|
</footer>
|
424
508
|
|
@@ -271,7 +271,7 @@ href="Context.html#method-i-find">Bauxite::Context#find</a>.</p>
|
|
271
271
|
|
272
272
|
<footer id="validator-badges" role="contentinfo">
|
273
273
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
274
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
274
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
275
275
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
276
276
|
</footer>
|
277
277
|
|
data/doc/Bauxite.html
CHANGED
@@ -94,7 +94,7 @@
|
|
94
94
|
|
95
95
|
<footer id="validator-badges" role="contentinfo">
|
96
96
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
97
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
97
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
98
98
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
99
99
|
</footer>
|
100
100
|
|
data/doc/README_md.html
CHANGED
@@ -432,7 +432,7 @@ we can type:</p>
|
|
432
432
|
|
433
433
|
<footer id="validator-badges" role="contentinfo">
|
434
434
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
435
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
435
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
436
436
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
437
437
|
</footer>
|
438
438
|
|
data/doc/created.rid
CHANGED
@@ -1,43 +1,46 @@
|
|
1
|
-
|
2
|
-
README.md
|
3
|
-
lib/bauxite/actions/
|
4
|
-
lib/bauxite/actions/
|
5
|
-
lib/bauxite/actions/wait.rb Mon, 27 Jan 2014
|
6
|
-
lib/bauxite/actions/
|
7
|
-
lib/bauxite/actions/
|
8
|
-
lib/bauxite/actions/
|
9
|
-
lib/bauxite/actions/
|
10
|
-
lib/bauxite/actions/
|
11
|
-
lib/bauxite/actions/
|
12
|
-
lib/bauxite/actions/
|
13
|
-
lib/bauxite/actions/
|
14
|
-
lib/bauxite/actions/
|
15
|
-
lib/bauxite/actions/
|
16
|
-
lib/bauxite/actions/
|
17
|
-
lib/bauxite/actions/
|
18
|
-
lib/bauxite/actions/
|
19
|
-
lib/bauxite/actions/
|
20
|
-
lib/bauxite/actions/
|
21
|
-
lib/bauxite/actions/
|
22
|
-
lib/bauxite/actions/
|
23
|
-
lib/bauxite/actions/
|
24
|
-
lib/bauxite/actions/
|
25
|
-
lib/bauxite/actions/
|
26
|
-
lib/bauxite/
|
27
|
-
lib/bauxite/
|
28
|
-
lib/bauxite/
|
29
|
-
lib/bauxite/
|
30
|
-
lib/bauxite/core/
|
31
|
-
lib/bauxite/core/
|
32
|
-
lib/bauxite/core/
|
33
|
-
lib/bauxite/core/logger.rb Mon, 27 Jan 2014
|
34
|
-
lib/bauxite/
|
35
|
-
lib/bauxite/
|
36
|
-
lib/bauxite/
|
37
|
-
lib/bauxite/
|
38
|
-
lib/bauxite/selectors/frame.rb Mon, 27 Jan 2014
|
39
|
-
lib/bauxite/
|
40
|
-
lib/bauxite/
|
41
|
-
lib/bauxite/
|
42
|
-
lib/bauxite/loggers/
|
43
|
-
lib/bauxite/loggers/
|
1
|
+
Tue, 28 Jan 2014 17:04:45 -0300
|
2
|
+
README.md Tue, 28 Jan 2014 16:48:43 -0300
|
3
|
+
lib/bauxite/actions/js.rb Mon, 27 Jan 2014 11:02:44 -0300
|
4
|
+
lib/bauxite/actions/exec.rb Mon, 27 Jan 2014 11:02:44 -0300
|
5
|
+
lib/bauxite/actions/wait.rb Mon, 27 Jan 2014 11:02:44 -0300
|
6
|
+
lib/bauxite/actions/assert.rb Mon, 27 Jan 2014 11:02:44 -0300
|
7
|
+
lib/bauxite/actions/ruby.rb Mon, 27 Jan 2014 11:02:44 -0300
|
8
|
+
lib/bauxite/actions/store.rb Mon, 27 Jan 2014 11:02:44 -0300
|
9
|
+
lib/bauxite/actions/assertv.rb Mon, 27 Jan 2014 11:02:44 -0300
|
10
|
+
lib/bauxite/actions/alias.rb Mon, 27 Jan 2014 11:02:44 -0300
|
11
|
+
lib/bauxite/actions/tryload.rb Mon, 27 Jan 2014 11:02:44 -0300
|
12
|
+
lib/bauxite/actions/test.rb Mon, 27 Jan 2014 11:02:44 -0300
|
13
|
+
lib/bauxite/actions/load.rb Mon, 27 Jan 2014 11:02:44 -0300
|
14
|
+
lib/bauxite/actions/submit.rb Tue, 28 Jan 2014 16:05:51 -0300
|
15
|
+
lib/bauxite/actions/open.rb Mon, 27 Jan 2014 11:02:44 -0300
|
16
|
+
lib/bauxite/actions/reset.rb Mon, 27 Jan 2014 11:02:44 -0300
|
17
|
+
lib/bauxite/actions/write.rb Mon, 27 Jan 2014 11:02:44 -0300
|
18
|
+
lib/bauxite/actions/replace.rb Mon, 27 Jan 2014 11:02:44 -0300
|
19
|
+
lib/bauxite/actions/select.rb Tue, 28 Jan 2014 16:04:12 -0300
|
20
|
+
lib/bauxite/actions/echo.rb Mon, 27 Jan 2014 11:02:44 -0300
|
21
|
+
lib/bauxite/actions/set.rb Mon, 27 Jan 2014 11:02:44 -0300
|
22
|
+
lib/bauxite/actions/params.rb Mon, 27 Jan 2014 11:02:44 -0300
|
23
|
+
lib/bauxite/actions/debug.rb Mon, 27 Jan 2014 11:02:44 -0300
|
24
|
+
lib/bauxite/actions/return.rb Mon, 27 Jan 2014 11:02:44 -0300
|
25
|
+
lib/bauxite/actions/click.rb Mon, 27 Jan 2014 11:02:44 -0300
|
26
|
+
lib/bauxite/actions/source.rb Mon, 27 Jan 2014 11:02:44 -0300
|
27
|
+
lib/bauxite/actions/break.rb Mon, 27 Jan 2014 11:02:44 -0300
|
28
|
+
lib/bauxite/core/selector.rb Tue, 28 Jan 2014 16:48:43 -0300
|
29
|
+
lib/bauxite/core/errors.rb Mon, 27 Jan 2014 11:02:44 -0300
|
30
|
+
lib/bauxite/core/context.rb Tue, 28 Jan 2014 16:48:43 -0300
|
31
|
+
lib/bauxite/core/parser.rb Tue, 28 Jan 2014 16:48:43 -0300
|
32
|
+
lib/bauxite/core/action.rb Tue, 28 Jan 2014 16:48:43 -0300
|
33
|
+
lib/bauxite/core/logger.rb Mon, 27 Jan 2014 11:02:44 -0300
|
34
|
+
lib/bauxite/parsers/default.rb Mon, 27 Jan 2014 11:02:44 -0300
|
35
|
+
lib/bauxite/parsers/html.rb Mon, 27 Jan 2014 11:02:44 -0300
|
36
|
+
lib/bauxite/parsers/csv.rb Mon, 27 Jan 2014 11:02:44 -0300
|
37
|
+
lib/bauxite/application.rb Mon, 27 Jan 2014 11:02:44 -0300
|
38
|
+
lib/bauxite/selectors/frame.rb Mon, 27 Jan 2014 11:02:44 -0300
|
39
|
+
lib/bauxite/selectors/attr.rb Mon, 27 Jan 2014 11:02:44 -0300
|
40
|
+
lib/bauxite/selectors/default.rb Mon, 27 Jan 2014 11:02:44 -0300
|
41
|
+
lib/bauxite/selectors/smart.rb Tue, 28 Jan 2014 16:59:18 -0300
|
42
|
+
lib/bauxite/loggers/terminal.rb Mon, 27 Jan 2014 11:04:47 -0300
|
43
|
+
lib/bauxite/loggers/echo.rb Mon, 27 Jan 2014 11:03:37 -0300
|
44
|
+
lib/bauxite/loggers/composite.rb Mon, 27 Jan 2014 11:02:44 -0300
|
45
|
+
lib/bauxite/loggers/xterm.rb Mon, 27 Jan 2014 11:02:44 -0300
|
46
|
+
lib/bauxite/loggers/file.rb Mon, 27 Jan 2014 11:02:44 -0300
|
data/doc/index.html
CHANGED
@@ -463,7 +463,7 @@ we can type:</p>
|
|
463
463
|
|
464
464
|
<footer id="validator-badges" role="contentinfo">
|
465
465
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
466
|
-
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.
|
466
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
|
467
467
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
468
468
|
</footer>
|
469
469
|
|