Modules - LivePersonInc/ephemerals GitHub Wiki

Selenium Module

Selenium module allows you to launch browser instances.

SeleniumEphemeral seleniumEphemeral = new SeleniumEphemeral.Builder(deploymentContext)
            .withDesiredCapabilities(DesiredCapabilities.firefox())
            .build()

RemoteWebDriver remoteWebDriver = seleniumEphemeral.get();
remoteWebDriver.get("http://yahoo.com");

Configuration

SeleniumEphemeral can be configured with following parameters:

  • desiredCapablities: Defines browser type to be used
Browser Type Desired Capabilities
Firefox DesiredCapabilities.firefox()
Chrome DesiredCapabilities.chrome()
PhantomJS DesiredCapabilities.phantomjs()
  • 'dimension': Defines screen resolution of display server

Appium Module

Appium module allows you to launch Appium Server and Android Emulator

AppiumAndroidEphemeral appiumAndroidEphemeral = AppiumAndroidEphemeral.Builder(deploymentContext)
                    .withDesiredCapabilities(capabilities)
                    .build());

AndroidDriver remoteWebDriver = seleniumEphemeral.get();

Configuration

AppiumAndroidEphemeral can be configured with following parameters:

  • desiredCapablities

Nginx Module

Nginx module allows you to start HTTP servers in test.

NginxEphemeral nginxEphemeral = new NginxEphemeral.Builder(deploymentContext)
            .build()

//Deploy and get Nginx ephemeral endpoint in the form of a URL object
URL url = nginxEphemeral.get();

//send HTTP request to Nginx server and verify response status code
HttpClient client = HttpClientBuilder.create().build();
HttpGet request = new HttpGet(url.toString());
HttpResponse response = client.execute(request);
Assert.assertEquals(200,response.getStatusLine().getStatusCode());

Configuration

  • staticContent: Volume to mount as static content into Nginx server