Skip to content

Commit

Permalink
Restructured Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
4msha committed Feb 3, 2022
1 parent 63d22f3 commit d943fa1
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 40 deletions.
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1643911286853</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
88 changes: 48 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
# Java TestNG Selenium

### Environment Setup

1. Global Dependencies
* Install [Maven](https://maven.apache.org/install.html)
* Or Install Maven with [Homebrew](http://brew.sh/) (Easier)
```
$ install maven
```
2. Project Dependencies
* checkout the repository
* Check that packages are available
# Java-TestNG-Selenium-Sample
![Geb](https://www.lambdatest.com/support/assets/images/og-images/TestNG-framework-Selenium.jpg)

### Prerequisites
1. Install and set environment variable for java.
* Windows - https://www.oracle.com/java/technologies/downloads/
* Linux - ``` sudo apt-get install openjdk-8-jre ```
* MacOS - Java should already be present on Mac OS X by default.
2. Install and set environment varibale for Maven.
* Windows - https://maven.apache.org/install.html
* Linux/ MacOS - [Homebrew](http://brew.sh/) (Easier)
```
$ cd Java-TestNG-Selenium
install maven
```
* You may also want to run the command below to check for outdated dependencies. Please be sure to verify and review updates before editing your pom.xml file as they may not be compatible with your code.
```
$ mvn versions:display-dependency-updates
```
**LambdaTest Authentication Credentials:** Make sure you have your LambdaTest credentials with you to run test automation scripts with Jest on LambdaTest Selenium Grid. You can obtain these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/) or through [LambdaTest Profile](https://accounts.lambdatest.com/detail/profile).
Set LambdaTest Username and Access Key in environment variables.
* For Linux/macOS:
`export LT_USERNAME="YOUR_USERNAME"
export LT_ACCESS_KEY="YOUR ACCESS KEY"`
* For Windows:
`set LT_USERNAME="YOUR_USERNAME"
set LT_ACCESS_KEY="YOUR ACCESS KEY"`
### Running Tests
### Run your First Test
1. Clone the Java-TestNG-Selenium repository.
```
To run single test
$ mvn test -D suite=single.xml

To run parallel test

$ mvn test -D suite=parallel.xml

git clone https://github.com/LambdaTest/Java-TestNG-Selenium
```
2. Next get into Java-TestNG-Selenium folder, and import Lamabdatest Credentials. You can get these from lambdatest automation dashboard.
<p align="center">
<b>For Linux/macOS:</b>:
```
export LT_USERNAME="YOUR_USERNAME"
export LT_ACCESS_KEY="YOUR ACCESS KEY"
```
<p align="center">
<b>For Windows:</b>
```
## About LambdaTest
set LT_USERNAME="YOUR_USERNAME"
set LT_ACCESS_KEY="YOUR ACCESS KEY"
```
Step 3. Make sure to install the mandatory Selenium dependencies for Maven by running the below command.
```
mvn compile
mvn versions:display-dependency-updates
```
### Run Single Test
Use the command below from the root of the project to run single tests.
```
mvn test -D suite=single.xml
```
### Run Parallel Test
Use the command below from the root of the project to run parallel tests.
```
mvn test -D suite=parallel.xml
```
### Results
You can check the test results on LambdaTest [Automation Dashboard](https://automation.lambdatest.com/build)
![Automation Dashboard](https://github.com/LambdaTest/Java-TestNG-Selenium/dashboard.png)
## About LambdaTest
[LambdaTest](https://www.lambdatest.com/) is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your [selenium automation testing](https://www.lambdatest.com/selenium-automation) to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.
Binary file added dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d943fa1

Please sign in to comment.