You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Christman <gc...@cardaddy.com> on 2012/07/02 15:16:38 UTC

Re: Setting up selenium and testng

I have the following package structure,

//Main
src/main/java/com/company/testproject/pages
src/main/java/com/company/testproject/components
src/main/resources/com/company/testproject/pages
src/main/resources/com/company/testproject/components
src/main/webapp/layout

//Test
src/test/config
src/test/java/com/company/testproject/pages
src/test/java/com/company/testproject/components
src/test/resources/com/company/testproject/pages
src/test/resources/com/company/testproject/components

//Example Test
src/test/java/com/company/testproject/pages/Form.java
src/test/java/com/company/testproject/FormTest.java
src/test/resources/com/company/testproject/pages/Form.tml

I guess my question is, do I need to also have Form.java/.tml in my src main
packages, or can the app be ran from the test packages? Is there a way to
setup the class path to handle this automatically? If it can be ran from the
test packages, how do you typically handle testing without db commits?

Thanks Steve. 





--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-up-selenium-and-testng-tp5714191p5714238.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Setting up selenium and testng

Posted by George Christman <gc...@cardaddy.com>.
I was able to resolve everything on my own. I was looking at the source to
tap-jquery which was much more complicating than what I needed. As it turned
out I just needed to add the following code to my build, add a test to my
testPackage, and map it with testng.xml leaving my src intact. Seems to work
perfectly. 

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

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-up-selenium-and-testng-tp5714191p5714250.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Setting up selenium and testng

Posted by George Christman <gc...@cardaddy.com>.
Sorry clarifying previous question. After expanding my war file. I noticed
the java classes were not included with pages, components, however the
appModule was included with services. Not sure what I need to configure to
get the project to build with the java classes. 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-up-selenium-and-testng-tp5714191p5714246.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Setting up selenium and testng

Posted by George Christman <gc...@cardaddy.com>.
One last question, when I build my war file, how do I get glassfish to use
the test-classes path? I'm assuming it's using classes which is causing my
application not to run in glassfish. 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-up-selenium-and-testng-tp5714191p5714245.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Setting up selenium and testng

Posted by George Christman <gc...@cardaddy.com>.
I may of answered some of my question, I changed my jetty pom configuration
to this. 

            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.26</version>
                <configuration>
                    <requestLog
implementation="org.mortbay.jetty.NCSARequestLog">
                        <append>true</append>
                    </requestLog>
                    <useTestClasspath>true</useTestClasspath>
                   
<webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
                    <stopKey>stop</stopKey>
                    <stopPort>8889</stopPort>
                </configuration>
            </plugin>

using "useTestClassPath" which seems to work. 

Still have a couple questions though, normally when I just type in localhost
in the browser, it will automatically bring up a url in my browser
redirecting me to the main page. This doesn't seem to be happening when
using testclasspath. Perhaps I'm missing something in my configuration. 

I'm also still wondering what your best practice is for testing without
doing a form submission with a db commit, or is this something you recommend
doing when your not in prod mode. 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-up-selenium-and-testng-tp5714191p5714243.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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