vendredi 3 juin 2016

Executing scalatest wordspec tests and testng tests in a single runner (in intelij)

I have a testng.xml file that starts a spring boot server using a testng listener and then runs acceptance tests from multiple projects. I launch this from intelij and everything works nicely.

I have a suite of tests written in scalatest that I would like to include. The suite is stacked as follows:

class AcceptanceTests extends WordSpec
  with CoreV1AssetEndpointsAcceptanceTest
  with CoreV1SyncEndpointsAcceptanceTest
  with CoreV1AssetStableUrlEndpointsAcceptanceTest

I can't mix in TestNGSuiteLike and this makes some sense.

Whats the best way to mount both the testng and scalatest tests so that they run in a fully intelij compatible way.

-- What I have tried.

I got the scalatest tests running (the server is receiving the test requests) via testng by declaring them as a junit suite by annotating the class with @RunWith(classOf[JunitRunner)) and adding a junit test case in the testng.xml. Intelij however is not aware of the running tests.

Aucun commentaire:

Enregistrer un commentaire