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 control开发者_运维知识库ler
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.
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.
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.
精彩评论