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
Binary file added Extension/chrome_successful.zip
Binary file not shown.
214 changes: 107 additions & 107 deletions src/main/java/magicLeap.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;

public class magicLeap {

public String username = System.getProperty("LT_USERNAME");
public String accesskey = System.getProperty("LT_ACCESS_KEY");
public String username = "saurabhlambdatest";
public String accesskey = "3822ZWc92Nlj14URYtqggRpVYHVk7pu7rs7Dqx1AjJe5NUHPRA";
public RemoteWebDriver driver;
public String gridURL = System.getProperty("grid");
public String gridURL = "preprod-hub.lambdatest.com";
; // "@eu-central-1-hub.lambdatest.com/wd/hub";
String status;
String ResolutionValue;
Expand Down Expand Up @@ -52,14 +53,14 @@ public class magicLeap {
Long AllVersions = null;


@org.testng.annotations.Parameters(value = {"browser", "version", "platform"})
public magicLeap(String browser, String version, String platform) {
@org.testng.annotations.Parameters(value = {"browser", "version", "platform","fixedIp"})
public magicLeap(String browser, String version, String platform, String fixedIp) {
try {

BrowserValue = System.getenv("LT_BROWSER_NAME");
versionValue = System.getenv("LT_BROWSER_VERSION");
PlatformValue = System.getenv("LT_OPERATING_SYSTEM");
FixedIpValue = System.getProperty("fixedIP");
BrowserValue = browser;
versionValue = version;
PlatformValue = platform;
FixedIpValue = fixedIp;
Tunnel = System.getProperty("tunnel");
if (BrowserValue != null) {
TestName = BrowserValue;
Expand All @@ -82,50 +83,48 @@ public magicLeap(String browser, String version, String platform) {
public void setUp() throws Exception {
System.out.println(this.TestName);

for (int i =0 ; i<50;i++) {
try {

try {


DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("browserName", this.BrowserValue);
capabilities.setCapability("browserVersion", this.versionValue);
capabilities.setCapability("platform", this.PlatformValue);
capabilities.setCapability("visual", System.getProperty("visual"));
capabilities.setCapability("fixedIP", this.FixedIpValue);

// capabilities.setCapability("accessKey", accesskey);
ChromeOptions capabilities = new ChromeOptions();
capabilities.setCapability("browserName", this.BrowserValue);
capabilities.setCapability("browserVersion", this.versionValue);
capabilities.setCapability("platform", this.PlatformValue);
capabilities.setCapability("build", System.getProperty("buildName"));
//capabilities.setCapability("visual", System.getProperty("visual"));
capabilities.setCapability("fixedIP", FixedIpValue);
capabilities.addExtensions(new File("Extension/chrome_successful.zip"));

// capabilities.setCapability("accessKey", accesskey);

StopWatch driverStart = new StopWatch();
driverStart.start();
StopWatch driverStart = new StopWatch();
driverStart.start();

hub = "https://" + username + ":" + accesskey + "@" + gridURL + "/wd/hub";
// hub = "http://localhost:4444/wd/hub";
hub = "https://" + username + ":" + accesskey + "@" + gridURL + "/wd/hub";
// hub = "http://localhost:4444/wd/hub";

System.out.println(hub);
System.out.println(hub);

driver = new RemoteWebDriver(new URL(hub), capabilities);
driver = new RemoteWebDriver(new URL(hub), capabilities);

System.out.println(capabilities);
driverStart.stop();

System.out.println(capabilities);
driverStart.stop();
float timeElapsed = driverStart.getTime() / 1000f;
System.out.println("Driver initiate time" + " " + timeElapsed);
DesktopScript();
tearDown();
driver.quit();
} catch (MalformedURLException e) {
System.out.println("Invalid grid URL");
System.out.println("Please set the hub URL in the env variable");

float timeElapsed = driverStart.getTime() / 1000f;
System.out.println("Driver initiate time" + " " + timeElapsed);


} catch (
MalformedURLException e) {
System.out.println("Invalid grid URL");
System.out.println("Please set the hub URL in the env variable");

} catch (
Exception f) {
status = "failed";
System.out.println(f);
} catch (Exception f) {
status = "failed";
System.out.println(f);

}
}

}


Expand All @@ -143,53 +142,53 @@ public void DesktopScript() {

driver.manage().window().maximize();

DesignPlane Air = new DesignPlane();
Air.plane(driver);
GoogleExperiments exp = new GoogleExperiments();
exp.Music(driver);
// DesignPlane Air = new DesignPlane();
// Air.plane(driver);
// GoogleExperiments exp = new GoogleExperiments();
// exp.Music(driver);


// driver.get("https://www.google.com");


GoogleSpace space = new GoogleSpace();
space.GSpace(driver);
TakeScreenShot scr = new TakeScreenShot();
scr.Screenshot(driver, status);
TelescopeView view = new TelescopeView();
view.Tele(driver);
scr.Screenshot(driver, status);
VideoUpload vid = new VideoUpload();
vid.vidupload(driver);

scr.Screenshot(driver, status);

shoopingCart shop = new shoopingCart();
shop.amazon(driver);

scr.Screenshot(driver, status);
DesignCar car = new DesignCar();
car.CarDesign(driver);

scr.Screenshot(driver, status);

RockDoor Test = new RockDoor();
Test.RockDoorTest(driver);

scr.Screenshot(driver, status);
SkyMap mapTest = new SkyMap();
mapTest.SkyMapTest(driver);

scr.Screenshot(driver, status);

SessionTest tet = new SessionTest();
tet.SessionLaunch(driver, status);

scr.Screenshot(driver, status);
LambdaTestLogin login = new LambdaTestLogin();
login.Lambda(driver, status);

scr.Screenshot(driver, status);
// GoogleSpace space = new GoogleSpace();
// space.GSpace(driver);
// TakeScreenShot scr = new TakeScreenShot();
// scr.Screenshot(driver, status);
// TelescopeView view = new TelescopeView();
// view.Tele(driver);
// scr.Screenshot(driver, status);
// VideoUpload vid = new VideoUpload();
// vid.vidupload(driver);
//
// scr.Screenshot(driver, status);
//
// shoopingCart shop = new shoopingCart();
// shop.amazon(driver);
//
// scr.Screenshot(driver, status);
// DesignCar car = new DesignCar();
// car.CarDesign(driver);
//
// scr.Screenshot(driver, status);
//
// RockDoor Test = new RockDoor();
// Test.RockDoorTest(driver);
//
// scr.Screenshot(driver, status);
// SkyMap mapTest = new SkyMap();
// mapTest.SkyMapTest(driver);
//
// scr.Screenshot(driver, status);
//
// SessionTest tet = new SessionTest();
// tet.SessionLaunch(driver, status);
//
// scr.Screenshot(driver, status);
// LambdaTestLogin login = new LambdaTestLogin();
// login.Lambda(driver, status);
//
// scr.Screenshot(driver, status);


//ToDo app
Expand All @@ -198,28 +197,29 @@ public void DesktopScript() {
StreamTest stream = new StreamTest();
stream.TestStream(driver, status);

scr.Screenshot(driver, status);
uploadTest upTest = new uploadTest();
upTest.upload(driver, status);
scr.Screenshot(driver, status);
scr.Screenshot(driver, status);
ResolutionTest ResolutionTestObject = new ResolutionTest();
ResolutionTestObject.Resolution(driver, ResolutionValue, status, ResolutionTotal, this.ResolutionValueCap);
scr.Screenshot(driver, status);
BadSslTest nonSecure = new BadSslTest();
nonSecure.badSsl(driver, status);
scr.Screenshot(driver, status);
NetSpeed net = new NetSpeed();
net.NetSpeed(driver, status, Nettotalspeedtest);
scr.Screenshot(driver, status);
GeolocationTest Geo = new GeolocationTest();
Geo.Geolocation(driver, status, GeolocationTotal);
FakeMediaTest FK = new FakeMediaTest();
FK.TestFakeMediaPermissions(driver);
TestCase ractice = new TestCase();
ractice.LongCase(driver);
// HeavyTestWeb hvy = new HeavyTestWeb();
// hvy.heavy(driver);
// scr.Screenshot(driver, status);
// uploadTest upTest = new uploadTest();
// upTest.upload(driver, status);
// scr.Screenshot(driver, status);
// scr.Screenshot(driver, status);
// ResolutionTest ResolutionTestObject = new ResolutionTest();
// ResolutionTestObject.Resolution(driver, ResolutionValue, status, ResolutionTotal, this.ResolutionValueCap);
// scr.Screenshot(driver, status);
// BadSslTest nonSecure = new BadSslTest();
// nonSecure.badSsl(driver, status);
// scr.Screenshot(driver, status);
// NetSpeed net = new NetSpeed();
// net.NetSpeed(driver, status, Nettotalspeedtest);
// scr.Screenshot(driver, status);
// GeolocationTest Geo = new GeolocationTest();
// Geo.Geolocation(driver, status, GeolocationTotal);
// FakeMediaTest FK = new FakeMediaTest();
// FK.TestFakeMediaPermissions(driver);
// TestCase ractice = new TestCase();
// ractice.LongCase(driver);
// HeavyTestWeb hvy = new HeavyTestWeb();
// hvy.heavy(driver);
driver.get("https://www.google.com/");

SuiteStop = System.currentTimeMillis();
SuiteTotalTime = SuiteStop - SuiteStart;
Expand All @@ -242,7 +242,7 @@ public void tearDown() throws Exception {

quitetimestart = System.currentTimeMillis();
if (driver != null) {
driver.quit();
// driver.quit();


}
Expand Down
Loading