Initial commit of kitchensink ftest project #478

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
5 participants

Two tests are commented out because of https://issues.jboss.org/browse/JDF-239.

Contributor

sgilda commented Apr 3, 2013

I ran the qstool plugin against this and it reported the following issues:

  • kitchensink/pom.xml :
    • The following dir [functional-tests] is not listed as one of project submodules
    • 265 lines contain tab characters
  • kitchensink/functional-tests/pom.xml file : license doesn't match the template

The tab character issue is strange because I fixed all those issues upstream. When I check out the upstream version, it has no tab characters. It doesn't look like you modified that file, so I'm not sure what's going on with this.

Also, do you plan to add any information about the funtional tests to the README file? There's a "Run the Arquillian Tests" section. Maybe it would be nice to add a "Run the Functional Tests" section that talks about their purpose, how to run them, etc. Or are they not intended for developers and only for QA? I would think they would be beneficial for developers as examples of how to write functional tests for their apps. I also think we need to explain the functional-test directory.

In any event, I would like to know how to run them. I tried running 'mvn clean test -Parq-jbossas-remote' from that directory and it was apparently wrong. :-)

Yes you are right with these 256 lines of tabs in pom.xml, sorry for them,
I'll fix it. Regarding licence, well, the best thing will be just
copy-paste some existing one, I do not know what I am doing wrong really.
Regarding submodule, that can be easilly done (but Pete wanted to have no
mentioning about any directories in the main pom.xml at all despite he told
me firstly it is ok to have profiles in main pom.xml which executes the
goals in ftest dir)

I have already written README but I forgot to add it to the commit, sorry
once again. When you are curious about how to execute it, you have to
firstly mvn clean package in the classic project and then enter ftest dir
and execute what you did.

I'll look at it tomorrow in work, should not take more then coule of
minutes to resolve all issues.

On Wed, Apr 3, 2013 at 8:37 PM, sgilda notifications@github.com wrote:

I ran the qstool plugin against this and it reported the following issues:

  • kitchensink/pom.xml :
    • The following dir [functional-tests] is not listed as one of
      project submodules
    • 265 lines contain tab characters
      • kitchensink/functional-tests/pom.xml file : license doesn't match
        the template

The tab character issue is strange because I fixed all those issues
upstream. When I check out the upstream version, it has no tab characters.
It doesn't look like you modified that file, so I'm not sure what's going
on with this.

Also, do you plan to add any information about the funtional tests to the
README file? There's a "Run the Arquillian Tests" section. Maybe it would
be nice to add a "Run the Functional Tests" section that talks about their
purpose, how to run them, etc. Or are they not intended for developers and
only for QA? I would think they would be beneficial for developers as
examples of how to write functional tests for their apps. I also think we
need to explain the functional-test directory.

In any event, I would like to know how to run them. I tried running 'mvn
clean test -Parq-jbossas-remote' from that directory and it was apparently
wrong. :-)


Reply to this email directly or view it on GitHubhttps://github.com/jboss-jdf/jboss-as-quickstart/pull/478#issuecomment-15855165
.

Stefan Miklosovic

Contributor

sgilda commented Apr 3, 2013

No worries. :-)

@pmuir pmuir commented on the diff Apr 26, 2013

kitchensink/functional-tests/pom.xml
+ <scope>import</scope>
+ </dependency>
+
+ <!-- Arquillian dependency -->
+ <dependency>
+ <groupId>org.jboss.bom</groupId>
+ <artifactId>jboss-javaee-6.0-with-tools</artifactId>
+ <version>${version.org.jboss.bom}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.graphene</groupId>
+ <artifactId>graphene-webdriver-impl</artifactId>
+ <version>${version.org.jboss.arquillian.graphene2}</version>
@pmuir

pmuir Apr 26, 2013

Owner

Are Graphene and Drone supported in WFK?

Owner

pmuir commented Apr 26, 2013

Apart from checking if Graphene and Drone are supported (if they are, let's get them added to the -with-tools BOM), this looks good.

Contributor

sgilda commented May 2, 2013

@smiklosovic : Are we still waiting for an answer as to whether there is Graphene and Drone support in WFK?

Contributor

kpiwko commented May 3, 2013

Drone is supported in WFK since 2.0.0. Graphene2 didn't hit the stream yet, its 2.0.0.Final is planned for July, so it will take some time to get it in WFK.

Contributor

sgilda commented May 8, 2013

@smiklosovic : Karel responded. It sounds lie Drone should be added to the -with-tools BOM. Is that something you can take care of?

@sgilda Not sooner than after 1.7.2013

Contributor

sgilda commented May 8, 2013

@smiklosovic : Does 1.7.2013 == July 1, 2013? ;-)

@sgilda yes, I am taking something like long term leave. If you want to make it sooner, please redirect your request to more appropriate comitter.

