arquillian / arquillian-extension-drone

Arquillian Drone provides a simple way to write functional tests for web apps. Drone brings the power of WebDriver into the Arquillian, and the power of Arquillian to WebDriver.
57 stars 51 forks source link

Allow switching browser on the fly on test basis #151

Open slaskawi opened 5 years ago

slaskawi commented 5 years ago
Issue Overview

Currently, Arquillian doesn't allow changing injected Web Driver objects into Pages per test-basis.

Here's an example. In Keycloak testsuite we have a Page objects, that contain an injected Web Driver. Graphene allows us to change the Web Driver used for navigating the page using annotations (see the manual). However, if the Page object contains an injected Web Driver, the default one gets injected. This very often confuses Graphene (and users) since we have two drivers for navigating the same page.

Expected Behaviour

The Web Driver injected into the Page objects should be the same as the one used by Graphene.

Current Behaviour

Instead of a custom Web Driver, the default one gets injected.

Steps To Reproduce

Unfortunately I don't have a custom reproducer for this. Probably the easiest way would be to have a look at my Pull Request against Keycloak: https://github.com/keycloak/keycloak/pull/5930/files

Additional Information

This is definitely a Feature Request not a bug. @MatousJobanek What do you think about this feature? Would you consider implementing this? If the time doesn't allow you to do it, I might try to help by donating the implementation. However, I'm not an expert in Graphene, so I would be more than happy, if you give me some advise how this should be implemented.

MatousJobanek commented 5 years ago

Hi @slaskawi,

thanks for creating this issue. The feature looks very valid and definitely helpful for such a bit more complicated test cases. However, I'm afraid that I won't be able to find any time I could spend with implementing this feature. With that being said, I'll be more than happy if you can do the implementation on your own and provide a PR. Personally, I would start looking at the enrichers in graphene (mainly the PageObjects/Fragments ones) and also at the enricher in Drone. I hope that it will help