Brad Mace
Brad Mace

Reputation: 27886

Testing Play Modules

Is there a standard way to set up Selenium tests for a Play module, as opposed to an application? I can't find any info on how to do it. It seems like it would need an application to run in, but when I set one up under test/ its not happy. When the app's controllers are in the controller package it says they should be in testapp.app.controllers. When I change them to testapp.app.controllers it says they should be in `controllers.

Upvotes: 1

Views: 277

Answers (2)

Pere Villega
Pere Villega

Reputation: 16439

having the folder structure in the question would help :).

Please check you are doing the following:

  • Creating an application (play new TestApp)
  • Verify it works (play run TestApp)
  • Add a module to the application
  • Add test controllers (and other classes/files) under test/ folder in the module. NOTE: only test files go there
  • Run the main application in test mode (play test TestApp)
  • Go to http://localhost:9000/@tests to see the test interface

I just noticed your comment when you mention play run testapp. I think that's your error, you should run play test testapp instead.

Upvotes: 1

niels
niels

Reputation: 7309

Normally you make folder with a play-app just-tests. There you make an app which refers to your module and run the tests in it.

Upvotes: 2

Related Questions