com.liveperson.ephemerals:ephemerals-module-selenium

Short-lived test objects, on the cluster

License

License

GroupId

GroupId

com.liveperson.ephemerals
ArtifactId

ArtifactId

ephemerals-module-selenium
Last Version

Last Version

1.0.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

Short-lived test objects, on the cluster

Download ephemerals-module-selenium

How to add to project

<!-- https://jarcasting.com/artifacts/com.liveperson.ephemerals/ephemerals-module-selenium/ -->
<dependency>
    <groupId>com.liveperson.ephemerals</groupId>
    <artifactId>ephemerals-module-selenium</artifactId>
    <version>1.0.0.7</version>
</dependency>
// https://jarcasting.com/artifacts/com.liveperson.ephemerals/ephemerals-module-selenium/
implementation 'com.liveperson.ephemerals:ephemerals-module-selenium:1.0.0.7'
// https://jarcasting.com/artifacts/com.liveperson.ephemerals/ephemerals-module-selenium/
implementation ("com.liveperson.ephemerals:ephemerals-module-selenium:1.0.0.7")
'com.liveperson.ephemerals:ephemerals-module-selenium:jar:1.0.0.7'
<dependency org="com.liveperson.ephemerals" name="ephemerals-module-selenium" rev="1.0.0.7">
  <artifact name="ephemerals-module-selenium" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.liveperson.ephemerals', module='ephemerals-module-selenium', version='1.0.0.7')
)
libraryDependencies += "com.liveperson.ephemerals" % "ephemerals-module-selenium" % "1.0.0.7"
[com.liveperson.ephemerals/ephemerals-module-selenium "1.0.0.7"]

Dependencies

compile (5)

Group / Artifact Type Version
com.liveperson.ephemerals : ephemerals-core jar 1.0.0.7
org.seleniumhq.selenium : selenium-java jar 2.53.0
org.slf4j : slf4j-log4j12 jar 1.7.2
log4j : log4j jar 1.2.12
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Ephemerals

Build Status Maven Central

Ephemerals make it easy to setup test environment on-the-fly and let it scale with your container cluster. The main motivation behind Ephemerals is that whole test environment is launched and destroyed during test lifecycle.

Ephemerals takes care of deployment process of testing endpoints and initialization of test objects:

Ephemerals can be deployed on various cloud providers for creating use-and-throw instances of browsers, web services, databases or anything else than can expose a connection endpoint.

Prerequisites

Ephemeral objects will be deployed and launched on a container cluster using a cluster manager. Following cluster managers are currently supported:

  • Kubernetes

For this quickstart, you can create a Kubernetes cluster using following options:

  • Run a Kuberenetes cluster locally using Minikube. You can find a detailed tutorial here on how to install and use Minikube.
  • Opening an account on Google Cloud Platform (GCP). GCP and its Container Engine(GKE) use Kubernetes to manage and orchestrate containers in the cluster. Follow this tutorial to spinup your first Kubernetes cluster on GKE.

Quickstart

For this quickstart, we will create a simple Junit test which will launch a Selenium standalone server using Kubernetes and initialize a RemoteWebDriver instance . We will assume that you already have a Kubernetes cluster and it's ready to use.

First, add below Maven dependencies:

<dependency>
        <groupId>com.liveperson.ephemerals</groupId>
        <artifactId>ephemerals-core</artifactId>
        <version>1.0.0.4</version>
</dependency>
<dependency>
        <groupId>com.liveperson.ephemerals</groupId>
        <artifactId>ephemerals-module-selenium</artifactId>
        <version>1.0.0.4</version>
</dependency>
<dependency>
        <groupId>com.liveperson.ephemerals</groupId>
        <artifactId>ephemerals-provider-kubernetes</artifactId>
        <version>1.0.0.4</version>
</dependency>

Initialize FireFox Selenium ephemeral instance and set Kubernetes cluster configuration using Junit rule:

@Rule
public EphemeralResource<RemoteWebDriver> seleniumResource = new EphemeralResource(
new SeleniumEphemeral.Builder(KubernetesEphemeral.create(KUBERNETES_HOST,KUBERNETES_USERNAME,KUBERNETES_PASSWORD))
                .withDesiredCapabilities(DesiredCapabilities.firefox())
        .build());

Get RemoteWebDriver instance and do some stuff using WebDriver API:

@Test
public void test() throws IOException {

        RemoteWebDriver remoteWebDriver = seleniumResource.get();
        remoteWebDriver.get("http://yahoo.com");
        Assert.assertNotNull(remoteWebDriver.findElementById("uh-logo"));

}

For more examples, see here

Documentation

See the Wiki for documentation and examples.

Features

Tests Integration

Ephemerals can be integrated into system tests, integration and end-to-end tests to programmatically create required environment entities from developer's test code.

Plug-able Cluster Systems

Ephemerals were built to support multiple cluster management systems (Ephemeral's Deployment Providers). For example, you can switch from Kubernetes to Mesos almost transparently.

Cluster-based Scaling

Ephemerals can scale according to your servers cluster resources. The amount of parallel Ephemerals instances depends only on your cluster's nodes capacity.

Cloud Platforms Support

Ephemerals can be used with any cloud computing platform (Google Cloud, AWS, etc..), given it supports one of our Deployment Providers. A perfect use-case would be using Ephemerals with Google Cloud Platform and its GKE, which is based on Kubernetes.

Build

Maven is used as a build system. In order to produce a package, run maven command mvn clean package -DskipTests.

Tests can be executed using command mvn test.

License

MIT

com.liveperson.ephemerals

LivePerson, Inc.

Versions

Version
1.0.0.7
1.0.0.6
1.0.0.5
1.0.0.4
1.0.0.3
1.0.0.2
1.0.0.1
1.0.0.0