Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,16 @@

Before you can start performing Java automation testing with Serenity, you would need to:

- Install the latest **Java development environment** i.e. **JDK 1.6 to JDK 1.8**.

- Download the latest **Selenium Client** and its **WebDriver bindings** from the [official website](https://www.selenium.dev/downloads/). Latest versions of Selenium Client and WebDriver are ideal for running your automation script on LambdaTest Selenium cloud grid.
- Install the latest **Java development environment**, and at least **JDK 1.8**.

- Install **Maven** which supports **JUnit** framework out of the box. **Maven** can be downloaded and installed following the steps from [the official website](https://maven.apache.org/). Maven can also be installed easily on **Linux/MacOS** using [Homebrew](https://brew.sh/) package manager.

### Cloning Repo And Installing Dependencies

**Step 1:** Clone the LambdaTest’s Serenity-Selenium-Sample repository and navigate to the code directory as shown below:
**Step 1:** Clone the Serenity-Selenium-Sample repository and navigate to the code directory as shown below:

```bash
git clone https://github.com/LambdaTest/Serenity-Selenium-Sample
git clone https://github.com/serenity-bdd/Serenity-Selenium-Sample.git
cd Serenity-Selenium-Sample
```

Expand All @@ -58,7 +56,8 @@ mvn versions:display-dependency-updates

### Setting Up Your Authentication

Make sure you have your LambdaTest credentials with you to run test automation scripts. You can get these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build?utm_source=github&utm_medium=repo&utm_campaign=serenity-selenium-sample) or by your [LambdaTest Profile](https://accounts.lambdatest.com/login?utm_source=github&utm_medium=repo&utm_campaign=serenity-selenium-sample).
Make sure you have your LambdaTest credentials with you to run test automation scripts.
You can get these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build?utm_source=github&utm_medium=repo&utm_campaign=serenity-selenium-sample) or by your [LambdaTest Profile](https://accounts.lambdatest.com/login?utm_source=github&utm_medium=repo&utm_campaign=serenity-selenium-sample).

**Step 2:** Set LambdaTest **Username** and **Access Key** in environment variables.

Expand All @@ -85,7 +84,7 @@ Feature: Google's Search Functionality
Then I should see title "LambdaTest - Google Search"
```

Following below is the `GooglePage.java` file for the above Test Case Scenario.
The page object the `GooglePage.java` file for the above Test Case Scenario.

```java title="GooglePage.java"
package com.lambdatest.cucumber.pages;
Expand All @@ -110,7 +109,8 @@ public class GooglePage extends PageObject {
public void searchForString(String searchString) {
search.sendKeys(searchString);
}
public void submitForm() throws Exception {

public void submitForm() throws Exception {
searchButton.click();
Thread.sleep(5000);
}
Expand Down
117 changes: 3 additions & 114 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,16 @@
<maven.compiler.target>${java.version}</maven.compiler.target>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>2.0.48</serenity.version>
<serenity.maven.version>2.0.67</serenity.maven.version>
<serenity.cucumber.version>1.9.37</serenity.cucumber.version>
<serenity.version>3.6.16</serenity.version>

<maven.failsafe-plugin.version>3.0.0-M3</maven.failsafe-plugin.version>
<maven.surefire-plugin.version>3.0.0-M3</maven.surefire-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
<maven.compiler-plugin.version>3.8.0</maven.compiler-plugin.version>

<jetty-io.version>10.0.2</jetty-io.version>
<jetty-util.version>10.0.2</jetty-util.version>

</properties>

<repositories>
<repository>
<id>serenity</id>
<name>bintray</name>
<url>http://dl.bintray.com/serenity/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>serenity</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/serenity/maven</url>
</pluginRepository>
</pluginRepositories>

<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
<version>${jetty-io.version}</version>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty-util.version}</version>
</dependency>

<dependency>
<groupId>net.serenity-bdd</groupId>
Expand All @@ -71,25 +40,15 @@
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-rest-assured</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>${serenity.cucumber.version}</version>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.6</version>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand All @@ -112,24 +71,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<requireUpperBoundDeps/>
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand All @@ -154,8 +95,6 @@
<includes>
<include>com/lambdatest/cucumber/SingleTest.java</include>
</includes>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -189,54 +128,4 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>single</id>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe-plugin.version}</version>
<configuration>
<includes>
<include>com/lambdatest/cucumber/SingleTest.java</include>
</includes>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<systemPropertyVariables>
<environment>single</environment>
<taskID>MY_TEST_SCHEMA_${surefire.forkNumber}</taskID>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>parallel</id>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe-plugin.version}</version>
<configuration>
<includes>
<include>com/lambdatest/cucumber/Parallel*.java</include>
</includes>
<parallel>classes</parallel>
<threadCount>10</threadCount>
<forkCount>10</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<systemPropertyVariables>
<environment>parallel_${surefire.forkNumber}</environment>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
63 changes: 0 additions & 63 deletions src/test/java/com/lambdatest/LambdaTestSerenityDriver.java

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/java/com/lambdatest/LambdaTestSerenityTest.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/java/com/lambdatest/cucumber/ParallelChromeTest.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/java/com/lambdatest/cucumber/ParallelFirefoxTest.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/java/com/lambdatest/cucumber/ParallelIETest.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/java/com/lambdatest/cucumber/ParallelSafariTest.java

This file was deleted.

7 changes: 3 additions & 4 deletions src/test/java/com/lambdatest/cucumber/SingleTest.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.lambdatest.cucumber;

import com.lambdatest.LambdaTestSerenityTest;
import cucumber.api.CucumberOptions;
import io.cucumber.junit.CucumberOptions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "src/test/resources/features/single.feature")
public class SingleTest extends LambdaTestSerenityTest {
@CucumberOptions(features = "src/test/resources/features/a_simple_todo_app.feature")
public class SingleTest {
}
Loading