Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sources from dev branch and minor cleanup #3

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
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
64 changes: 64 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
<classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="var" path="M2_REPO/info/cukes/cucumber-java/1.2.2/cucumber-java-1.2.2.jar" sourcepath="M2_REPO/info/cukes/cucumber-java/1.2.2/cucumber-java-1.2.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/info/cukes/cucumber-core/1.2.2/cucumber-core-1.2.2.jar" sourcepath="M2_REPO/info/cukes/cucumber-core/1.2.2/cucumber-core-1.2.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/info/cukes/cucumber-html/0.2.3/cucumber-html-0.2.3.jar" sourcepath="M2_REPO/info/cukes/cucumber-html/0.2.3/cucumber-html-0.2.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/info/cukes/cucumber-jvm-deps/1.0.3/cucumber-jvm-deps-1.0.3.jar" sourcepath="M2_REPO/info/cukes/cucumber-jvm-deps/1.0.3/cucumber-jvm-deps-1.0.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/info/cukes/gherkin/2.12.2/gherkin-2.12.2.jar" sourcepath="M2_REPO/info/cukes/gherkin/2.12.2/gherkin-2.12.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/info/cukes/cucumber-junit/1.2.2/cucumber-junit-1.2.2.jar" sourcepath="M2_REPO/info/cukes/cucumber-junit/1.2.2/cucumber-junit-1.2.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar" sourcepath="M2_REPO/junit/junit/4.11/junit-4.11-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-java/2.45.0/selenium-java-2.45.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.45.0/selenium-chrome-driver-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.45.0/selenium-chrome-driver-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/2.45.0/selenium-remote-driver-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/2.45.0/selenium-remote-driver-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar" sourcepath="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar" sourcepath="M2_REPO/com/google/code/gson/gson/2.3.1/gson-2.3.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-api/2.45.0/selenium-api-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-api/2.45.0/selenium-api-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/guava/guava/18.0/guava-18.0.jar" sourcepath="M2_REPO/com/google/guava/guava/18.0/guava-18.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.9/commons-codec-1.9.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.9/commons-codec-1.9-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-exec/1.1/commons-exec-1.1.jar" sourcepath="M2_REPO/org/apache/commons/commons-exec/1.1/commons-exec-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/java/dev/jna/jna/3.4.0/jna-3.4.0.jar" sourcepath="M2_REPO/net/java/dev/jna/jna/3.4.0/jna-3.4.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/java/dev/jna/platform/3.4.0/platform-3.4.0.jar" sourcepath="M2_REPO/net/java/dev/jna/platform/3.4.0/platform-3.4.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.45.0/selenium-htmlunit-driver-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.45.0/selenium-htmlunit-driver-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit/2.15/htmlunit-2.15.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit/2.15/htmlunit-2.15-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xalan/serializer/2.7.1/serializer-2.7.1.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2.jar" sourcepath="M2_REPO/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpmime/4.3.3/httpmime-4.3.3.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpmime/4.3.3/httpmime-4.3.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.15/htmlunit-core-js-2.15.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.15/htmlunit-core-js-2.15-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar" sourcepath="M2_REPO/xerces/xercesImpl/2.11.0/xercesImpl-2.11.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.21/nekohtml-1.9.21.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.21/nekohtml-1.9.21-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.14/cssparser-0.9.14.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.14/cssparser-0.9.14-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar" sourcepath="M2_REPO/org/w3c/css/sac/1.3/sac-1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-io/commons-io/2.4/commons-io-2.4.jar" sourcepath="M2_REPO/commons-io/commons-io/2.4/commons-io-2.4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-websocket/8.1.15.v20140411/jetty-websocket-8.1.15.v20140411.jar" sourcepath="M2_REPO/org/eclipse/jetty/jetty-websocket/8.1.15.v20140411/jetty-websocket-8.1.15.v20140411-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-util/8.1.15.v20140411/jetty-util-8.1.15.v20140411.jar" sourcepath="M2_REPO/org/eclipse/jetty/jetty-util/8.1.15.v20140411/jetty-util-8.1.15.v20140411-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-io/8.1.15.v20140411/jetty-io-8.1.15.v20140411.jar" sourcepath="M2_REPO/org/eclipse/jetty/jetty-io/8.1.15.v20140411/jetty-io-8.1.15.v20140411-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/jetty/jetty-http/8.1.15.v20140411/jetty-http-8.1.15.v20140411.jar" sourcepath="M2_REPO/org/eclipse/jetty/jetty-http/8.1.15.v20140411/jetty-http-8.1.15.v20140411-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.45.0/selenium-firefox-driver-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.45.0/selenium-firefox-driver-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.45.0/selenium-ie-driver-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.45.0/selenium-ie-driver-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-safari-driver/2.45.0/selenium-safari-driver-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-safari-driver/2.45.0/selenium-safari-driver-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/webbitserver/webbit/0.4.14/webbit-0.4.14.jar" sourcepath="M2_REPO/org/webbitserver/webbit/0.4.14/webbit-0.4.14-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/io/netty/netty/3.5.2.Final/netty-3.5.2.Final.jar" sourcepath="M2_REPO/io/netty/netty/3.5.2.Final/netty-3.5.2.Final-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-support/2.45.0/selenium-support-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-support/2.45.0/selenium-support-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-leg-rc/2.45.0/selenium-leg-rc-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-leg-rc/2.45.0/selenium-leg-rc-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-server/2.45.0/selenium-server-2.45.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-server/2.45.0/selenium-server-2.45.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar" sourcepath="M2_REPO/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar" sourcepath="M2_REPO/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/mx4j/mx4j-tools/3.0.1/mx4j-tools-3.0.1.jar" sourcepath="M2_REPO/mx4j/mx4j-tools/3.0.1/mx4j-tools-3.0.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.9/servlet-api-2.5-6.1.9.jar" sourcepath="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1.9/servlet-api-2.5-6.1.9-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/jetty-repacked/7.6.1/jetty-repacked-7.6.1.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/jetty-repacked/7.6.1/jetty-repacked-7.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/jetty-rc-repacked/5/jetty-rc-repacked-5.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/jetty-rc-repacked/5/jetty-rc-repacked-5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar" sourcepath="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.8/snakeyaml-1.8.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.8/snakeyaml-1.8-sources.jar"/>
</classpath>
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/target

