bauxite 0.4.2 → 0.4.3
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/README.md +1 -0
- data/Rakefile +3 -0
- data/doc/Bauxite.html +1 -1
- data/doc/Bauxite/Action.html +2 -1
- data/doc/Bauxite/ActionModule.html +1 -1
- data/doc/Bauxite/Application.html +9 -1
- data/doc/Bauxite/Context.html +156 -27
- data/doc/Bauxite/Errors.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/Loggers.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/Parser.html +1 -1
- data/doc/Bauxite/ParserModule.html +1 -1
- data/doc/Bauxite/Selector.html +52 -52
- data/doc/Bauxite/SelectorModule.html +12 -7
- data/doc/README_md.html +5 -1
- data/doc/created.rid +46 -46
- data/doc/index.html +5 -1
- data/doc/js/jquery.js +4 -18
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +50 -43
- data/lib/bauxite.rb +1 -1
- data/lib/bauxite/actions/open.rb +1 -0
- data/lib/bauxite/application.rb +9 -0
- data/lib/bauxite/core/context.rb +71 -3
- data/lib/bauxite/core/selector.rb +8 -3
- data/lib/bauxite/selectors/frame.rb +7 -7
- data/lib/bauxite/selectors/{default.rb → sid.rb} +2 -2
- data/lib/bauxite/selectors/smart.rb +2 -3
- data/test/default_selector.bxt.manual +7 -0
- data/test/default_selector/page.html +11 -0
- data/test/default_selector_var.bxt +1 -0
- metadata +10 -4
@@ -48,13 +48,13 @@ class Bauxite::Selector
|
|
48
48
|
def frame(arg, &block)
|
49
49
|
delimiter = arg[0]
|
50
50
|
items = arg[1..-1].split(delimiter, 2)
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
51
|
+
find(items[0]) do |f|
|
52
|
+
begin
|
53
|
+
@ctx.driver.switch_to.frame f
|
54
|
+
find(items[1], &block)
|
55
|
+
ensure
|
56
|
+
@ctx.driver.switch_to.default_content
|
57
|
+
end
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -28,11 +28,11 @@ class Bauxite::Selector
|
|
28
28
|
#
|
29
29
|
# For example:
|
30
30
|
# # assuming <div id="strange_uuid_like_stuff_myDiv">foo</div>
|
31
|
-
# assert myDiv "foo"
|
31
|
+
# assert sid=myDiv "foo"
|
32
32
|
# # => matches the element above.
|
33
33
|
#
|
34
34
|
# :category: Selector Methods
|
35
|
-
def
|
35
|
+
def sid(arg, &block)
|
36
36
|
selenium_find(:css, "[id$='#{arg.gsub("'", "\\'")}']", &block)
|
37
37
|
end
|
38
38
|
end
|
@@ -45,7 +45,7 @@ class Bauxite::Selector
|
|
45
45
|
# :category: Selector Methods
|
46
46
|
def smart(arg, &block)
|
47
47
|
b = lambda { |e| e }
|
48
|
-
target = _smart_try_find {
|
48
|
+
target = _smart_try_find { sid(arg, &b) }
|
49
49
|
target ||= _smart_try_find { selenium_find(:name, arg) }
|
50
50
|
target ||= _smart_try_find { selenium_find(:class_name, arg) }
|
51
51
|
target ||= _smart_try_find { attr("id*:"+arg, &b) }
|
@@ -66,8 +66,7 @@ class Bauxite::Selector
|
|
66
66
|
|
67
67
|
private
|
68
68
|
def _smart_try_find()
|
69
|
-
|
70
|
-
wait.until { yield }
|
69
|
+
@ctx.with_driver_timeout(0) { yield }
|
71
70
|
rescue StandardError => e
|
72
71
|
nil
|
73
72
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<textarea>Notes go here.</textarea>
|
4
|
+
<div class="form">
|
5
|
+
<input id="username" value="jdoe"/>
|
6
|
+
<input class="password" value="hello world!" />
|
7
|
+
<input data="pet" value="velociraptor" />
|
8
|
+
<textarea>Hi! I'm John</textarea>
|
9
|
+
</div>
|
10
|
+
</body>
|
11
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
load "default_selector.bxt.manual" "__SELECTOR__=css"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bauxite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patricio Zavolinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|
@@ -38,7 +38,10 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.1'
|
41
|
-
description:
|
41
|
+
description: The idea behind this project was to create a tool that allows non-developers
|
42
|
+
to write web tests in a human-readable language. Another major requirement is to
|
43
|
+
be able to easily extend the test language to create functional abstractions over
|
44
|
+
technical details.
|
42
45
|
email: pzavolinsky at yahoo dot com dot ar
|
43
46
|
executables:
|
44
47
|
- bauxite
|
@@ -154,11 +157,14 @@ files:
|
|
154
157
|
- lib/bauxite/parsers/default.rb
|
155
158
|
- lib/bauxite/parsers/html.rb
|
156
159
|
- lib/bauxite/selectors/attr.rb
|
157
|
-
- lib/bauxite/selectors/default.rb
|
158
160
|
- lib/bauxite/selectors/frame.rb
|
161
|
+
- lib/bauxite/selectors/sid.rb
|
159
162
|
- lib/bauxite/selectors/smart.rb
|
160
163
|
- test/alias.bxt
|
161
164
|
- test/assertv.bxt
|
165
|
+
- test/default_selector.bxt.manual
|
166
|
+
- test/default_selector/page.html
|
167
|
+
- test/default_selector_var.bxt
|
162
168
|
- test/delay.bxt
|
163
169
|
- test/delay/page.html
|
164
170
|
- test/exec.bxt
|