-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dmitriy Balykin
committed
Dec 9, 2015
0 parents
commit c083331
Showing
7 changed files
with
163 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false"> | ||
<output url="file://$MODULE_DIR$/target/classes" /> | ||
<output-test url="file://$MODULE_DIR$/target/test-classes" /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="Maven: org.testng:testng:6.9.9" level="project" /> | ||
<orderEntry type="library" name="Maven: junit:junit:4.10" level="project" /> | ||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" /> | ||
<orderEntry type="library" name="Maven: com.beust:jcommander:1.48" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.ant:ant:1.7.0" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.ant:ant-launcher:1.7.0" level="project" /> | ||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.15" level="project" /> | ||
<orderEntry type="library" name="Maven: org.beanshell:bsh:2.0b4" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-java:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-chrome-driver:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-remote-driver:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: cglib:cglib-nodep:2.1_3" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.3.1" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-api:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-edge-driver:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.commons:commons-exec:1.3" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-htmlunit-driver:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: net.sourceforge.htmlunit:htmlunit:2.18" level="project" /> | ||
<orderEntry type="library" name="Maven: xalan:xalan:2.7.2" level="project" /> | ||
<orderEntry type="library" name="Maven: xalan:serializer:2.7.2" level="project" /> | ||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5" level="project" /> | ||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" /> | ||
<orderEntry type="library" name="Maven: net.sourceforge.htmlunit:htmlunit-core-js:2.17" level="project" /> | ||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" /> | ||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" /> | ||
<orderEntry type="library" name="Maven: net.sourceforge.nekohtml:nekohtml:1.9.22" level="project" /> | ||
<orderEntry type="library" name="Maven: net.sourceforge.cssparser:cssparser:0.9.16" level="project" /> | ||
<orderEntry type="library" name="Maven: org.w3c.css:sac:1.3" level="project" /> | ||
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" /> | ||
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:websocket-client:9.2.12.v20150709" level="project" /> | ||
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-util:9.2.12.v20150709" level="project" /> | ||
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-io:9.2.12.v20150709" level="project" /> | ||
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:websocket-common:9.2.12.v20150709" level="project" /> | ||
<orderEntry type="library" name="Maven: org.eclipse.jetty.websocket:websocket-api:9.2.12.v20150709" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.1" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.3" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-firefox-driver:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-ie-driver:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.1.0" level="project" /> | ||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.1.0" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-safari-driver:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-support:2.48.2" level="project" /> | ||
<orderEntry type="library" name="Maven: org.webbitserver:webbit:0.4.14" level="project" /> | ||
<orderEntry type="library" name="Maven: io.netty:netty:3.5.2.Final" level="project" /> | ||
<orderEntry type="library" name="Maven: org.seleniumhq.selenium:selenium-leg-rc:2.48.2" level="project" /> | ||
</component> | ||
</module> |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>PageObject</groupId> | ||
<artifactId>PageObject</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<version>6.9.9</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-java</artifactId> | ||
<version>2.48.2</version> | ||
</dependency> | ||
|
||
|
||
</dependencies> | ||
|
||
|
||
</project> |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.firefox.FirefoxDriver; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
public class GithubLogin{ | ||
|
||
private WebDriver driver; | ||
String baseUrl = "https://github.com/login"; | ||
|
||
@BeforeMethod | ||
public void setUp() throws Exception { | ||
driver = new FirefoxDriver(); | ||
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); | ||
} | ||
|
||
@Test | ||
public void testUntitled2() { | ||
driver.get(baseUrl); | ||
LoginPage loginpage = new LoginPage(driver); | ||
loginpage.login("Froststorm","eiDv67VkGb"); | ||
} | ||
|
||
@AfterMethod | ||
public void tearDown() throws Exception { | ||
driver.quit(); | ||
} | ||
|
||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.openqa.selenium.support.PageFactory; | ||
|
||
public class LoginPage { | ||
public WebDriver driver; | ||
|
||
|
||
@FindBy (id ="login_field") | ||
WebElement loginField; | ||
|
||
@FindBy (css = "#password") | ||
WebElement passwordField; | ||
|
||
@FindBy (xpath = ".//*[@id='login']/form/div[3]/input[3]") | ||
WebElement signinButton; | ||
|
||
public LoginPage(WebDriver driver){ | ||
this.driver= driver; | ||
PageFactory.initElements(driver, this); | ||
|
||
} | ||
|
||
public void login (String username, String password){ | ||
loginField.sendKeys(username); | ||
passwordField.sendKeys(password); | ||
signinButton.click(); | ||
} | ||
|
||
} |
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > | ||
|
||
<suite name="Suite1" verbose="1" > | ||
<test name="Nopackage" > | ||
<classes> | ||
<class name="GithubLogin" /> | ||
</classes> | ||
</test> | ||
</suite> |