-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arquillian as JUnit rule instead of runner #107
Arquillian as JUnit rule instead of runner #107
Conversation
@bartoszmajsak maybe we can move these pieces into a new module and release as experimental module? cc/ @aslakknutsen |
That's cool stuff @ahus1. I will take time next week to review and we see how we can proceed further. Many thanks for your contribution! |
Any updates for this Pull Request? |
Try it out with extensions:
to figure out if it works and if there is any missing we should implement/add to this PR. Note: Downside of using this Rule is that it will execute e.g. cube-container logic per each test class rather than the whole suite. |
Findings for Rule & Arquillian Rule: public class DoubleDroneInjectionTestCase {
@ClassRule
public static ArquillianClassRule classRule = new ArquillianClassRule();
@Rule
public ArquillianRule rule = new ArquillianRule();
@Test
public void doubleMethodWebDrivers(@Drone WebDriver webdriver1, @Drone WebDriver webdriver2) {
Assert.assertNotNull("Class scoped webdriver1 was instantiated", this.webdriver1);
Assert.assertNotNull("Class scoped webdriver2 was instantiated", this.webdriver2);
Assert.assertNotNull("Method scoped webdriver1 was instantiated", webdriver1);
Assert.assertNotNull("Method scoped webdriver2 was instantiated", webdriver2);
} Getting validation error |
Upstream 1bc6804. Thank you so much! |
I'm working in an environment where I run my JUnit test suite using a spring runner. But I still wanted to use Graphene/Arquillian to test my frontends (https://github.com/dukecon/dukecon_server/blob/develop/impl/src/test/java/org/dukecon/server/gui/AbstractPageTest.java)
Therefore I've extracted the essential functionality of the Arquillian Runner into two JUnit rules: ArquillianClassRule and ArquillianRule. I wonder if you consider this a useful contribution to the Arquillian project.
Looking at the JUnitIntegrationWithRuleTestCase and the FIXME elements the rules behave a little bit different than the runner when it comes to test suites and custom lifecycles.
Hits what needs to be added, moved or removed are welcome. This PR is in work-in-progress state.
Thanks
Alexander