-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure that it works with any OSs (Windows/Mac)
- Loading branch information
1 parent
f563a07
commit 92935f8
Showing
28 changed files
with
395 additions
and
868 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>selenium-cucumber-java</name> | ||
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> | ||
<projects/> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> | ||
<name>testscj</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
#Sun Jul 24 17:20:45 EDT 2016 | ||
encoding/src/test/java=UTF-8 | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
encoding/src/main/resources=UTF-8 | ||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | ||
encoding/src/main/java=UTF-8 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
eclipse.preferences.version=1 | ||
encoding/src/test/resources=UTF-8 | ||
org.eclipse.jdt.core.compiler.source=1.7 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,63 @@ | ||
package env; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.chrome.ChromeDriver; | ||
import org.openqa.selenium.firefox.FirefoxDriver; | ||
import org.openqa.selenium.ie.InternetExplorerDriver; | ||
import org.openqa.selenium.safari.SafariDriver; | ||
|
||
public class Env | ||
{ | ||
public class Env { | ||
|
||
static WebDriver driver = null; | ||
static String browserName = null; | ||
|
||
public static String getBrowserName() | ||
{ | ||
public static String getBrowserName() { | ||
browserName = System.getProperty("browser"); | ||
|
||
if(browserName == null) | ||
if (browserName == null) | ||
browserName = "ff"; | ||
return browserName; | ||
} | ||
|
||
public static WebDriver CreateWebDriver(String browser) | ||
{ | ||
System.out.println("Browser: " + browser); | ||
|
||
switch (browser.toLowerCase()) { | ||
case "ff": | ||
case "firefox": | ||
//ProfilesIni allProfiles = new ProfilesIni(); | ||
//FirefoxProfile profile = allProfiles.getProfile("selenium"); | ||
//driver = new FirefoxDriver(profile); | ||
driver = new FirefoxDriver(); | ||
break; | ||
|
||
case "ch": | ||
case "chrome": | ||
driver = new ChromeDriver(); | ||
break; | ||
|
||
case "ie" : | ||
case "internetexplorer": | ||
driver = new InternetExplorerDriver(); | ||
break; | ||
|
||
case "safari": | ||
driver = new SafariDriver(); | ||
break; | ||
|
||
default: | ||
System.out.println("Invalid browser name "+browser); | ||
System.exit(0); | ||
break; | ||
}//switch | ||
|
||
driver.manage().deleteAllCookies(); | ||
driver.manage().window().maximize(); | ||
driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS); | ||
driver.manage().timeouts().setScriptTimeout(60, TimeUnit.SECONDS); | ||
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); | ||
|
||
return driver; | ||
} | ||
|
||
public static WebDriver CreateWebDriver(String browser) { | ||
System.out.println("Browser: " + browser); | ||
|
||
switch (browser.toLowerCase()) { | ||
case "ff": | ||
case "firefox": | ||
// ProfilesIni allProfiles = new ProfilesIni(); | ||
// FirefoxProfile profile = allProfiles.getProfile("selenium"); | ||
// driver = new FirefoxDriver(profile); | ||
driver = new FirefoxDriver(); | ||
break; | ||
|
||
case "ch": | ||
case "chrome": | ||
driver = new ChromeDriver(); | ||
break; | ||
|
||
case "ie": | ||
case "internetexplorer": | ||
driver = new InternetExplorerDriver(); | ||
break; | ||
|
||
case "safari": | ||
driver = new SafariDriver(); | ||
break; | ||
|
||
default: | ||
System.out.println("Invalid browser name " + browser); | ||
System.exit(0); | ||
break; | ||
}// switch | ||
|
||
driver.manage().deleteAllCookies(); | ||
driver.manage().window().maximize(); | ||
driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS); | ||
driver.manage().timeouts().setScriptTimeout(60, TimeUnit.SECONDS); | ||
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); | ||
|
||
return driver; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.