Results 1 to 3 of 3
  1. #1
    Nissem is offline Member
    Join Date
    Sep 2015
    Posts
    2
    Rep Power
    0

    Default Maven ignoring new test files

    Hi all,

    I have setup a small project that only contains tests. Everything worked smoothly as long as I only had one test file but when I wanted to add a second one I cannot get Maven to include it during build, it only executes the first file. The new file has a different name but the content is copied from the executed file (except for the class name obviously). I have been unsuccessful in finding an answer in this forum or via google. Going crazy over this so thankful for help!

    I am using Eclipse and when I run as Maven build/install/test it is the same behaviour. When run the project as a JUnit all the tests in all files are executed correctly. So I am suspecting that I somewhere need to define that the new files should be included in the Maven build?

    Using Eclipse Mars on Windows 10. The tests are written using JUnit framework to execute selenium tests. The execution is the same on my local computer as well as on my linux Jenkins build server.



    Except for my POM I have not really done any special configuration in any other settings file:

    Java Code:
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>yhtest</groupId>
      <artifactId>selenium_mvn_eclipse</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <name>My First Selenium Project in Maven for Eclipse</name>
      <description>My First Selenium Project in Maven for Eclipse</description>
      <dependencies>  
        <dependency>
    	     <groupId>org.seleniumhq.selenium</groupId>
    	     <artifactId>selenium-java</artifactId>
    	     <version>2.47.1</version>
         </dependency>
         <dependency>
    	     <groupId>junit</groupId>	
    	     <artifactId>junit</artifactId>
    	     <version>4.11</version>
    	     <scope>test</scope>
        </dependency>
         	
      </dependencies> 
    	<build>
    	     <defaultGoal>install</defaultGoal>
    	     <plugins>
    	          <plugin>
    	               <groupId>org.apache.maven.plugins</groupId>
    	               <artifactId>maven-compiler-plugin</artifactId>
    	               <configuration>
    	                    <source>1.7</source>
    	                    <target>1.7</target>
    	               </configuration>
    	          </plugin>
    	      </plugins>
    	</build>  
    </project>

    Regards


    Martin

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    878
    Rep Power
    11

    Default Re: Maven ignoring new test files

    Please refer this link.it may help you.
    https://groups.google.com/forum/#!to...rs/hp9GO6U1xXE
    Ramya:cool:

  3. #3
    Nissem is offline Member
    Join Date
    Sep 2015
    Posts
    2
    Rep Power
    0

    Default Re: Maven ignoring new test files

    Thanks for the link Ramaya, I appreciate it!

    I don´t know what the problem was but after creating a new project and copying the files into that one (just changing class and package names) everything worked as expected and all files were executed. I probably need to learn more about where to find the correct logs to analyse the problem if I would run into it again in the future.

    The link looks like it is about choosing between different sets of tests, not about testfiles being ignored, but it will be useful for me in the next step of what I want to achieve :)

Similar Threads

  1. Replies: 4
    Last Post: 04-17-2015, 10:16 AM
  2. Replies: 3
    Last Post: 12-15-2014, 02:48 PM
  3. Replies: 0
    Last Post: 04-11-2014, 01:15 PM
  4. maven build error for JSP files
    By devip in forum Apache Maven
    Replies: 0
    Last Post: 01-22-2013, 08:59 AM
  5. Error with a JUnit test using maven surefire plugin
    By masijade in forum Apache Maven
    Replies: 0
    Last Post: 03-16-2012, 02:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •