Bonjour Messieurs,
Je viens vers vous pour un petit problème je suis un projet maven qui utilise Surefire et Selenium pour exécuter un test Selenium, mon test s’exécute dans mon ide (je lance le serveur selenium a la main dans un terminal), mais quand je fais un clean install de mon projet le test ne s’exécute pas ...
Pourtant j’ai bien tout configurer pour que mon test ce lance en intégrationTest et pas en Test …
Configuration du plugin surefire :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
	<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.9</version>
				<configuration>
					<excludes>
						<exclude>src/test/java/selenium/WelcomeSiteUrl.java</exclude>
					</excludes>
				</configuration>
				<executions>
					<execution>
						<id>surefire-integration-test</id>
						<phase>integration-test</phase>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<skip>false</skip>
							<includes>
								<include>src/test/java/selenium/WelcomeSiteUrl.java</include>
							</includes>
						</configuration>
					</execution>
				</executions>
			</plugin>
Configuration du plugin selenium :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>selenium-maven-plugin</artifactId>
				<version>1.0-rc-1</version>
				<executions>
					<execution>
						<phase>pre-integration-test</phase>
						<goals>
							<goal>start-server</goal>
						</goals>
						<configuration>
							<background>true</background>
						</configuration>
					</execution>
					<execution>
						<id>stop</id>
						<phase>post-integration-test</phase>
						<goals>
							<goal>stop-server</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<browser>*iexplore</browser>
					<startURL>https://www.monurl.do</startURL>
					<suite>src/test/java/</suite>
				</configuration>
			</plugin>
Les logs de maven :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building project_selenium
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\prog\workspace\project_selenium\target
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [selenium:start-server {execution: default}]
Created dir: C:\prog\workspace\project_selenium\target\selenium
Launching Selenium Server
Waiting for Selenium Server...
[INFO] User extensions: C:\prog\workspace\project_selenium\target\selenium\user-extensions.js
11:25:41,751 INFO  [org.openqa.selenium.server.SeleniumServer] Java: Sun Microsystems Inc. 1.5.0_22-b03
11:25:41,766 INFO  [org.openqa.selenium.server.SeleniumServer] OS: Windows 7 6.1 x86
11:25:41,766 INFO  [org.openqa.selenium.server.SeleniumServer] v1.0-beta-2 [2571], with Core v1.0-beta-2 [2330]
11:25:41,829 INFO  [org.mortbay.http.HttpServer] Version Jetty/5.1.x
11:25:41,829 INFO  [org.mortbay.util.Container] Started HttpContext[/,/]
11:25:41,829 INFO  [org.mortbay.util.Container] Started HttpContext[/selenium-server,/selenium-server]
11:25:41,829 INFO  [org.mortbay.util.Container] Started HttpContext[/selenium-server/driver,/selenium-server/driver]
11:25:41,844 INFO  [org.mortbay.http.SocketListener] Started SocketListener on 0.0.0.0:4444
11:25:41,844 INFO  [org.mortbay.util.Container] Started org.mortbay.jetty.Server@bf32c
11:25:42,078 INFO  [org.mortbay.util.Credential] Checking Resource aliases
Selenium Server started
[INFO] [surefire:test {execution: surefire-integration-test}]
[INFO] No tests to run.
[INFO] Surefire report directory: C:\prog\workspace\project_selenium\target\surefire-reports
 
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
 
Results :
 
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
 
[INFO] [selenium:stop-server {execution: stop}]
Stopping Selenium server...
11:25:42,953 INFO  [org.mortbay.util.Credential] Checking Resource aliases
11:25:42,953 INFO  [org.openqa.selenium.server.SeleniumDriverResourceHandler] Command request: shutDown[, ] on session null
11:25:42,953 INFO  [org.openqa.selenium.server.SeleniumDriverResourceHandler] Shutdown command received
11:25:42,953 INFO  [org.openqa.selenium.server.SeleniumDriverResourceHandler] initiating shutdown
11:25:42,953 INFO  [org.openqa.selenium.server.SeleniumDriverResourceHandler] Got result: null on session null
Stop request sent
[INFO] [install:install {execution: default-install}]
[INFO] Installing C:\prog\workspace\project_selenium\pom.xml to C:\Users\userdps\.m2\repository\com\project-test\plop\project_selenium\3.2.0-SNAPSHOT\project_selenium-3.2.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Wed Sep 21 11:25:43 CEST 2011
[INFO] Final Memory: 22M/40M
[INFO] ------------------------------------------------------------------------
Cordialement.