2

Is it possible to run arquillian tests through TestNG? Im trying this tutorial here, but it requires the Arquillian testRunner that i can only select with the @RunWith annotation from JUnit.

My research showed that there is no equivalent annotation/mechanism in TestNG.

tuberains
  • 191
  • 9
  • Unfortunately we haven't done any testing with TestNG so I'm not sure whether what we have would work by just replacing the arquillian-junit-container with the TestNG equivalent. In theory it's a yes, but not something we've tried. Feel free to give it a go and let us know if there are problems we can fix – Ken Jul 06 '17 at 17:58

1 Answers1

1

I have been using Arquillian with TestNG - I do not see any issues so far.

Check this site for the sample test - scroll down for the test.

http://www.testautomationguru.com/arquillian-graphene-page-fragments/

You need to extend the Arquillian base class to use it with TestNG.

@RunAsClient
public class GoogleSearchTest extends Arquillian{

}
vins
  • 15,030
  • 3
  • 36
  • 47
  • The will the `@RunAsClient` annotation cause all test to be ran outside of the container? As i experienced it, it is not required to put it on the type-level to enable the TestNG runner in the first place. – tuberains Jul 14 '17 at 09:56
  • @tuberains , yes , outside the container. I am not saying it is required. – vins Jul 14 '17 at 13:36
  • I rolled back to JUnit because i couldn't get the advertised dependency injection to work. But as you answered my first question correctly i'll award you... – tuberains Jul 17 '17 at 10:03