Beispiel #1
0
 /** Executes a block of code in a running server, with a test browser. */
 public static void running(
     TestServer server, WebDriver webDriver, final Consumer<TestBrowser> block) {
   synchronized (PlayRunners$.MODULE$.mutex()) {
     TestBrowser browser = null;
     TestServer startedServer = null;
     try {
       start(server);
       startedServer = server;
       browser = testBrowser(webDriver, server.port());
       block.accept(browser);
     } finally {
       if (browser != null) {
         browser.quit();
       }
       if (startedServer != null) {
         stop(startedServer);
       }
     }
   }
 }
Beispiel #2
0
 /** Stops a Test server. */
 public static void stop(TestServer server) {
   server.stop();
 }
Beispiel #3
0
 /** Starts a Test server. */
 public static void start(TestServer server) {
   server.start();
 }