You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ja...@w9z.org on 2010/10/13 03:40:08 UTC

Questions about SeleniumTestCase

I am trying to switch to SeleniumTestCase for testing and I'm running into a few things that seem odd. Here is what I currently understand has to happen to get this working:

1. testng.xml must configure the package containing the tests and SeleniumLauncher

2. The test class must extend SeleniumTestCase

3. The tests have to be run as a suite. (Calling mvn test should do this).

A simple project with a single test gives the following error:


-------------------------------------------------------------------------------
Test set: TestSuite
-------------------------------------------------------------------------------
Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 1.443 sec <<< FAILURE!
indicateTestMethodName(test.integration.DemoTest)  Time elapsed: 0 sec  <<< FAILURE!
java.lang.NullPointerException
	at org.apache.tapestry5.test.SeleniumTestCase.indicateTestMethodName(SeleniumTestCase.java:97)
	
It looks like the delegate object in SeleniumTestCase is null, but I'm not sure how to create it other than configuring testng.xml.  Also I don't understand why I'm seeing 4 tests instead of just the one I created.  (Unless setup methods inherited from SeleniumTestCase will count toward tests).

Any suggestions?

Jack

Here is the testng.xml file just in case I'm overlooking something silly in it:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="tapestrydemo Application Test Suite" annotations="1.5">
    <test name="Unit Tests">
        <packages>
            <package name="test.integration"/>
        </packages>
       <classes>
      <class name="org.apache.tapestry5.test.SeleniumLauncher"/>
    </classes>
    </test>
</suite>




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Questions about SeleniumTestCase

Posted by ja...@w9z.org.
Well it works a lot better if you tell it where the testng.xml files is. :)  I was able to get it to work by adding some configuration information to the build plugins of the pom.xml.  Now the tests run and it shows the correct number of tests.  

So to correct my list.  It looks the you need the following 5 things to switch to SeleniumTestCase.

1. testng.xml must configure the package containing the tests and SeleniumLauncher

2. The test class must extend SeleniumTestCase

3. The tests have to be run as a suite. (Calling mvn test should do this).

4. The surefire plugin must point to testng.xml

Jack

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
     <configuration>
     <suiteXmlFiles>
       <suiteXmlFile>src/test/conf/testng.xml</suiteXmlFile>
     </suiteXmlFiles>
     </configuration>
</plugin>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org