Commit 9f2a2173 authored by earndt's avatar earndt

[W7D2] (ArndtED) Adds project skeleton

parent e34edd3f
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
config.properties
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
# Directories #
/build/
bin/
repos/
/repos/
doc/
/doc/
.gradle/
/bin/
target/
# OS Files #
.DS_Store
# JetBrain's Idea specific stuff #
.idea*
*.iml
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
*.class
browscap.csv
gradle/wrapper
gradlew.bat
gradlew
# Package Files #
*.jar
*.war
*.ear
*.db
######################
# Windows
######################
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini
######################
# OSX
######################
.DS_Store
.svn
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
######################
# Eclipse
######################
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
/src/main/resources/rebel.xml
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
# awa-w7d2-selenium-pageobjectpattern
<?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>org.example</groupId>
<artifactId>selenium-assignment</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.0-M1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class Login {
WebDriver driver;
WebElement linkSignIn;
WebElement inputUsername;
WebElement inputPassword;
WebElement buttonSubmit;
public Login(WebDriver driver){
this.driver = driver;
}
public WebElement getLinkSignIn(){
return driver.findElement(By.xpath("//a[text()='Login']")); //figure out string
}
public WebElement getInputUsername(){
return driver.findElement(By.xpath("//input[@name='username']")); //figure out string
}
public WebElement getInputPassword(){
return driver.findElement(By.name("password")); //figure out string
}
public WebElement getButtonSubmit(){
return driver.findElement(By.name("Submit")); //figure out string
}
public void navigateHome(String url){
driver.get(url);
}
public void login(String username, String password){
getInputUsername().sendKeys(username);
getInputPassword().sendKeys(password);
getButtonSubmit().click();
}
}
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.*;
public class LoginPF {
WebDriver driver;
@FindBy(how = How.XPATH, using = "//a[text()='Login']")
WebElement linkSignIn;
@FindBy(xpath="//input[@name='username']")
WebElement inputUsername;
@FindAll({
@FindBy(id="pass"),
@FindBy(name="pwd"),
@FindBy(xpath="//input[@name='pwd']") // find string
})
WebElement inputPassword;
@FindBys({
@FindBy(id="Submit"),
@FindBy(name="Login")
})
WebElement buttonSubmit;
public LoginPF(WebDriver driver){
this.driver = driver;
PageFactory.initElements(this.driver, this);
}
public void login(String username, String password){
inputUsername.sendKeys(username);
inputPassword.sendKeys(password);
buttonSubmit.click();
}
}
import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class SafewayTest {
@Test
public void testSafewayCredentials() throws Exception{
System.setProperty("webdriver.chrome.driver",
"/Users/earndt/Desktop/NNDNN/selenium-test-assignment/src/test/resources/chromedriver")
}
WebDriver driver = new ChromeDriver();
Login login = new Login(driver);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment