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:

https://github.com/schleichardt/stackoverflow-answers/commit/13d5876791ef409e092e4a097f54247d851e17dc#l8r14

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

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -