/** * Executes a block of code in a running server, with a test browser. * * @param server the test server. * @param webDriver the web driver instance. * @param block the block of code to execute. */ public static void running(TestServer server, WebDriver webDriver, final Consumer<TestBrowser> block) { Helpers$.MODULE$.runSynchronized(server.application(), asScala(() -> { TestBrowser browser = null; TestServer startedServer = null; try { start(server); startedServer = server; browser = testBrowser(webDriver, (Integer) OptionConverters.toJava(server.config().port()).get()); block.accept(browser); } finally { if (browser != null) { browser.quit(); } if (startedServer != null) { stop(startedServer); } } return null; })); }
/** * Executes a block of code in a running server. * @param server the server to start. * @param block the block of code to run after the server starts. */ public static void running(TestServer server, final Runnable block) { Helpers$.MODULE$.running(server, asScala(() -> { block.run(); return null; })); }
/** * Creates a Test Browser. */ public static TestBrowser testBrowser(Class<? extends WebDriver> webDriver) { return testBrowser(webDriver, Helpers$.MODULE$.testServerPort()); }
protected void start(FakeApplication fakeApplication) { start(fakeApplication, Helpers$.MODULE$.testServerPort()); }
/** * Creates a Test Browser. */ public static TestBrowser testBrowser(WebDriver of) { return testBrowser(of, Helpers$.MODULE$.testServerPort()); }
/** * Executes a block of code in a running server, with a test browser. * * @param server the test server. * @param webDriver the web driver instance. * @param block the block of code to execute. */ public static void running(TestServer server, WebDriver webDriver, final Consumer<TestBrowser> block) { Helpers$.MODULE$.runSynchronized(server.application(), asScala(() -> { TestBrowser browser = null; TestServer startedServer = null; try { start(server); startedServer = server; browser = testBrowser(webDriver, (Integer) OptionConverters.toJava(server.config().port()).get()); block.accept(browser); } finally { if (browser != null) { browser.quit(); } if (startedServer != null) { stop(startedServer); } } return null; })); }
/** * Creates a Test Browser. */ public static TestBrowser testBrowser(WebDriver of) { return testBrowser(of, Helpers$.MODULE$.testServerPort()); }
/** * Creates a Test Browser. */ public static TestBrowser testBrowser(Class<? extends WebDriver> webDriver) { return testBrowser(webDriver, Helpers$.MODULE$.testServerPort()); }
/** * Executes a block of code in a running application. * * @param application the application context. * @param block the block to run after the Play app is started. */ public static void running(Application application, final Runnable block) { Helpers$.MODULE$.running(application.asScala(), asScala(() -> { block.run(); return null; })); }
/** * Creates a Test Browser. * * @param of the web driver to run the browser with. * @return the test browser. */ public static TestBrowser testBrowser(WebDriver of) { return testBrowser(of, Helpers$.MODULE$.testServerPort()); }
/** * Creates a Test Browser. * * @param of the web driver to run the browser with. * @return the test browser. */ public static TestBrowser testBrowser(WebDriver of) { return testBrowser(of, Helpers$.MODULE$.testServerPort()); }
/** * Executes a block of code in a running application. * * @param application the application context. * @param block the block to run after the Play app is started. */ public static void running(Application application, final Runnable block) { Helpers$.MODULE$.running(application.asScala(), asScala(() -> { block.run(); return null; })); }
/** * Executes a block of code in a running server. * @param server the server to start. * @param block the block of code to run after the server starts. */ public static void running(TestServer server, final Runnable block) { Helpers$.MODULE$.running(server, asScala(() -> { block.run(); return null; })); }
/** * Creates a Test Browser. * * @param webDriver the class of webdriver. * @return the test browser. */ public static TestBrowser testBrowser(Class<? extends WebDriver> webDriver) { return testBrowser(webDriver, Helpers$.MODULE$.testServerPort()); }
/** * Creates a Test Browser. * * @param webDriver the class of webdriver. * @return the test browser. */ public static TestBrowser testBrowser(Class<? extends WebDriver> webDriver) { return testBrowser(webDriver, Helpers$.MODULE$.testServerPort()); }