Skip to content

Commit

Permalink
HPCC-31857 : Added the directory framework and file TestRunner to tes…
Browse files Browse the repository at this point in the history
…t the yml changes.
  • Loading branch information
Nisha-Bagdwal committed Jul 10, 2024
1 parent 511baa0 commit c551066
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions esp/src/test-ui/tests/framework/TestRunner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package framework;

import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.io.IOException;

public class TestRunner {

public static void main(String[] args) throws IOException, InterruptedException {
System.setProperty("webdriver.chrome.silentOutput", "true");
System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
// java.util.logging.Logger.getLogger("org.openqa.selenium").setLevel(Level.OFF);

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--log-level=3");

WebDriver driver = new ChromeDriver(chromeOptions);

Capabilities caps = ((RemoteWebDriver) driver).getCapabilities();

String browserName = caps.getBrowserName();
//String browserVersion = caps.getVersion();
// System.out.println(browserName+" "+browserVersion);

driver.get("http://127.0.0.1:8010/");

Thread.sleep(1000);

if (driver.getPageSource().contains("Job Name")) {
System.out.println("Pass");
} else {
System.err.println("Fail");
}
if (driver.getPageSource().contains("Owner")) {
System.out.println("Pass");
} else {
System.err.println("Fail");
}
if (driver.getPageSource().contains("Target/Wuid")) {
System.out.println("Pass");
} else {
System.err.println("Fail");
}

driver.quit();
}
}

0 comments on commit c551066

Please sign in to comment.