-
Notifications
You must be signed in to change notification settings - Fork 3
/
using.html
247 lines (212 loc) · 12.3 KB
/
using.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Using Substeps Runner — Substeps documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/theme_extras.js"></script>
<link rel="top" title="Substeps documentation" href="index.html" />
</head>
<body>
<div class="header"><h1 class="heading"><a href="index.html">
<span>Substeps documentation</span></a></h1>
<h2 class="heading"><span>Using Substeps Runner</span></h2>
</div>
<div class="topnav">
<p>
<a class="uplink" href="index.html">Contents</a>
</p>
</div>
<div class="content">
<div class="section" id="using-substeps-runner">
<h1>Using Substeps Runner<a class="headerlink" href="#using-substeps-runner" title="Permalink to this headline">¶</a></h1>
<div class="section" id="plugin-configuration">
<h2>Plugin Configuration<a class="headerlink" href="#plugin-configuration" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Below is a fragment of a maven pom file to configure the susbteps-runner plugin.</li>
<li>An SLF4J logging implementation is required as a dependency, the plugin adds all of the test dependencies of the project
to it’s own set of dependencies to avoid duplication in the pom.</li>
</ul>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><plugin></span>
<span class="nt"><groupId></span>com.technophobia.substeps<span class="nt"></groupId></span>
<span class="nt"><artifactId></span>substeps-runner<span class="nt"></artifactId></span>
<span class="nt"><version></span>0.0.4<span class="nt"></version></span>
<span class="nt"><executions></span>
<span class="nt"><execution></span>
<span class="nt"><id></span>SubSteps Test<span class="nt"></id></span>
<span class="nt"><phase></span>integration-test<span class="nt"></phase></span>
<span class="nt"><goals></span>
<span class="nt"><goal></span>run-features<span class="nt"></goal></span>
<span class="nt"></goals></span>
<span class="nt"></execution></span>
<span class="nt"></executions></span>
<span class="nt"><configuration></span>
<span class="nt"><executionConfigs></span>
<span class="c"><!-- multiple execution configurations - details below --></span>
<span class="nt"><executionConfigs></span>
<span class="nt"></configuration></span>
<span class="nt"><dependencies></span>
<span class="c"><!-- NB. The plugin uses all test dependencies defined in this project,</span>
<span class="c"> as it's own so there is no need to list separately. The exception is an slf4j</span>
<span class="c"> logging implementation, which is required before other dependencies have</span>
<span class="c"> been added. This logger is included as an example, it can be replaced with</span>
<span class="c"> another slf4j logger of your choice. --></span>
<span class="nt"><dependency></span>
<span class="nt"><groupId></span>org.slf4j<span class="nt"></groupId></span>
<span class="nt"><artifactId></span>slf4j-log4j12<span class="nt"></artifactId></span>
<span class="nt"><version></span>1.6.4<span class="nt"></version></span>
<span class="nt"></dependency></span>
<span class="nt"></dependencies></span>
</pre></div>
</div>
</div>
<div class="section" id="execution-configuration">
<h2>Execution Configuration<a class="headerlink" href="#execution-configuration" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>The Substeps runner plugin can execute the tests specified by a number of configurations.</li>
<li>This can be useful in order to break up test suites into smaller chunks, use different configurations etc.</li>
</ul>
<p>Below is a table of the execution configuration parameters and their meaning.</p>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="87%" />
<col width="0%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Field</th>
<th class="head">Description</th>
<th class="head"> </th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>description</td>
<td>A descriptive name for the configuration, this is used in the test execution report.</td>
<td> </td>
</tr>
<tr class="row-odd"><td>featureFile</td>
<td>path to the feature file, or directory containing the feature files</td>
<td> </td>
</tr>
<tr class="row-even"><td>subStepsFileName</td>
<td>path to directory of substep files, or a single substep file</td>
<td> </td>
</tr>
<tr class="row-odd"><td>stepImplementationClassNames</td>
<td>List of classes containing step implementations
eg <param>com.technophobia.substeps.StepImplmentations<param></td>
<td> </td>
</tr>
<tr class="row-even"><td>initialisationClass</td>
<td><<strong>optional</strong>> Ordered list of classes containing setup and tear down methods
eg <param>com.technophobia.substeps.MySetup<param>. By default the initialisation classes associated with the step implementations will be used.</td>
<td> </td>
</tr>
<tr class="row-odd"><td>tags</td>
<td><<strong>optional</strong>> If the feature or scenario has these tags, then it will be
included, otherwise it won’t. multiple tags are space seperated. Tags can be excluded by prefixing with –</td>
<td> </td>
</tr>
<tr class="row-even"><td>nonFatalTags</td>
<td><<strong>optional</strong>> If a scenario (and therefore a feature) that has this tag fails to pass, then the build will not fail. This is useful for scenarios
where tests are written and are included in a CI build in advance of completed functionality, this allows the build and therefore maven releases to succeed. Over the course of
a project this list should be reduced as confidence in the delivery grows. Format is the same for <tags></td>
<td> </td>
</tr>
<tr class="row-odd"><td>fastFailParseErrors</td>
<td><<strong>optional</strong>> if true any parse errors will fail the build immediately, rather than attempting to execute as much as possible and fail those tests that can’t be parsed</td>
<td> </td>
</tr>
<tr class="row-even"><td>strict</td>
<td><<strong>optional</strong>> defaults to true, if false, Substeps will use the nonStrictKeywordPrecedence to look for alternate expressions if an exact match can’t be found. Useful for porting Cucumber features.</td>
<td> </td>
</tr>
<tr class="row-odd"><td>nonStrictKeywordPrecedence</td>
<td><<strong>optional</strong>> required if strict is false. An parameter list of keywords to use if an exact match can’t be found.
eg. <param>Given</param>
<param>When</param> ...
Then if a step was defined in a feature or substep as “When I login”, but implemented as “Given I login”, the feature would parse correctly.</td>
<td> </td>
</tr>
</tbody>
</table>
<p>Example Pom fragment</p>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><executionConfig></span>
<span class="nt"><description></span>Self Test Features<span class="nt"></description></span>
<span class="nt"><featureFile></span>${basedir}/target/test-classes/features<span class="nt"></featureFile></span>
<span class="nt"><subStepsFileName></span>${basedir}/target/test-classes/substeps<span class="nt"></subStepsFileName></span>
<span class="nt"><stepImplementationClassNames></span>
<span class="nt"><param></span>com.technophobia.webdriver.substeps.impl.BaseWebdriverSubStepImplementations<span class="nt"></param></span>
<span class="nt"><param></span>com.technophobia.webdriver.substeps.example.ExampleCustomWebdriverStepImplementations<span class="nt"></param></span>
<span class="nt"></stepImplementationClassNames></span>
<span class="c"><!-- optional attributes --></span>
<span class="nt"><initialisationClass></span>
<span class="nt"><param></span>com.technophobia.webdriver.substeps.runner.DefaultExecutionSetupTearDown<span class="nt"></param></span>
<span class="nt"><param></span>com.technophobia.webdriver.substeps.example.ExampleSetupAndTearDown<span class="nt"></param></span>
<span class="nt"></initialisationClass></span>
<span class="nt"><tags></span>@all<span class="nt"></tags></span>
<span class="nt"><nonFatalTags></span>@new_phase<span class="nt"></nonFatalTags></span>
<span class="nt"><fastFailParseErrors></span>false<span class="nt"></fastFailParseErrors></span>
<span class="nt"><strict></span>false<span class="nt"></strict></span>
<span class="nt"><nonStrictKeywordPrecedence></span>
<span class="nt"><param></span>Given<span class="nt"></param></span>
<span class="nt"><param></span>When<span class="nt"></param></span>
<span class="nt"><param></span>Then<span class="nt"></param></span>
<span class="nt"><param></span>And<span class="nt"></param></span>
<span class="nt"></nonStrictKeywordPrecedence></span>
<span class="nt"></executionConfig></span>
</pre></div>
</div>
</div>
<div class="section" id="reporting">
<h2>Reporting<a class="headerlink" href="#reporting" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>The Susbteps runner plugin can create an HTML test execution report with the following configuration at plugin level.</li>
<li>Results from multiple execution configurations are combined.</li>
<li>alter the outputDirectory to write the html report elsewhere.</li>
<li>Typically we use a ‘post-build’ task to move the HTML report elsewhere and create a permanent link. (In Jenkins this can be achieved with the HTMLPublisher plugin).</li>
</ul>
<div class="highlight-xml"><div class="highlight"><pre><span class="nt"><configuration></span>
...
<span class="nt"><executionReportBuilder</span> <span class="na">implementation=</span><span class="s">"com.technophobia.substeps.report.DefaultExecutionReportBuilder"</span><span class="nt">></span>
<span class="nt"><outputDirectory></span>${project.build.directory}<span class="nt"></outputDirectory></span>
<span class="nt"></executionReportBuilder></span>
<span class="nt"></configuration></span>
</pre></div>
</div>
<ul class="simple">
<li>Alternative report builders can be used provided that they implement <tt class="docutils literal"><span class="pre">com.technophobia.substeps.report.ExecutionReportBuilder</span></tt></li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Check <a class="reference external" href="http://search.maven.org/#search|ga|1|com.technophobia.substeps">Maven Central</a> for the latest versions of the plugin.</p>
</div>
</div>
</div>
</div>
<div class="bottomnav">
<p>
<a class="uplink" href="index.html">Contents</a>
</p>
</div>
<div class="footer">
© Copyright 2012, Technophobia.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>