fix: 12 - testing firefox
Some checks failed
jenkins/ZenProject/pipeline/head There was a failure building this commit

This commit is contained in:
Sami 2024-09-29 17:02:16 -04:00
parent 9e4277a032
commit 0ad5c13d36
2 changed files with 11 additions and 5 deletions

4
Jenkinsfile vendored
View File

@ -1,5 +1,7 @@
pipeline {
agent any
agent {
label "agent_locke"
}
stages {
stage('Build') {

View File

@ -11,6 +11,7 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
public class Initialization {
// let's set up our variables
@ -48,13 +49,16 @@ public class Initialization {
extent.setSystemInfo("Tester ID: ", "Sami");
// conditioning our WebDriver with an if statement
String browsername = prop.getProperty("browserC");
String browsername = prop.getProperty("browserF");
// launching FireFox
if (browsername.equalsIgnoreCase("firefox")) {
// System.setProperty("web-driver.gecko.driver","user.dir" +
// "/drivers/geckodriver");
// driver = new FirefoxDriver();
FirefoxOptions options = new FirefoxOptions();
options.addArguments("--headless");
driver = new FirefoxDriver(options);
driver.get(prop.getProperty("url"));
}
@ -63,9 +67,9 @@ public class Initialization {
// System.setProperty("web-driver.gecko.driver", "user.dir" +
// "/drivers/chromedriver");
// driver = new ChromeDriver();
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
driver = new ChromeDriver(options);
// ChromeOptions options = new ChromeOptions();
// options.addArguments("--headless");
// driver = new ChromeDriver(options);
driver.get(prop.getProperty("url"));
}
driver.manage().window().maximize();