Contributor

sgilda commented May 8, 2013

@smiklosovic : Thanks for the update. I'll check with @pmuir and see what he wants to do.

Contributor

sgilda commented May 14, 2013

Contributor

kpiwko commented May 15, 2013

Sande, yes see one of my previous comments. Still, while we have Drone in WFK, we do not have Graphene 2 there. So we can't really proceed here.

Contributor

sgilda commented Aug 2, 2013

Just checked with Lukas. Graphene 2 is currently in Alpha, soon to be Beta.

Owner

pmuir commented Aug 19, 2013

@kpiwko @smiklosovic @maschmid we can proceed with this now. Can you check if the PR is up to date, and then we can merge.

Contributor

sgilda commented Aug 20, 2013

I just tried the functional tests with the following errors. It could be something I'm doing wrong.

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.370s
[INFO] Finished at: Tue Aug 20 15:51:02 EDT 2013
[INFO] Final Memory: 29M/329M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test (default-test) on project jboss-as-kitchensink-test-webdriver: There are test failures.
[ERROR]
[ERROR] Please refer to /home/sgilda/GitRepos/quickstart-jdf/kitchensink/functional-tests/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]

Surefire reports contains this:

Test set: org.jboss.as.quickstarts.kitchensink.test.webdriver.KitchensinkTest

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.536 sec <<< FAILURE!
org.jboss.as.quickstarts.kitchensink.test.webdriver.KitchensinkTest Time elapsed: 0 sec <<< ERROR!
java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive org.jboss.as.quickstarts.kitchensink.test.webdriver.KitchensinkTest.createDeployment()
at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:160)
at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generateDeployment(AnnotationDeploymentScenarioGenerator.java:94)
at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generate(AnnotationDeploymentScenarioGenerator.java:57)
at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:79)
;;;;
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:156)
... 54 more
Caused by: java.lang.IllegalArgumentException: File for import exist: /home/sgilda/GitRepos/quickstart-jdf/kitchensink/functional-tests/../target/jboss-as-kitchensink.war
at org.jboss.shrinkwrap.api.ArchiveFactory.createFromZipFile(ArchiveFactory.java:179)
at org.jboss.shrinkwrap.api.ShrinkWrap.createFromZipFile(ShrinkWrap.java:185)
at org.jboss.as.quickstarts.kitchensink.test.webdriver.KitchensinkTest.createDeployment(KitchensinkTest.java:76)
... 59 more

There are no messages in the JBoss server log.

File for import exist: /home/sgilda/GitRepos/quickstart-jdf/kitchensink/functional-tests/../target/jboss-as-kitchensink.war

it means this war does not exist, it seems you have to build the project itself with mvn clean package, then go to ftest dir and execute mvn test -Psome-profile (note there is not clean goal!)

Contributor

sgilda commented Aug 20, 2013

@smiklosovic : That did it. I think you need to add this information to the README file. I had done mvn clean package jboss-as:deploy as described above, but that apparently wasn't enough.

Would you mind modifying the section 'Run the Arquillian Functional Tests' to be in step format, similar to the 'Run the Arquillian Tests' section?

Maybe something like the followinge:

Run the Arquillian Functional Tests

This quickstart provides Arquillian functional tests as well. They are located under the directory "functional-tests". Functional tests verify that your application behaves correctly from the user's point of view - simulating clicking around the page as a normal user would do.

To run these tests, you must build the main project as described above.

  1. Open a command line and navigate to the root directory of this quickstart.

  2. Build the quickstart WAR using the following command:

    mvn clean package
    
  3. Navigate to the functional-tests/ directory in this quickstart.

  4. If you have a running instance of the JBoss Server, as described above, run the remote tests by typing the following command:

    mvn clean test -Parq-jbossas-remote
    
  5. If you prefer to run the functional tests using managed instance of the JBoss server, meaning the tests will start the server for you, type fhe following command:

    mvn clean test -Parq-jbossas-managed
    
Contributor

kpiwko commented Aug 21, 2013

Let's change the approach. WFK now supports Maven Resolver, so there is no need to rely on mvn clean package to build the WAR for you. You can let test build the war on its own. So basically steps 1-2 won't be needed anymore and also tests will work ootb from IDE

Contributor

maschmid commented Aug 21, 2013

I think a functional test should be black box test, and as such cannot build its WAR itself, as there would be no guarantee the result is the same as what maven builds. It should test the exact binary an end user is going to deploy.

Contributor

maschmid commented Aug 21, 2013

Anyway, let's close this PR, I'll fix the other issues and open another pull request with the updates.

Contributor

sgilda commented Aug 21, 2013

@maschmid. @smiklosovic : Are you saying this needs some modifications before it will run as you expect? I will close this as you requested.

sgilda closed this Aug 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment