bauxite 0.2.0 → 0.3.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/README.md +95 -53
- data/Rakefile +1 -2
- data/doc/Bauxite/Action.html +5 -1
- data/doc/Bauxite/Application.html +249 -0
- data/doc/Bauxite/Context.html +37 -29
- data/doc/Bauxite/Loggers/XtermLogger.html +7 -5
- data/doc/created.rid +38 -37
- data/doc/index.html +2 -0
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +9 -0
- data/lib/bauxite/actions/debug.rb +8 -3
- data/lib/bauxite/application.rb +114 -1
- data/lib/bauxite/core/Context.rb +11 -8
- data/lib/bauxite/loggers/xterm.rb +19 -4
- data/lib/bauxite.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a79031976dbf278abe67693d4a879c6e2ef4e292
|
4
|
+
data.tar.gz: 6d41186a005452003dbad24083b7b44d7d08b069
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df42b694e3b77c1c6b2ef400b60a6070f4a67e6042f2596f7a475e82938b87ea0e17d57a11731e5400f83f951e159a11a1ca50fdd6098955e5572ccf47938f97
|
7
|
+
data.tar.gz: 7722a6c289e506e6851bbd09732096654d65e362820c6d8ab3dc92ff179981341bebe2494cd77c09d822f69ab0c806f4e9793bfd133a16ec67dc2c07cfeb74a8
|
data/README.md
CHANGED
@@ -23,46 +23,55 @@ driver.quit
|
|
23
23
|
While developers might find that code expressive enough, non-developers might be a bit shocked.
|
24
24
|
|
25
25
|
The equivalent Bauxite test is easier on the eyes:
|
26
|
-
```
|
26
|
+
```ruby
|
27
27
|
open "http://google.com"
|
28
|
-
write name=q "Hello WebDriver!"
|
29
|
-
click gbqfb
|
28
|
+
write "name=q" "Hello WebDriver!"
|
29
|
+
click "gbqfb"
|
30
30
|
```
|
31
|
+
|
31
32
|
Installation
|
32
33
|
------------
|
33
34
|
|
34
35
|
In a nutshell:
|
35
|
-
```
|
36
|
+
```shell
|
36
37
|
gem install bauxite
|
37
38
|
```
|
38
39
|
|
39
|
-
|
40
|
+
If you don't have Ruby 2.x yet, check the [Installing Ruby](#installing-ruby) section below.
|
41
|
+
|
42
|
+
Remember you should probably install [Firefox](http://www.mozilla.org) (unless you want to use other browsers or Selenium server by specifying the `-p` switch to the `bauxite` executable).
|
40
43
|
|
41
44
|
Hello World
|
42
45
|
-----------
|
43
46
|
|
44
|
-
(This section assumes that Bauxite and its dependencies are installed in the system. Refer to the [Installation](#installation) section below for more details).
|
45
|
-
|
46
47
|
Paste the following text into `hello.bxt`:
|
47
|
-
```
|
48
|
+
```ruby
|
48
49
|
open "http://www.gnu.org/fun/jokes/helloworld.html"
|
49
50
|
```
|
50
51
|
|
51
|
-
Launch a
|
52
|
+
Launch a terminal/command prompt and type:
|
52
53
|
```
|
53
54
|
bauxite hello.bxt
|
54
55
|
```
|
55
56
|
|
56
|
-
|
57
|
-
|
57
|
+
Command-line Interface
|
58
|
+
----------------------
|
59
|
+
|
60
|
+
The `bauxite` command-line program supports several configuration options.
|
61
|
+
|
62
|
+
Refer to the [RDoc documentation](http://pzavolinsky.github.io/bauxite/Bauxite/Application.html) for more details.
|
63
|
+
|
64
|
+
|
65
|
+
The Bauxite Language
|
66
|
+
--------------------
|
58
67
|
|
59
68
|
The Bauxite language is composed of two elements `Actions` and `Selectors`: Actions are testing operations such as "open this page", "click this button", "write this text into that textbox", etc. Selectors are ways of locating interesting elements of a page such as a button, a textbox, a label, etc.
|
60
69
|
|
61
70
|
A typical Bauxite test is a plain text file that contains a series of Actions (one per line). Depending on the Action, a few action arguments might need to be specified as well. For example in:
|
62
|
-
```
|
71
|
+
```ruby
|
63
72
|
open "http://google.com"
|
64
|
-
write name=q "Hello WebDriver!"
|
65
|
-
click gbqfb
|
73
|
+
write "name=q" "Hello WebDriver!"
|
74
|
+
click "gbqfb"
|
66
75
|
```
|
67
76
|
|
68
77
|
`open`, `write` and `click` are Actions:
|
@@ -82,8 +91,8 @@ For example, in this HTML fragment:
|
|
82
91
|
```
|
83
92
|
|
84
93
|
If we want to click the "Search" button we can do the following:
|
85
|
-
```
|
86
|
-
click gbqfb
|
94
|
+
```ruby
|
95
|
+
click "gbqfb"
|
87
96
|
```
|
88
97
|
|
89
98
|
Bauxite supports several other Selectors such as `name=` in the example above. The `name` Selector finds elements whose `name` attribute matches the text following the `=` sign.
|
@@ -94,8 +103,8 @@ For example, in this HTML fragment:
|
|
94
103
|
```
|
95
104
|
|
96
105
|
If we want to type the text "Hello WebDriver!" in textbox we can do the following:
|
97
|
-
```
|
98
|
-
write name=q "Hello WebDriver!"
|
106
|
+
```ruby
|
107
|
+
write "name=q" "Hello WebDriver!"
|
99
108
|
```
|
100
109
|
|
101
110
|
This section presented a brief introduction into the basic Bauxite concepts. For more details and a list of every Action and Selector available, refer to the RDoc generated documentation in:
|
@@ -111,32 +120,26 @@ Installing Ruby
|
|
111
120
|
I won't cover all the details of installing Ruby on your system (Google knows best), but the following should probably work.
|
112
121
|
|
113
122
|
In GNU/Linux, you can install [RVM](http://rvm.io/), then Ruby:
|
114
|
-
```
|
123
|
+
```shell
|
115
124
|
curl -sSL https://get.rvm.io | bash -s stable
|
116
125
|
source ~/.rvm/scripts/rvm
|
117
126
|
rvm install ruby-2.1.0
|
118
127
|
```
|
119
128
|
|
120
|
-
In Windows, you can install Ruby 2.x with [RubyInstaller](http://rubyinstaller.org/downloads/)
|
129
|
+
In Windows, you can install Ruby 2.x with [RubyInstaller](http://rubyinstaller.org/downloads/). After everything is installed, launch the `Start Command Prompt with Ruby` option in your start menu.
|
121
130
|
|
122
131
|
Regadless of your OS, you should be able to install Bauxite with:
|
123
132
|
|
124
|
-
```
|
133
|
+
```shell
|
125
134
|
gem install bauxite
|
126
135
|
```
|
127
136
|
|
128
|
-
Additionally, if you are using GNU/Linux, you might want to install `ruby-terminfo` to improve the terminal output(i.e. handle more than 80 chars):
|
129
|
-
|
130
|
-
```
|
131
|
-
gem install ruby-terminfo
|
132
|
-
```
|
133
|
-
|
134
137
|
Implementation
|
135
138
|
--------------
|
136
139
|
|
137
|
-
Bauxite is both a
|
140
|
+
Bauxite is both a command-line program and a library. You can use the program to run Bauxite tests directly from a terminal, or you can embed the library in your own application.
|
138
141
|
|
139
|
-
The
|
142
|
+
The command-line program is called `bauxite` and has several command-line options, refer to the [RDoc documentation](http://pzavolinsky.github.io/bauxite/Bauxite/Application.html) for more details.
|
140
143
|
|
141
144
|
If you are looking to embed Bauxite in your application take a look a the code in `lib/bauxite/application.rb`, that should give you a full example of how to create a Bauxite Context and execute some actions.
|
142
145
|
|
@@ -159,11 +162,11 @@ Functional extensions are composite constructs created using existing Bauxite ac
|
|
159
162
|
```
|
160
163
|
|
161
164
|
The Bauxite code to login into this site would be:
|
162
|
-
```
|
165
|
+
```ruby
|
163
166
|
open "http://hostname/login.html"
|
164
|
-
write username "jdoe"
|
165
|
-
write password "hello world!"
|
166
|
-
click login
|
167
|
+
write "username" "jdoe"
|
168
|
+
write "password" "hello world!"
|
169
|
+
click "login"
|
167
170
|
```
|
168
171
|
|
169
172
|
If we were creating a suite of automated web tests for our *hostname* site, we'll probably need to login into the site several times. This would mean copy/pasting the four lines above into every test in our suite.
|
@@ -177,55 +180,55 @@ load other_test_fragment.bxt
|
|
177
180
|
```
|
178
181
|
|
179
182
|
Back to our login example, first we can package the login part of our tests into a separate Bauxite file:
|
180
|
-
```
|
183
|
+
```ruby
|
181
184
|
# login.bxt
|
182
185
|
open "http://hostname/login.html"
|
183
|
-
write username "jdoe"
|
184
|
-
write password "hello world!"
|
185
|
-
click login
|
186
|
+
write "username" "jdoe"
|
187
|
+
write "password" "hello world!"
|
188
|
+
click "login"
|
186
189
|
```
|
187
190
|
|
188
191
|
Of course we would like to be able to login with different username/password combinations, so we can replace the literals in `login.bxt` with variables:
|
189
|
-
```
|
192
|
+
```ruby
|
190
193
|
# login.bxt
|
191
194
|
open "http://hostname/login.html"
|
192
|
-
write username "${username}"
|
193
|
-
write password "${password}"
|
194
|
-
click login
|
195
|
+
write "username" "${username}"
|
196
|
+
write "password" "${password}"
|
197
|
+
click "login"
|
195
198
|
```
|
196
199
|
|
197
200
|
Now, we would like to assert that both `username` and `password` variables are set before calling our test (just in case someone forgets). We can do this with `params`
|
198
|
-
```
|
201
|
+
```ruby
|
199
202
|
# login.bxt
|
200
203
|
params username password
|
201
204
|
open "http://hostname/login.html"
|
202
|
-
write username "${username}"
|
203
|
-
write password "${password}"
|
204
|
-
click login
|
205
|
+
write "username" "${username}"
|
206
|
+
write "password" "${password}"
|
207
|
+
click "login"
|
205
208
|
```
|
206
209
|
|
207
210
|
In our main test we can load `login.bxt` and specify the variables required using this code:
|
208
|
-
```
|
211
|
+
```ruby
|
209
212
|
# main_test.bxt
|
210
|
-
load login.bxt username=jdoe "password=hello world!"
|
213
|
+
load "login.bxt" "username=jdoe" "password=hello world!"
|
211
214
|
|
212
215
|
# additional actions go here
|
213
216
|
```
|
214
217
|
|
215
218
|
We could improve this even further by creating an `alias` to simplify the login process. To do this, lets create an new file called `alias.bxt`:
|
216
|
-
```
|
219
|
+
```ruby
|
217
220
|
# alias.bxt
|
218
|
-
alias login load login.bxt "username=${1}" "password=${2}"
|
221
|
+
alias "login" "load" "login.bxt" "username=${1}" "password=${2}"
|
219
222
|
```
|
220
223
|
|
221
224
|
Note that the `alias` action supports positional arguments.
|
222
225
|
|
223
226
|
Now we can change our main test to use our alias:
|
224
|
-
```
|
227
|
+
```ruby
|
225
228
|
# main_test.bxt
|
226
|
-
load alias.bxt
|
229
|
+
load "alias.bxt"
|
227
230
|
|
228
|
-
login jdoe "hello world!"
|
231
|
+
login "jdoe" "hello world!"
|
229
232
|
|
230
233
|
# additional actions go here
|
231
234
|
```
|
@@ -234,6 +237,45 @@ That was a bit of work but the resulting test is purely functional (minus the lo
|
|
234
237
|
|
235
238
|
### Coded plugins
|
236
239
|
|
237
|
-
Coded plugins
|
240
|
+
Coded plugins are Ruby files that extend the Bauxite language by providing additional language elements. Coded plugins can be used to create Bauxite actions, selectors and loggers.
|
238
241
|
|
242
|
+
For example lets assume that throughout a web application input elements were identified using a custom HTML attribute instead of `id`. For example:
|
239
243
|
|
244
|
+
```html
|
245
|
+
<form>
|
246
|
+
<input custom-attr="username" type="text" />
|
247
|
+
<input custom-attr="password" type="password" />
|
248
|
+
<input custom-attr="login" type="submit" value="Login"/>
|
249
|
+
</form>
|
250
|
+
```
|
251
|
+
|
252
|
+
Using standard Bauxite language we could select these elements using:
|
253
|
+
```ruby
|
254
|
+
# === my_test.bxt === #
|
255
|
+
write "attr=custom-attr:username" "jdoe"
|
256
|
+
write "attr=custom-attr:password" "hello world!"
|
257
|
+
click "attr=custom-attr:login"
|
258
|
+
```
|
259
|
+
|
260
|
+
But we can improve the overall readability of our test by using a coded plugin:
|
261
|
+
```ruby
|
262
|
+
# === plugins/custom_selector.rb === #
|
263
|
+
class Bauxite::Selector
|
264
|
+
def custom(value)
|
265
|
+
attr "custom-attr:#{value}"
|
266
|
+
end
|
267
|
+
end
|
268
|
+
```
|
269
|
+
|
270
|
+
Now we can change our test to look like this:
|
271
|
+
```ruby
|
272
|
+
# === my_test.bxt === #
|
273
|
+
write "custom=username" "jdoe"
|
274
|
+
write "custom=password" "hello world!"
|
275
|
+
click "custom=login"
|
276
|
+
```
|
277
|
+
|
278
|
+
Finally, to execute Bauxite loading our plugin we can type:
|
279
|
+
```
|
280
|
+
bauxite -e plugins my_test.bxt
|
281
|
+
```
|
data/Rakefile
CHANGED
@@ -49,8 +49,7 @@ end
|
|
49
49
|
# === Documentation ========================================================= #
|
50
50
|
desc "Generate Bauxite documentation"
|
51
51
|
task :doc do
|
52
|
-
|
53
|
-
`rdoc -O -U #{doc_dirs}`
|
52
|
+
system("rdoc -O -U -V #{File.join('lib', 'bauxite')}")
|
54
53
|
end
|
55
54
|
|
56
55
|
desc "Open documentation in a browser"
|
data/doc/Bauxite/Action.html
CHANGED
@@ -578,7 +578,11 @@ autocomplete (pressing the <code>TAB</code> key).</p>
|
|
578
578
|
<div class="method-source-code" id="debug-source">
|
579
579
|
<pre><span class="ruby-comment"># File lib/bauxite/actions/debug.rb, line 35</span>
|
580
580
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">debug</span>
|
581
|
-
<span class="ruby-identifier">lambda</span>
|
581
|
+
<span class="ruby-identifier">lambda</span> <span class="ruby-keyword">do</span>
|
582
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">with_vars</span>({ <span class="ruby-string">'__DEBUG__'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">true</span> }) <span class="ruby-keyword">do</span>
|
583
|
+
<span class="ruby-identifier">_debug_process</span>
|
584
|
+
<span class="ruby-keyword">end</span>
|
585
|
+
<span class="ruby-keyword">end</span>
|
582
586
|
<span class="ruby-keyword">end</span></pre>
|
583
587
|
</div>
|
584
588
|
|
@@ -0,0 +1,249 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Bauxite::Application - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../js/jquery.js"></script>
|
17
|
+
<script src="../js/navigation.js"></script>
|
18
|
+
<script src="../js/search_index.js"></script>
|
19
|
+
<script src="../js/search.js"></script>
|
20
|
+
<script src="../js/searcher.js"></script>
|
21
|
+
<script src="../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
<div class="nav-section">
|
58
|
+
<h3>Table of Contents</h3>
|
59
|
+
|
60
|
+
<ul class="link-list" role="directory">
|
61
|
+
<li><a href="#class-Bauxite::Application-label-Synopsis">Synopsis</a>
|
62
|
+
<li><a href="#class-Bauxite::Application-label-Options">Options</a>
|
63
|
+
<li><a href="#class-Bauxite::Application-label-Exit+Status">Exit Status</a>
|
64
|
+
</ul>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
<div id="class-metadata">
|
69
|
+
|
70
|
+
<div id="parent-class-section" class="nav-section">
|
71
|
+
<h3>Parent</h3>
|
72
|
+
|
73
|
+
|
74
|
+
<p class="link">Object
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
</div>
|
82
|
+
</nav>
|
83
|
+
|
84
|
+
<main role="main" aria-labelledby="class-Bauxite::Application">
|
85
|
+
<h1 id="class-Bauxite::Application" class="class">
|
86
|
+
class Bauxite::Application
|
87
|
+
</h1>
|
88
|
+
|
89
|
+
<section class="description">
|
90
|
+
|
91
|
+
<p><code>bauxite</code> command-line program.</p>
|
92
|
+
|
93
|
+
<p>This program executes Bauxite tests and outputs the execution progress and
|
94
|
+
tests results to the terminal.</p>
|
95
|
+
|
96
|
+
<h2 id="class-Bauxite::Application-label-Synopsis">Synopsis<span><a href="#class-Bauxite::Application-label-Synopsis">¶</a> <a href="#documentation">↑</a></span></h2>
|
97
|
+
|
98
|
+
<pre class="ruby"><span class="ruby-identifier">bauxite</span> [<span class="ruby-constant">OPTIONS</span>] <span class="ruby-identifier">file1</span> <span class="ruby-identifier">file2</span> <span class="ruby-operator">...</span>
|
99
|
+
<span class="ruby-comment"># => Executes file1, then file2, and so on.</span>
|
100
|
+
|
101
|
+
<span class="ruby-identifier">bauxite</span> [<span class="ruby-constant">OPTIONS</span>] <span class="ruby-operator">-</span><span class="ruby-identifier">d</span>
|
102
|
+
<span class="ruby-comment"># => Start Bauxite directly in the debug console.</span>
|
103
|
+
|
104
|
+
<span class="ruby-identifier">bauxite</span> [<span class="ruby-constant">OPTIONS</span>]
|
105
|
+
<span class="ruby-comment"># => Start Bauxite and read test actions from the standard input.</span>
|
106
|
+
</pre>
|
107
|
+
|
108
|
+
<h2 id="class-Bauxite::Application-label-Options">Options<span><a href="#class-Bauxite::Application-label-Options">¶</a> <a href="#documentation">↑</a></span></h2>
|
109
|
+
|
110
|
+
<p>For a detailed list of options for your Bauxite version execute:</p>
|
111
|
+
|
112
|
+
<pre>bauxite -h</pre>
|
113
|
+
<dl class="rdoc-list label-list"><dt>-v, --verbose
|
114
|
+
<dd>
|
115
|
+
<p>Show verbose error messages (i.e. print exception names and backtraces).</p>
|
116
|
+
</dd><dt>-t, --timeout SECONDS
|
117
|
+
<dd>
|
118
|
+
<p>Number of seconds to wait before issuing a timeout error. This timeout
|
119
|
+
applies only to Selectors.</p>
|
120
|
+
</dd><dt>-d, --debug
|
121
|
+
<dd>
|
122
|
+
<p>If an error occurs, break into the debug console. This mode is very useful
|
123
|
+
to try different selector combinations and debug NoSuchElementError errors.</p>
|
124
|
+
</dd><dt>-p, --provider DRIVER
|
125
|
+
<dd>
|
126
|
+
<p>Selenium WebDriver provider. Defaults to <code>firefox</code>.</p>
|
127
|
+
|
128
|
+
<p>Other options include:</p>
|
129
|
+
<ul><li>
|
130
|
+
<p><code>remote</code></p>
|
131
|
+
</li><li>
|
132
|
+
<p><code>ie</code></p>
|
133
|
+
</li><li>
|
134
|
+
<p><code>chrome</code></p>
|
135
|
+
</li><li>
|
136
|
+
<p><code>android</code></p>
|
137
|
+
</li><li>
|
138
|
+
<p><code>iphone</code></p>
|
139
|
+
</li><li>
|
140
|
+
<p><code>opera</code></p>
|
141
|
+
</li><li>
|
142
|
+
<p><code>phantomjs</code></p>
|
143
|
+
</li><li>
|
144
|
+
<p><code>safari</code></p>
|
145
|
+
</li></ul>
|
146
|
+
|
147
|
+
<p>Driver availability dependes on the system running Bauxite.</p>
|
148
|
+
</dd><dt>-P, --provider-option OPTION
|
149
|
+
<dd>
|
150
|
+
<p>A <code>name=value</code> pair of options that are directly forwarded to
|
151
|
+
the Selenium WebDriver provider. This option argument can appear multiple
|
152
|
+
times in the command line to specify multiple options.</p>
|
153
|
+
</dd><dt>-l, --logger LOGGER
|
154
|
+
<dd>
|
155
|
+
<p>Logger instance to use. Defaults to <code>xterm</code> if the
|
156
|
+
<code>TERM</code> environment variable is set to <code>xterm</code>,
|
157
|
+
otherwise it defaults to <code>terminal</code>.</p>
|
158
|
+
|
159
|
+
<p>To see a complete list of the available loggers execute:</p>
|
160
|
+
|
161
|
+
<pre>bauxite -h</pre>
|
162
|
+
</dd><dt>-L, --logger-option OPTION
|
163
|
+
<dd>
|
164
|
+
<p>A <code>name=value</code> pair of options that are directly forwarded to
|
165
|
+
the logger. This option argument can appear multiple times in the command
|
166
|
+
line to specify multiple options.</p>
|
167
|
+
</dd><dt>-r, --reset
|
168
|
+
<dd>
|
169
|
+
<p>Issue a <a href="Action.html#method-i-reset">Bauxite::Action#reset</a>
|
170
|
+
action between every test specified in the command line. This option
|
171
|
+
enforces test isolation by resetting the test context before each test
|
172
|
+
(this removes cookies, sessions, etc. from the previous test).</p>
|
173
|
+
</dd><dt>-w, --wait
|
174
|
+
<dd>
|
175
|
+
<p>Wait for user input when the test completes instead of closing the browser
|
176
|
+
window.</p>
|
177
|
+
</dd><dt>-u, --url URL
|
178
|
+
<dd>
|
179
|
+
<p>This option is an alias of:</p>
|
180
|
+
|
181
|
+
<pre>-p remote -P url=URL</pre>
|
182
|
+
|
183
|
+
<p>If <code>URL</code> is not present
|
184
|
+
<code>http://localhost:4444/wd/hub</code> will be assumed.</p>
|
185
|
+
</dd><dt>-e, --extension DIR
|
186
|
+
<dd>
|
187
|
+
<p>Loads every Ruby file (*.rb) inside <code>DIR</code> (and subdirectories).
|
188
|
+
This option can be used to load custom Bauxite extensions (e.g. Actions,
|
189
|
+
Selectors, <a href="Loggers.html">Loggers</a>, etc.) for a specific test
|
190
|
+
run.</p>
|
191
|
+
|
192
|
+
<p>For example:</p>
|
193
|
+
|
194
|
+
<pre class="ruby"><span class="ruby-comment"># === custom/my_selector.rb ======= #</span>
|
195
|
+
<span class="ruby-keyword">class</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Selector</span>
|
196
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">by_attr</span>(<span class="ruby-identifier">value</span>)
|
197
|
+
<span class="ruby-identifier">attr</span> <span class="ruby-node">"by_attr:#{value}"</span>
|
198
|
+
<span class="ruby-keyword">end</span>
|
199
|
+
<span class="ruby-keyword">end</span>
|
200
|
+
<span class="ruby-comment"># === end custom/my_selector.rb === #</span>
|
201
|
+
|
202
|
+
<span class="ruby-comment"># === custom/my_test.bxt ========== #</span>
|
203
|
+
<span class="ruby-comment"># ...</span>
|
204
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-string">"by_attr=attr_value"</span> <span class="ruby-identifier">hello</span>
|
205
|
+
<span class="ruby-comment"># ...</span>
|
206
|
+
<span class="ruby-comment"># === end custom/my_test.bxt ====== #</span>
|
207
|
+
|
208
|
+
<span class="ruby-identifier">bauxite</span> <span class="ruby-operator">-</span><span class="ruby-identifier">e</span> <span class="ruby-identifier">custom</span> <span class="ruby-identifier">custom</span><span class="ruby-operator">/</span><span class="ruby-identifier">my_test</span>.<span class="ruby-identifier">bxt</span>
|
209
|
+
</pre>
|
210
|
+
</dd><dt>--version
|
211
|
+
<dd>
|
212
|
+
<p>Shows the Bauxite version.</p>
|
213
|
+
</dd></dl>
|
214
|
+
|
215
|
+
<h2 id="class-Bauxite::Application-label-Exit+Status">Exit Status<span><a href="#class-Bauxite::Application-label-Exit+Status">¶</a> <a href="#documentation">↑</a></span></h2>
|
216
|
+
|
217
|
+
<p>The <code>bauxite</code> program exits with <code>zero</code> if every
|
218
|
+
action in the test succeeded and <code>non-zero</code> otherwise.</p>
|
219
|
+
|
220
|
+
<p>If the test run includes multiple <a
|
221
|
+
href="Action.html#method-i-test">Bauxite::Action#test</a> actions, the exit
|
222
|
+
status equals the number of failed test cases (again, <code>zero</code>
|
223
|
+
indicates success).</p>
|
224
|
+
|
225
|
+
</section>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</section>
|
241
|
+
</main>
|
242
|
+
|
243
|
+
|
244
|
+
<footer id="validator-badges" role="contentinfo">
|
245
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
246
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
247
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
248
|
+
</footer>
|
249
|
+
|