Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
POM-Assignment
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiyang Lu
POM-Assignment
Commits
ed185fbe
Commit
ed185fbe
authored
Apr 14, 2021
by
Xiyang Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish pom assignment
parent
0be7ab59
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
458 additions
and
0 deletions
+458
-0
.gitignore
PageObjectPatternAssignment/.idea/.gitignore
+3
-0
aws.xml
PageObjectPatternAssignment/.idea/aws.xml
+11
-0
compiler.xml
PageObjectPatternAssignment/.idea/compiler.xml
+13
-0
jarRepositories.xml
PageObjectPatternAssignment/.idea/jarRepositories.xml
+20
-0
misc.xml
PageObjectPatternAssignment/.idea/misc.xml
+14
-0
uiDesigner.xml
PageObjectPatternAssignment/.idea/uiDesigner.xml
+124
-0
PageObjectPatternAssignment.iml
PageObjectPatternAssignment/PageObjectPatternAssignment.iml
+2
-0
pom.xml
PageObjectPatternAssignment/pom.xml
+52
-0
AccountPage.java
PageObjectPatternAssignment/src/main/java/AccountPage.java
+70
-0
HomePage.java
PageObjectPatternAssignment/src/main/java/HomePage.java
+48
-0
LoginPage.java
PageObjectPatternAssignment/src/main/java/LoginPage.java
+47
-0
config.properties
...ectPatternAssignment/src/main/resources/config.properties
+8
-0
Tests.java
PageObjectPatternAssignment/src/test/java/Tests.java
+38
-0
AccountPage.class
PageObjectPatternAssignment/target/classes/AccountPage.class
+0
-0
HomePage.class
PageObjectPatternAssignment/target/classes/HomePage.class
+0
-0
LoginPage.class
PageObjectPatternAssignment/target/classes/LoginPage.class
+0
-0
config.properties
PageObjectPatternAssignment/target/classes/config.properties
+8
-0
Tests.class
PageObjectPatternAssignment/target/test-classes/Tests.class
+0
-0
No files found.
PageObjectPatternAssignment/.idea/.gitignore
0 → 100644
View file @
ed185fbe
# Default ignored files
/shelf/
/workspace.xml
PageObjectPatternAssignment/.idea/aws.xml
0 → 100644
View file @
ed185fbe
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"accountSettings"
>
<option
name=
"activeRegion"
value=
"us-east-1"
/>
<option
name=
"recentlyUsedRegions"
>
<list>
<option
value=
"us-east-1"
/>
</list>
</option>
</component>
</project>
\ No newline at end of file
PageObjectPatternAssignment/.idea/compiler.xml
0 → 100644
View file @
ed185fbe
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"CompilerConfiguration"
>
<annotationProcessing>
<profile
name=
"Maven default annotation processors profile"
enabled=
"true"
>
<sourceOutputDir
name=
"target/generated-sources/annotations"
/>
<sourceTestOutputDir
name=
"target/generated-test-sources/test-annotations"
/>
<outputRelativeToContentRoot
value=
"true"
/>
<module
name=
"PageObjectPatternAssignment"
/>
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
PageObjectPatternAssignment/.idea/jarRepositories.xml
0 → 100644
View file @
ed185fbe
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RemoteRepositoriesConfiguration"
>
<remote-repository>
<option
name=
"id"
value=
"central"
/>
<option
name=
"name"
value=
"Central Repository"
/>
<option
name=
"url"
value=
"https://repo.maven.apache.org/maven2"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"central"
/>
<option
name=
"name"
value=
"Maven Central repository"
/>
<option
name=
"url"
value=
"https://repo1.maven.org/maven2"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"jboss.community"
/>
<option
name=
"name"
value=
"JBoss Community repository"
/>
<option
name=
"url"
value=
"https://repository.jboss.org/nexus/content/repositories/public/"
/>
</remote-repository>
</component>
</project>
\ No newline at end of file
PageObjectPatternAssignment/.idea/misc.xml
0 → 100644
View file @
ed185fbe
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ExternalStorageConfigurationManager"
enabled=
"true"
/>
<component
name=
"MavenProjectsManager"
>
<option
name=
"originalFiles"
>
<list>
<option
value=
"$PROJECT_DIR$/pom.xml"
/>
</list>
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/out"
/>
</component>
</project>
\ No newline at end of file
PageObjectPatternAssignment/.idea/uiDesigner.xml
0 → 100644
View file @
ed185fbe
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"Palette2"
>
<group
name=
"Swing"
>
<item
class=
"com.intellij.uiDesigner.HSpacer"
tooltip-text=
"Horizontal Spacer"
icon=
"/com/intellij/uiDesigner/icons/hspacer.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"1"
hsize-policy=
"6"
anchor=
"0"
fill=
"1"
/>
</item>
<item
class=
"com.intellij.uiDesigner.VSpacer"
tooltip-text=
"Vertical Spacer"
icon=
"/com/intellij/uiDesigner/icons/vspacer.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"1"
anchor=
"0"
fill=
"2"
/>
</item>
<item
class=
"javax.swing.JPanel"
icon=
"/com/intellij/uiDesigner/icons/panel.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"3"
hsize-policy=
"3"
anchor=
"0"
fill=
"3"
/>
</item>
<item
class=
"javax.swing.JScrollPane"
icon=
"/com/intellij/uiDesigner/icons/scrollPane.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"7"
hsize-policy=
"7"
anchor=
"0"
fill=
"3"
/>
</item>
<item
class=
"javax.swing.JButton"
icon=
"/com/intellij/uiDesigner/icons/button.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"3"
anchor=
"0"
fill=
"1"
/>
<initial-values>
<property
name=
"text"
value=
"Button"
/>
</initial-values>
</item>
<item
class=
"javax.swing.JRadioButton"
icon=
"/com/intellij/uiDesigner/icons/radioButton.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"3"
anchor=
"8"
fill=
"0"
/>
<initial-values>
<property
name=
"text"
value=
"RadioButton"
/>
</initial-values>
</item>
<item
class=
"javax.swing.JCheckBox"
icon=
"/com/intellij/uiDesigner/icons/checkBox.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"3"
anchor=
"8"
fill=
"0"
/>
<initial-values>
<property
name=
"text"
value=
"CheckBox"
/>
</initial-values>
</item>
<item
class=
"javax.swing.JLabel"
icon=
"/com/intellij/uiDesigner/icons/label.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"0"
anchor=
"8"
fill=
"0"
/>
<initial-values>
<property
name=
"text"
value=
"Label"
/>
</initial-values>
</item>
<item
class=
"javax.swing.JTextField"
icon=
"/com/intellij/uiDesigner/icons/textField.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"6"
anchor=
"8"
fill=
"1"
>
<preferred-size
width=
"150"
height=
"-1"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JPasswordField"
icon=
"/com/intellij/uiDesigner/icons/passwordField.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"6"
anchor=
"8"
fill=
"1"
>
<preferred-size
width=
"150"
height=
"-1"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JFormattedTextField"
icon=
"/com/intellij/uiDesigner/icons/formattedTextField.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"6"
anchor=
"8"
fill=
"1"
>
<preferred-size
width=
"150"
height=
"-1"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JTextArea"
icon=
"/com/intellij/uiDesigner/icons/textArea.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"6"
anchor=
"0"
fill=
"3"
>
<preferred-size
width=
"150"
height=
"50"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JTextPane"
icon=
"/com/intellij/uiDesigner/icons/textPane.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"6"
anchor=
"0"
fill=
"3"
>
<preferred-size
width=
"150"
height=
"50"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JEditorPane"
icon=
"/com/intellij/uiDesigner/icons/editorPane.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"6"
anchor=
"0"
fill=
"3"
>
<preferred-size
width=
"150"
height=
"50"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JComboBox"
icon=
"/com/intellij/uiDesigner/icons/comboBox.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"2"
anchor=
"8"
fill=
"1"
/>
</item>
<item
class=
"javax.swing.JTable"
icon=
"/com/intellij/uiDesigner/icons/table.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"6"
anchor=
"0"
fill=
"3"
>
<preferred-size
width=
"150"
height=
"50"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JList"
icon=
"/com/intellij/uiDesigner/icons/list.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"2"
anchor=
"0"
fill=
"3"
>
<preferred-size
width=
"150"
height=
"50"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JTree"
icon=
"/com/intellij/uiDesigner/icons/tree.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"6"
anchor=
"0"
fill=
"3"
>
<preferred-size
width=
"150"
height=
"50"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JTabbedPane"
icon=
"/com/intellij/uiDesigner/icons/tabbedPane.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"3"
hsize-policy=
"3"
anchor=
"0"
fill=
"3"
>
<preferred-size
width=
"200"
height=
"200"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JSplitPane"
icon=
"/com/intellij/uiDesigner/icons/splitPane.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"3"
hsize-policy=
"3"
anchor=
"0"
fill=
"3"
>
<preferred-size
width=
"200"
height=
"200"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JSpinner"
icon=
"/com/intellij/uiDesigner/icons/spinner.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"true"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"6"
anchor=
"8"
fill=
"1"
/>
</item>
<item
class=
"javax.swing.JSlider"
icon=
"/com/intellij/uiDesigner/icons/slider.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"6"
anchor=
"8"
fill=
"1"
/>
</item>
<item
class=
"javax.swing.JSeparator"
icon=
"/com/intellij/uiDesigner/icons/separator.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"6"
anchor=
"0"
fill=
"3"
/>
</item>
<item
class=
"javax.swing.JProgressBar"
icon=
"/com/intellij/uiDesigner/icons/progressbar.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"6"
anchor=
"0"
fill=
"1"
/>
</item>
<item
class=
"javax.swing.JToolBar"
icon=
"/com/intellij/uiDesigner/icons/toolbar.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"6"
anchor=
"0"
fill=
"1"
>
<preferred-size
width=
"-1"
height=
"20"
/>
</default-constraints>
</item>
<item
class=
"javax.swing.JToolBar$Separator"
icon=
"/com/intellij/uiDesigner/icons/toolbarSeparator.png"
removable=
"false"
auto-create-binding=
"false"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"0"
hsize-policy=
"0"
anchor=
"0"
fill=
"1"
/>
</item>
<item
class=
"javax.swing.JScrollBar"
icon=
"/com/intellij/uiDesigner/icons/scrollbar.png"
removable=
"false"
auto-create-binding=
"true"
can-attach-label=
"false"
>
<default-constraints
vsize-policy=
"6"
hsize-policy=
"0"
anchor=
"0"
fill=
"2"
/>
</item>
</group>
</component>
</project>
\ No newline at end of file
PageObjectPatternAssignment/PageObjectPatternAssignment.iml
0 → 100644
View file @
ed185fbe
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
/>
\ No newline at end of file
PageObjectPatternAssignment/pom.xml
0 → 100644
View file @
ed185fbe
<?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>
PageObjectPatternAssignment
</artifactId>
<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.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-api
</artifactId>
<version>
5.7.0
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-engine
</artifactId>
<version>
5.7.0
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.seleniumhq.selenium
</groupId>
<artifactId>
selenium-java
</artifactId>
<version>
3.141.59
</version>
</dependency>
<dependency>
<groupId>
org.seleniumhq.selenium
</groupId>
<artifactId>
selenium-chrome-driver
</artifactId>
<version>
3.141.59
</version>
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter-api
</artifactId>
<version>
5.7.0
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
PageObjectPatternAssignment/src/main/java/AccountPage.java
0 → 100644
View file @
ed185fbe
import
org.junit.jupiter.api.Assertions
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.openqa.selenium.support.FindBy
;
import
org.openqa.selenium.support.FindBys
;
import
org.openqa.selenium.support.PageFactory
;
import
org.openqa.selenium.support.ui.ExpectedConditions
;
import
org.openqa.selenium.support.ui.WebDriverWait
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
public
class
AccountPage
{
WebDriver
driver
;
String
expectFirstName
;
String
expectLastName
;
String
expectphoneNumber
;
@FindBys
({
@FindBy
(
className
=
"input-controller"
),
@FindBy
(
id
=
"input-firstName"
),
})
WebElement
userFirstName
;
@FindBys
({
@FindBy
(
className
=
"input-controller"
),
@FindBy
(
id
=
"input-lastName"
),
})
WebElement
userLastName
;
@FindBys
({
@FindBy
(
className
=
"input-controller"
),
@FindBy
(
id
=
"emailIdaccount"
),
})
WebElement
userEmail
;
@FindBys
({
@FindBy
(
className
=
"input-controller"
),
@FindBy
(
id
=
"phoneNumber"
),
})
WebElement
phoneNumber
;
public
AccountPage
(
WebDriver
driver
){
this
.
driver
=
driver
;
PageFactory
.
initElements
(
this
.
driver
,
this
);
}
public
void
verifyUserInfo
(){
try
(
InputStream
input
=
new
FileInputStream
(
"../resources/config.properties"
))
{
Properties
prop
=
new
Properties
();
prop
.
load
(
input
);
expectFirstName
=
prop
.
getProperty
(
"firstName"
);
expectLastName
=
prop
.
getProperty
(
"lastName"
);
expectphoneNumber
=
prop
.
getProperty
(
"phoneNumber"
);
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
WebDriverWait
wdw
=
new
WebDriverWait
(
driver
,
10
);
// wdw.until(ExpectedConditions.elementToBeClickable(getInputUserName()));
Assertions
.
assertEquals
(
expectFirstName
,
userFirstName
.
getText
());
Assertions
.
assertEquals
(
expectLastName
,
userLastName
.
getText
());
Assertions
.
assertEquals
(
expectphoneNumber
,
phoneNumber
.
getText
());
}
}
PageObjectPatternAssignment/src/main/java/HomePage.java
0 → 100644
View file @
ed185fbe
import
org.openqa.selenium.By
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
java.util.concurrent.TimeUnit
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
public
class
HomePage
{
WebDriver
driver
;
public
HomePage
(
WebDriver
driver
,
String
url
){
this
.
driver
=
driver
;
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
driver
.
navigate
().
to
(
url
);
}
public
WebElement
getLinkSignIn
(){
return
driver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div/div[1]/div/div/div/div[3]/div[2]/div[1]/div/div/div[3]/ul/li[1]/a"
));
}
public
WebElement
getMenuSignIn
(){
return
driver
.
findElement
(
By
.
xpath
(
"//*[@id=\"sign-in-modal-link\"]"
));
}
public
WebElement
getLinkAccount
(){
return
driver
.
findElement
(
By
.
xpath
(
"/html/body/div[1]/div/div/div[1]/div/div/div/div[3]/div[2]/div[1]/div/div/div[3]/ul/li[1]/a"
));
}
public
WebElement
getMenuAccount
(){
return
driver
.
findElement
(
By
.
xpath
(
"//*[@id=\"menu\"]/div[1]/ul/li[4]/a"
));
}
public
void
navigatetoSignIn
(){
getLinkSignIn
().
click
();
getMenuSignIn
().
click
();
}
public
void
navigatetoAccount
(){
getLinkAccount
().
click
();
getMenuAccount
().
click
();
}
public
void
verifyLoggedIn
(){
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
WebElement
loginMessage
=
driver
.
findElement
(
By
.
className
(
"menu-nav__profile-button"
));
assertTrue
(
loginMessage
.
isDisplayed
(),
"User Logged In"
);
}
}
PageObjectPatternAssignment/src/main/java/LoginPage.java
0 → 100644
View file @
ed185fbe
import
org.openqa.selenium.By
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.openqa.selenium.chrome.ChromeDriver
;
import
org.openqa.selenium.support.ui.ExpectedConditions
;
import
org.openqa.selenium.support.ui.WebDriverWait
;
import
java.util.concurrent.TimeUnit
;
public
class
LoginPage
{
WebDriver
driver
;
public
LoginPage
(
WebDriver
driver
){
this
.
driver
=
driver
;
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
// driver.navigate().to(url);
}
public
WebElement
getInputUserName
(){
return
driver
.
findElement
(
By
.
xpath
(
"//*[@id=\"label-email\"]"
));
}
public
WebElement
getInputPassword
(){
return
driver
.
findElement
(
By
.
xpath
(
"//*[@id=\"label-password\"]"
));
}
public
WebElement
getBtnSubmit
(){
return
driver
.
findElement
(
By
.
xpath
(
"//*[@id=\"btnSignIn\"]"
));
}
public
void
navigateHome
(
String
url
){
driver
.
get
(
url
);
}
public
void
login
(
String
username
,
String
password
)
throws
InterruptedException
{
WebDriverWait
wdw
=
new
WebDriverWait
(
driver
,
10
);
wdw
.
until
(
ExpectedConditions
.
elementToBeClickable
(
getInputUserName
()));
getInputUserName
().
sendKeys
(
username
);
wdw
.
until
(
ExpectedConditions
.
elementToBeClickable
(
getInputPassword
()));
getInputPassword
().
sendKeys
(
password
);
wdw
.
until
(
ExpectedConditions
.
elementToBeClickable
(
getBtnSubmit
()));
getBtnSubmit
().
click
();
// driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
}
}
PageObjectPatternAssignment/src/main/resources/config.properties
0 → 100644
View file @
ed185fbe
#user Properties
email
=
vkrijegccvsknuvnpv@miucce.com
firstName
=
Nisum
lastName
=
TestAcct
phoneNumber
=
3141592635
clubNumber
=
49132518493
PageObjectPatternAssignment/src/test/java/Tests.java
0 → 100644
View file @
ed185fbe
import
org.junit.jupiter.api.Test
;
import
org.openqa.selenium.By
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.chrome.ChromeDriver
;
import
org.openqa.selenium.support.ui.ExpectedConditions
;
import
org.openqa.selenium.support.ui.WebDriverWait
;
import
java.util.concurrent.TimeUnit
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
public
class
Tests
{
@Test
public
void
LoginTest
()
throws
InterruptedException
{
System
.
setProperty
(
"webdriver.chrome.driver"
,
"/Users/xlu/Documents/java-collections-fundamentals/chromedriver"
);
WebDriver
driver
=
new
ChromeDriver
();
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
HomePage
homepage
=
new
HomePage
(
driver
,
"https://www.safeway.com/"
);
homepage
.
navigatetoSignIn
();
LoginPage
login
=
new
LoginPage
(
driver
);
login
.
login
(
"vkrijegccvsknuvnpv@miucce.com"
,
"12345678"
);
homepage
.
verifyLoggedIn
();
driver
.
close
();
}
@Test
public
void
AccountTest
()
throws
InterruptedException
{
System
.
setProperty
(
"webdriver.chrome.driver"
,
"/Users/xlu/Documents/java-collections-fundamentals/chromedriver"
);
WebDriver
driver
=
new
ChromeDriver
();
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
HomePage
homepage
=
new
HomePage
(
driver
,
"https://www.safeway.com/"
);
homepage
.
navigatetoAccount
();
AccountPage
account
=
new
AccountPage
(
driver
);
account
.
verifyUserInfo
();
driver
.
close
();
}
}
PageObjectPatternAssignment/target/classes/AccountPage.class
0 → 100644
View file @
ed185fbe
File added
PageObjectPatternAssignment/target/classes/HomePage.class
0 → 100644
View file @
ed185fbe
File added
PageObjectPatternAssignment/target/classes/LoginPage.class
0 → 100644
View file @
ed185fbe
File added
PageObjectPatternAssignment/target/classes/config.properties
0 → 100644
View file @
ed185fbe
#user Properties
email
=
vkrijegccvsknuvnpv@miucce.com
firstName
=
Nisum
lastName
=
TestAcct
phoneNumber
=
3141592635
clubNumber
=
49132518493
PageObjectPatternAssignment/target/test-classes/Tests.class
0 → 100644
View file @
ed185fbe
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment