Install Docker https://docs.docker.com/install/
Pull Optimus dashboard docker image
docker pull testvagrant/optimusdashboard
Create a configuration file eg: env.list
public enum FileExtension { | |
JAVA(".java"), | |
TEXT(".txt"), | |
SQL(".sql"), | |
FEATURE(".feature"), | |
EXCEL(".xls"); | |
private String fileExtension; | |
FileExtension(String fileExtension) { |
/* | |
* Copyright (c) 2017. TestVagrant Technologies | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
public AppiumDriverLocalService startAppiumService() { | |
AppiumServiceBuilder appiumServiceBuilder = new AppiumServiceBuilder() | |
.usingDriverExecutable(new File(executionDetails.getAppium_node_path())) | |
.withAppiumJS(new File(executionDetails.getAppium_js_path())) | |
.withIPAddress("127.0.0.1") | |
.withArgument(SESSION_OVERRIDE) | |
.usingAnyFreePort(); | |
if (isAndroid) { | |
appiumServiceBuilder | |
.withArgument(AndroidServerFlag.BOOTSTRAP_PORT_NUMBER, |
public Integer aRandomOpenPortOnAllLocalInterfaces() { | |
try ( | |
ServerSocket socket = new ServerSocket(0); | |
) { | |
return socket.getLocalPort(); | |
} catch (IOException e) { | |
throw new RuntimeException("no open ports found for bootstrap"); | |
} | |
} |
def runDeviceFragmentation(List<String> udidList) { | |
def size = udidList.size() | |
println "Total devices -- " + size | |
GParsPool.withPool(size) { | |
udidList.eachParallel { String udid -> | |
project.javaexec { | |
main = "cucumber.api.cli.Main" | |
classpath = optimusExtension.classpath | |
args = ["-p", "pretty", "-p", ("json:${reportingExtension.baseDir}/cucumber/" + updateReportFileName(udid) + ".json"), "--glue", "steps", "-t", "@sampleTag", | |
"${project.projectDir}/src/test/resources/features"]; |
def runFunctionalDistribution(List<String> udidList, List<File> featureFiles) { | |
def size = udidList.size() | |
println "pool size -- " + size | |
def cucumberArgs; | |
GParsPool.withPool(size) { | |
allFiles.eachParallel { File feature -> | |
project.javaexec { | |
main = "cucumber.api.cli.Main" | |
classpath = optimusExtension.classpath | |
args = ["-p", "pretty", "-p", |
public static void calendarHandling(String date, WebDriver driver) { | |
// elements for clicking calendar buttons | |
String PrevButtonM = "//div[@id='ui-datepicker-div']/descendant::div[@class='header']/a[@title='Prev']"; | |
String NextButtonM = "//div[@id='ui-datepicker-div']/descendant::div[@class='header']/a[@title='Next']"; | |
String currentReturnedYear = "//div[@id='ui-datepicker-div']/descendant::div[@class='monthBlock first']//div[@class='title']/span[@class='ui-datepicker-year']"; | |
String returnedMonth = "//div[@id='ui-datepicker-div']/descendant::div[@class='monthBlock first']//div[@class='title']/span[@class='ui-datepicker-month']"; | |
date = date.trim(); | |
String DateArr[] = date.split("/"); |
Install Docker https://docs.docker.com/install/
Pull Optimus dashboard docker image
docker pull testvagrant/optimusdashboard
Create a configuration file eg: env.list
package utils; | |
import com.testvagrant.commons.entities.SmartBOT; | |
import io.appium.java_client.AppiumDriver; | |
import io.appium.java_client.android.Activity; | |
import io.appium.java_client.android.AndroidDriver; | |
import io.appium.java_client.android.appmanagement.AndroidInstallApplicationOptions; | |
import org.apache.commons.lang3.StringUtils; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebElement; |
// Any local variable declaration | |
List<String> list = new ArrayList<String>(); | |
Stream<String> stream = getStream() | |
// For Lambda Expression. | |
(String a, String b) -> a.concat(b) |