playframework - Play integration test with browser that supports WebSocket -
i trying simple integration tests websocket code using withbrowser:
class applicationcontrollerspec extends specification{ "application controller" should { "do something" in new withbrowser{ browser.goto("http://localhost:3333") browser.pagesource must contain("hello") } } }
when long error part of says:
webdriverexception: com.gargoylesoftware.htmlunit.scriptexception: referenceerror: "websocket" not defined.
is there alternative webdriver have websocket implemented? alternatively, there way have open firefox or chrome?
i appreciate advice on how test websocket code, looks there unanswered question here.
i using play 2.1.3.
i test websockets firefox:
withbrowser
supports first argument browser, see doc.
so like
class applicationcontrollerspec extends specification{ "application controller" should { "do something" in new withbrowser(play.api.test.helpers.firefox){ browser.goto("http://localhost:3333") browser.pagesource must contain("hello") } } }
if use firefox, idea load recent selenium driver it.
Comments
Post a Comment