Optimus

Optimus

  • Getting Started
  • Docs
  • Reporting
  • Roadmap
  • Contributors
  • Github

›Integration

Getting Started

  • Getting Started

Installation

  • Optimus Cloud Installation

Setting Up New Project

  • Getting Started With TestNG
  • Getting Started With Cucumber
  • Getting Started With PyTest

Integration

  • TestNG Integration

Example Projects

  • Java Example Projects

Terminologies

  • Terminologies

Architecture

  • Bird View

Integrate Optimus to your existing TestNg project

These are high level steps that should help you integrate Optimus to your exiting framework. Incase you face any hurdle kindly reach out to optimus@testvagrant.com for support.

Step 1

Update your “Gradle / Maven” file with below dependencies

Gradle:

dependencies {
    implementation 'com.testvagrant.optimuscloud:testng-dashboard:1.0.0'
    compile group: 'org.testng', name: 'testng', version: '7.0.0'
    implementation 'com.testvagrant.optimuscloud:java-client:1.0.0'
}

Maven:

<dependencies>
  <dependency>
      <groupId>com.testvagrant.optimuscloud</groupId>
      <artifactId>optimus-monitor</artifactId>
      <version>1.0.0</version>
  </dependency>
  <dependency>
      <groupId>com.testvagrant.optimuscloud</groupId>
      <artifactId>java-client</artifactId>
      <version>1.0.0</version>
  </dependency>
  <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>7.1.0</version>
      <scope>test</scope>
  </dependency>
</dependencies>

Step 2

Update your @BeforeMethod with below changes

  1. Save MobileDriverDetails to ITestContext

Step 2.1

Add ITextContext parameter to your @BeforeMethod definition.

    @BeforeMethod
    public void setup(ITestContext iTestContext){
        
    }

Step 2.2

Create mobile driver using OptimusCloudDriver

    @BeforeMethod
    public void setup(ITestContext iTestContext){
        MobileDriverDetails mobileDriverDetails = new OptimusCloudDriver().createDriver(desiredCapabilities);
        MobileDriver mobileDriver = mobileDriverDetails.getMobileDriver();
    }

Step 2.3

Save MobileDriverDetails to ITestContext

    @BeforeMethod
    public void setup(ITestContext iTestContext){
        MobileDriverDetails mobileDriverDetails = new OptimusCloudDriver().createDriver(desiredCapabilities);
        MobileDriver mobileDriver = mobileDriverDetails.getMobileDriver();
        iTestContext.setAttribute(OptimusCloudConstants.MOBILE_DRIVER, mobileDriverDetails);
    }

Step 3

Add below listeners to your testng.xml or build.gradle

  1. com.testvagrant.optimuscloud.dashboard.testng.listener.OptimusSuiteListener
  2. com.testvagrant.optimuscloud.dashboard.testng.listener.OptimusTestListener

Eg: build.gradle

task runTests(type: Test) {
    outputs.upToDateWhen {false}
    useTestNG() {
        testLogging.showStandardStreams = true
        testLogging.showStandardStreams = true
        reports.html.enabled = false
        useDefaultListeners = true
        parallel 'methods'
        listeners.add "com.testvagrant.optimuscloud.dashboard.testng.listener.OptimusSuiteListener"
        listeners.add "com.testvagrant.optimuscloud.dashboard.testng.listener.OptimusTestListener"
    }
}

Eg: testng.xml

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >

<suite name="Suite1" verbose="1" >
    <listeners>
        <listener class-name="com.testvagrant.optimuscloud.dashboard.testng.listener.OptimusSuiteListener" />
        <listener class-name="com.testvagrant.optimuscloud.dashboard.testng.listener.OptimusTestListener" />
    </listeners>
</suite>

Step 4

Run tests using testng.xml or by running gradle runTests

Step 5

Navigate to http://localhost:9901 and login with credentials creds: u: admin, p: C0mplexPwd. You will be able to see optimus dashboard.

Build History

Dashboard Homepage

TestDetails Report

Test Details

Non Functional Report

NFR

← Getting Started With PyTestNext →
  • Step 1
  • Step 2
    • Step 2.1
    • Step 2.2
    • Step 2.3
  • Step 3
  • Step 4
  • Step 5
    • Build History
    • TestDetails Report
    • Non Functional Report
Optimus
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Facebook Open Source
Copyright © 2020 TestVagrant Technoligies