1 of 1 people found this helpful
there is mistake in the documentation. Thanks for pointing that out.
The correct package for @Page in Graphene 2.0.0.Beta1+ is, as you already said:
You do not have to extend any class. Extending AbstractGrapheneTest in the documentation just wanted to note that all the other Arquillian related methods are higher in the hierarchy. I have to admit that it is quite misleading, and I will correct it.
The com.sun.jdi.InvocationException is thrown by Eclipse debugger for me as well. We will look into that to improve it. It should not affect the functionality though. I have created this issue to address it:
Otherwise it should work as it is said in the guide:
Have you resolved the issue somehow ? Are you sure that during runtime there is a element with id "header" ? Are you using JSF ? Is not it in the iframe ? Is the correct page loaded in your browser ?
Thanks for the feedback anyway!
Thanks. So w.r.t. Documentation it is clear now. For the rest, I resolved the issue. I simply overlooked the need to initialize the injected page explicitly with:
this.loginPage = PageFactory.initElements(this.browser, LoginPage.class);
After this I get the expected values now from the page. So this issue is resolved.
Right away I’m working on the next steps with new surprises on each step, but so far I could resolve them. .-)
That is weird. You do not have to initialize Page Objects with any Page Factory. Graphene should take care of it. Could you please post the complete test code here ?
I sent you a zip with three test classes as separated mail.
Thanks for the hints.
I cleaned up my poms as you mentioned under 1). I prefer this solution which in fact is working!
ArquillianResource injection doesn't work, because I do not have any ShrinkWrap deployment. I started with it, but I found it very tedious to set it up. Maybe I must come back with it to make it fit into the test suite for the whole application. But actually I'm more interested to learn how to write the tests the best way and having the application deployed on the server makes it easier. Finalizing comes later.
What most will interest you, I do not need any page factoring anymore. It didn't work from the beginning, but fiddling around, restarting eclipse and cleaning directories in temp and on the server helped and finally it works as expected.
Meanwhile I set up the Firefox profile within the arquillian.xml too. This was foreseen anyway. The programed version was just a quick and dirty solution. However I wonder how to switch the preferred language of the browser on the fly. The application is multilingual, and it would be nice, if the language switch could be tested automatically too!
1 of 1 people found this helpful
I found useful deploying whole application in functional testing of the app. Here it is, how it can be achieved:
The only drawback currently with this approach is that it deploys the application for every test class, which can cause OutOfMemory proprlems. It will be solved in Arquillian 2, meanwhile easy workaround is to restart server after some tests classes...
Changing the language configuration on the fly:
I think that you can prepare multiple profiles for Firefox, where your desired language is set. Then you can use Graphene feature of multiple browsers instances described here:
You can configure each browser with custom firefox profile, and use them in one test. I hope I am clear here
Thanks for the hints. For multilanguage testing I suspected already, it must be done this way. I can live with that.
ShrinkWrap.createFromZipFile is a really good hint! Is it possible to create from a complete ear with actually 7 modules! I.e. 3 wars, one EJB-jar and 3 javaApp jars?
Afaik, it is possible. You can create one war and then add to it multiple archives with addArchive().