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/06/29 21:12:43 UTC

Setting up selenium and testng

Hello, I'm pretty new to Tapestry Selenium and TestNG, I was first wondering
if there was any documentation on how to setup your pom and packages for
running the testing. I also wanted to know if you need to mirror your src
and resources in the test packages with the exception of having to add the
test class? Seems silly to have to duplicate your code, but then again I'm
very new to this. Thanks

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-up-selenium-and-testng-tp5714191.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


Re: Setting up selenium and testng

Posted by George Christman <gc...@cardaddy.com>.
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 Steve Eynon <st...@alienfactory.co.uk>.
I don't know what your setup is, but no, I've never had to duplicate
code or resources when using T5 and Selenium. Whatever runs your
tests, just ensure the path / classpath is setup correctly.

Steve.

On 30 June 2012 03:12, George Christman <gc...@cardaddy.com> wrote:
> Hello, I'm pretty new to Tapestry Selenium and TestNG, I was first wondering
> if there was any documentation on how to setup your pom and packages for
> running the testing. I also wanted to know if you need to mirror your src
> and resources in the test packages with the exception of having to add the
> test class? Seems silly to have to duplicate your code, but then again I'm
> very new to this. Thanks
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Setting-up-selenium-and-testng-tp5714191.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
>

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