-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.xml
314 lines (291 loc) · 12 KB
/
demo.xml
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/**
* Copyright 2006 V Narayan Raman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<project name="demo" default="sahitests">
<property name="userdata.dir" value="${basedir}/userdata"/>
<property environment="env" />
<property name="urlbase" value="sahi.co.in"/>
<!--
<property name="urlbase" value="gramam"/>
-->
<taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="lib/ant-sahi.jar"/>
<target name="sahitests" description="start the server and run sahi tests">
<parallel>
<!--<antcall target="start"/>-->
<antcall target="start-web"/>
<sequential>
<waitfor maxwait="3" maxwaitunit="minute" checkevery="100">
<http url="http://${urlbase}/demo/index.htm"/>
</waitfor>
<antcall target="runietests"/>
<antcall target="stop-web"/>
</sequential>
</parallel>
</target>
<target name="ff" description="start the server and run sahi tests">
<parallel>
<sequential>
<waitfor maxwait="3" maxwaitunit="minute" checkevery="100">
<http url="http://${urlbase}/demo/index.htm"/>
</waitfor>
<antcall target="runfftests"/>
<antcall target="stop-web"/>
</sequential>
<antcall target="start-web"/>
</parallel>
</target>
<target name="ie" description="start the server and run sahi tests">
<parallel>
<sequential>
<waitfor maxwait="3" maxwaitunit="minute" checkevery="100">
<http url="http://${urlbase}/demo/index.htm"/>
</waitfor>
<antcall target="runietests"/>
<antcall target="stop-web"/>
</sequential>
<antcall target="start-web"/>
</parallel>
</target>
<target name="runfftests">
<sahi suite="../userdata/scripts/demo/demo.suite"
browser="C:\Program Files\Mozilla Firefox\firefox.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browseroption="-profile ${userdata.dir}/browser/ff/profiles/sahi$threadNo -no-remote"
browserProcessName="firefox.exe"
threads="6">
<report type="html"/>
<!--<report type="junit" logdir="${userdata.dir}/temp/junit"/>-->
</sahi>
<antcall target="failsahi"/>
</target>
<target name="runffsingle">
<sahi suite="scripts/demo/sahi_demo.sah"
browser="C:\Program Files\Mozilla Firefox\firefox.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browseroption="-profile $userDir/browser/ff/profiles/sahi$threadNo -no-remote"
browserProcessName="firefox.exe"
threads="3">
<report type="html" logdir="logs/playback/mydir"/>
</sahi>
<antcall target="failsahi"/>
</target>
<target name="runietests">
<antcall target="proxyon"/>
<sahi suite="../userdata/scripts/demo/demo.suite"
browser="C:\\Program Files\\Internet Explorer\\iexplore.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browseroption="-noframemerging"
browserProcessName="iexplore.exe"
threads="6"
>
<report type="html"/>
<!--<report type="junit" logdir="${userdata.dir}/temp/junit"/>-->
</sahi>
<antcall target="proxyoff"/>
<antcall target="failsahi"/>
</target>
<target name="runchrometests">
<!-- Use full path in browser if XP-->
<sahi suite="../userdata/scripts/demo/demo.suite"
browser="${env.LOCALAPPDATA}\\Google\\Chrome\\Application\\chrome.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browserProcessName="chrome.exe"
browseroption="--user-data-dir=$userDir\browser\chrome\profiles\sahi$threadNo --proxy-server=localhost:9999 --disable-popup-blocking"
threads="10"
>
<report type="html"/>
<!--<report type="junit" logdir="${userdata.dir}/temp/junit"/>-->
</sahi>
<antcall target="failsahi"/>
</target>
<target name="runsafaritests">
<antcall target="proxyon"/>
<sahi suite="../userdata/scripts/demo/demo.suite"
browser="C:\\Program Files\\Safari\Safari.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browserProcessName="Safari.exe"
threads="1"
>
<report type="html"/>
<!--<report type="junit" logdir="${userdata.dir}/temp/junit"/>-->
</sahi>
<antcall target="proxyoff"/>
<antcall target="failsahi"/>
</target>
<target name="runoperatests">
<antcall target="proxyon"/>
<sahi suite="../userdata/scripts/demo/demo.suite"
browser="C:\\Program Files\\Opera\\opera.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browserProcessName="opera.exe"
threads="1"
>
<report type="html"/>
<report type="junit" logdir="${userdata.dir}/temp/junit"/>
</sahi>
<antcall target="proxyoff"/>
<antcall target="failsahi"/>
</target>
<target name="runhtmlunittests">
<sahi suite="../userdata/scripts/demo/demo.suite"
browser="D:/Dev/sahi/SahiHTMLUnit/bin/htmlunit.bat"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browserProcessName="java.exe"
threads="3"
>
<report type="html"/>
</sahi>
<antcall target="failsahi"/>
</target>
<target name="failsahi" if="sahi.failed">
<!--antcall target="stop-web"/-->
<fail message="Sahi tests failed!"/>
</target>
<target name="start-web" description="starts web">
<java classname="net.sf.sahi.WebServer" fork="true" dir="bin"
jvmargs="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5006">
<classpath location="lib/sahi.jar"/>
</java>
</target>
<target name="stop-web" description="stop web server">
<get dest="stopserver.htm" src="http://${urlbase}/dyn/stopserver" ignoreerrors="true"/>
<delete file="stopserver.htm"/>
</target>
<target name="sahireport" description="show report">
<exec command="C:\\Program Files\\Internet Explorer\\iexplore.exe ${userdata.dir}/logs/playback/"/>
</target>
<target name="start" description="starts proxy">
<java classname="net.sf.sahi.Proxy" fork="true">
<!--<env key="MOZ_NO_REMOTE" value="1"/>-->
<classpath location="lib/sahi.jar">
<pathelement location="extlib/rhino/js.jar"/>
<pathelement location="extlib/apc/commons-codec-1.3.jar"/>
<fileset dir="extlib" includes="*.jar"/>
</classpath>
<arg value="." id="basePath"/>
<arg value="userdata" id="userdataPath"/>
</java>
</target>
<target name="stopsahi" description="stop sahi server">
<sahi stop="true" sahihost="localhost" sahiport="9999"/>
</target>
<target name="proxyon">
<exec executable="tools/toggle_IE_proxy.exe">
<arg value="enable"/>
</exec>
</target>
<target name="proxyoff">
<exec executable="tools/toggle_IE_proxy.exe">
<arg value="disable"/>
</exec>
</target>
<target name="testglobal">
<sahi suite="../userdata/scripts/demo/globalvar.suite"
browser="C:\Program Files\Mozilla Firefox\firefox.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browseroption="-profile $userDir/browser/ff/profiles/sahi$threadNo"
browserProcessName="firefox.exe"
threads="1">
<report type="html"/>
<report type="junit" logdir="${userdata.dir}/temp/junit"/>
</sahi>
<antcall target="failsahi"/>
</target>
<target name="shouldfail">
<sahi suite="../userdata/scripts/demo/shouldfail/fail.suite"
browser="C:\Program Files\Mozilla Firefox\firefox.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browseroption="-profile $userDir/browser/ff/profiles/sahi$threadNo -no-remote"
browserProcessName="firefox.exe"
threads="3">
<report type="html"/>
<report type="junit" logdir="${userdata.dir}/temp/junit"/>
</sahi>
<antcall target="failsahi"/>
</target>
<target name="shouldfailie">
<antcall target="proxyon"/>
<sahi suite="../userdata/scripts/demo/shouldfail/fail.suite"
browser="C:\\Program Files\\Internet Explorer\\iexplore.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browseroption="-noframemerging"
browserProcessName="iexplore.exe"
threads="3">
<report type="html"/>
<report type="junit" logdir="${userdata.dir}/temp/junit"/>
</sahi>
<antcall target="proxyoff"/>
<antcall target="failsahi"/>
</target>
<target name="fail_missing">
<sahi suite="../userdata/scripts/demo/shouldfail/fail_missing.suite"
browser="C:\Program Files\Mozilla Firefox\firefox.exe"
baseurl="http://${urlbase}/demo/"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browseroption="-profile ${userdata.dir}/browser/ff/profiles/sahi$threadNo -no-remote"
browserProcessName="firefox.exe"
threads="3">
<report type="html"/>
<report type="junit" logdir="${userdata.dir}/temp/junit"/>
</sahi>
<antcall target="failsahi"/>
</target>
</project>