forked from davehunt/moz-grid-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
101 lines (90 loc) · 3.47 KB
/
build.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
<project name="selenium-grid" default="launch-remote-control" basedir=".">
<property environment="env"/>
<exec executable="hostname" osfamily="unix" failifexecutionfails="false" outputproperty="env.COMPUTERNAME"/>
<property name="env.HOSTNAME" value="${env.COMPUTERNAME}"/> <!-- Windows vs. Linux -->
<property file="${basedir}/${env.HOSTNAME}.properties" />
<property file="${basedir}/default.properties"/>
<path id="selenium.classpath">
<pathelement path="${basedir}/"/>
<fileset dir="${basedir}/lib">
<include name="selenium-server-standalone-${selenium.version}.jar"/>
</fileset>
<pathelement path="${java.class.path}/"/>
</path>
<!-- Debug target to show variables -->
<target name="debug">
<echoproperties/>
</target>
<target name="launch-hub" description="Launch Selenium Hub">
<java classname="org.openqa.grid.selenium.GridLauncher"
classpathref="selenium.classpath"
fork="true"
failonerror="true">
<arg value="-role"/>
<arg value="hub"/>
<arg value="-grid1Yml"/>
<arg value="grid_configuration.yml"/>
<arg value="-hubConfig"/>
<arg value="hub_configuration.json"/>
</java>
</target>
<target name="launch-webdriver">
<java classpathref="selenium.classpath"
classname="org.openqa.grid.selenium.GridLauncher"
fork="true"
failonerror="true">
<arg value="-role"/>
<arg value="webdriver"/>
<arg value="-hub"/>
<arg value="http://${hub.host}:${hub.port}/grid/register"/>
<arg value="-host"/>
<arg value="${node.host}"/>
<arg value="-nodeConfig"/>
<arg value="${node.configuration.file}"/>
</java>
</target>
<target name="launch-remote-control"
description="Launch A Remote Control"
depends="launch-remote-control-with-custom-profile, launch-remote-control-without-custom-profile"/>
<target name="check-for-custom-profile">
<condition property="use.custom.profile">
<not>
<equals arg1="${custom.firefox.profile}" arg2="" />
</not>
</condition>
</target>
<target name="launch-remote-control-with-custom-profile" depends="check-for-custom-profile" if="use.custom.profile">
<java classpathref="selenium.classpath"
classname="org.openqa.grid.selenium.GridLauncher"
fork="true"
failonerror="true">
<arg value="-role"/>
<arg value="rc"/>
<arg value="-hub"/>
<arg value="http://${hub.host}:${hub.port}/grid/register"/>
<arg value="-host"/>
<arg value="${node.host}"/>
<arg value="-nodeConfig"/>
<arg value="${node.configuration.file}"/>
<arg value="-firefoxProfileTemplate"/>
<arg value="${basedir}${file.separator}firefoxprofiles${file.separator}${custom.firefox.profile}"/>
<arg line="${rc.arguments}"/>
</java>
</target>
<target name="launch-remote-control-without-custom-profile" depends="check-for-custom-profile" unless="use.custom.profile">
<java classpathref="remote-control.classpath"
classname="org.openqa.grid.selenium.GridLauncher"
fork="true"
failonerror="true">
<arg value="-role"/>
<arg value="rc"/>
<arg value="-hub"/>
<arg value="http://${hub.host}:${hub.port}/grid/register"/>
<arg value="-host"/>
<arg value="${node.host}"/>
<arg value="-nodeConfig"/>
<arg value="${node.configuration.file}"/>
<arg line="${rc.arguments}"/>
</java>
</target>
</project>