# Created by https://www.gitignore.io/api/java

### Java ###
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Generated files
/Screenshots
Binary file removed Screenshots/screenshot20150401193118.png
Binary file not shown.
Binary file removed Screenshots/screenshot20150401194652.png
Binary file not shown.
Binary file removed Screenshots/screenshot20150428193817.png
Binary file not shown.
Binary file removed Screenshots/screenshot20150428194030.png
Binary file not shown.
11 changes: 4 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,19 @@
<version>4.11</version>
<scope>test</scope>
</dependency>

<!-- These are the selenium-webdriver dependencies -->
<!-- These are the selenium-webdriver dependencies -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.45.0</version>
</dependency>

<!-- These are the selenium-cucumber methods dependencies -->
<dependency>
<groupId>sample</groupId>
Expand All @@ -54,10 +53,9 @@
<type>jar</type>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/selenium-cucumber-methods-1.0.0.jar</systemPath>
</dependency>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
Expand All @@ -69,7 +67,6 @@
<source>1.7</source>
<target>1.7</target>
<compilerArgument>-Werror</compilerArgument>

<systemPropertyVariables>
<property>
<name>browser</name>
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/env/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.WebDriverWait;

public interface BaseTest
{
public interface BaseTest {
public static WebDriver driver = Env.CreateWebDriver(Env.getBrowserName());
public static WebDriverWait wait = new WebDriverWait(driver, 30);



MiscMethods miscmethodObj = new MiscMethods();
NavigateMethods navigationObj = new NavigateMethods();
AssertionMethods assertionObj = new AssertionMethods();
Expand Down
99 changes: 48 additions & 51 deletions src/main/java/env/Env.java
Original file line number Diff line number Diff line change
@@ -1,66 +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()
{
browserName = System.getProperty("browser");

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;
public static String getBrowserName() {
browserName = System.getProperty("browser");

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);
if (browserName == null)
browserName = "chrome";
return browserName;
}

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;
}
}
Loading