Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pof_pom
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
Darrick Yong
pof_pom
Commits
3f6c1d29
Commit
3f6c1d29
authored
Apr 13, 2021
by
Darrick Yong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for phone
parent
ce74d36f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
6 deletions
+12
-6
AccountSettingsPage.java
src/main/java/AccountSettingsPage.java
+7
-2
HomePage.java
src/main/java/HomePage.java
+0
-2
GetAccountProperties.java
src/main/java/helpers/GetAccountProperties.java
+1
-0
account.properties
src/main/resources/account.properties
+2
-1
TestSafeway.java
src/test/java/TestSafeway.java
+2
-1
No files found.
src/main/java/AccountSettingsPage.java
View file @
3f6c1d29
...
@@ -18,17 +18,22 @@ public class AccountSettingsPage {
...
@@ -18,17 +18,22 @@ public class AccountSettingsPage {
@FindBy
(
how
=
How
.
ID
,
using
=
"emailIdaccount"
)
@FindBy
(
how
=
How
.
ID
,
using
=
"emailIdaccount"
)
WebElement
emailInput
;
WebElement
emailInput
;
@FindBy
(
how
=
How
.
ID
,
using
=
"phoneNumber"
)
WebElement
phoneInput
;
public
AccountSettingsPage
(
WebDriver
driver
)
{
public
AccountSettingsPage
(
WebDriver
driver
)
{
this
.
driver
=
driver
;
this
.
driver
=
driver
;
PageFactory
.
initElements
(
driver
,
this
);
PageFactory
.
initElements
(
driver
,
this
);
}
}
public
void
confirmLogin
(
String
firstName
,
String
lastName
,
String
email
)
{
public
void
confirmLogin
(
String
firstName
,
String
lastName
,
String
email
,
String
phone
)
{
assertAll
(
"First name, last name, and email should match account props"
,
assertAll
(
"First name, last name, and email should match account props"
,
()
->
assertEquals
(
firstName
,
firstNameInput
.
getAttribute
(
"value"
)),
()
->
assertEquals
(
firstName
,
firstNameInput
.
getAttribute
(
"value"
)),
()
->
assertEquals
(
lastName
,
lastNameInput
.
getAttribute
(
"value"
)),
()
->
assertEquals
(
lastName
,
lastNameInput
.
getAttribute
(
"value"
)),
()
->
assertEquals
(
email
,
emailInput
.
getAttribute
(
"value"
))
()
->
assertEquals
(
email
,
emailInput
.
getAttribute
(
"value"
)),
()
->
assertEquals
(
phone
,
phoneInput
.
getAttribute
(
"value"
))
// () -> assertEquals(email, firstName) // should fail
// () -> assertEquals(email, firstName) // should fail
);
);
}
}
...
...
src/main/java/HomePage.java
View file @
3f6c1d29
...
@@ -10,8 +10,6 @@ public class HomePage {
...
@@ -10,8 +10,6 @@ public class HomePage {
@FindBy
(
how
=
How
.
XPATH
,
using
=
"//a[@class='menu-nav__profile-button']"
)
@FindBy
(
how
=
How
.
XPATH
,
using
=
"//a[@class='menu-nav__profile-button']"
)
WebElement
signInUpLink
;
WebElement
signInUpLink
;
public
HomePage
(
WebDriver
driver
)
{
public
HomePage
(
WebDriver
driver
)
{
this
.
driver
=
driver
;
this
.
driver
=
driver
;
PageFactory
.
initElements
(
driver
,
this
);
PageFactory
.
initElements
(
driver
,
this
);
...
...
src/main/java/helpers/GetAccountProperties.java
View file @
3f6c1d29
...
@@ -28,6 +28,7 @@ public class GetAccountProperties {
...
@@ -28,6 +28,7 @@ public class GetAccountProperties {
res
.
put
(
"password"
,
props
.
getProperty
(
"password"
));
res
.
put
(
"password"
,
props
.
getProperty
(
"password"
));
res
.
put
(
"firstName"
,
props
.
getProperty
(
"firstName"
));
res
.
put
(
"firstName"
,
props
.
getProperty
(
"firstName"
));
res
.
put
(
"lastName"
,
props
.
getProperty
(
"lastName"
));
res
.
put
(
"lastName"
,
props
.
getProperty
(
"lastName"
));
res
.
put
(
"phone"
,
props
.
getProperty
(
"phone"
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
System
.
out
.
println
(
e
);
...
...
src/main/resources/account.properties
View file @
3f6c1d29
...
@@ -2,3 +2,4 @@ email=vkrijegccvsknuvnpv@miucce.com
...
@@ -2,3 +2,4 @@ email=vkrijegccvsknuvnpv@miucce.com
password
=
12345678
password
=
12345678
firstName
=
Nisum
firstName
=
Nisum
lastName
=
TestAcct
lastName
=
TestAcct
phone
=
3141592635
\ No newline at end of file
src/test/java/TestSafeway.java
View file @
3f6c1d29
...
@@ -15,6 +15,7 @@ public class TestSafeway {
...
@@ -15,6 +15,7 @@ public class TestSafeway {
String
password
=
props
.
get
(
"password"
);
String
password
=
props
.
get
(
"password"
);
String
firstName
=
props
.
get
(
"firstName"
);
String
firstName
=
props
.
get
(
"firstName"
);
String
lastName
=
props
.
get
(
"lastName"
);
String
lastName
=
props
.
get
(
"lastName"
);
String
phone
=
props
.
get
(
"phone"
);
public
TestSafeway
()
throws
IOException
{
public
TestSafeway
()
throws
IOException
{
}
}
...
@@ -48,7 +49,7 @@ public class TestSafeway {
...
@@ -48,7 +49,7 @@ public class TestSafeway {
waiter
.
until
(
ExpectedConditions
.
visibilityOfElementLocated
(
By
.
linkText
(
"Account Settings"
)));
waiter
.
until
(
ExpectedConditions
.
visibilityOfElementLocated
(
By
.
linkText
(
"Account Settings"
)));
AccountSettingsPage
accountSettingsPage
=
new
AccountSettingsPage
(
driver
);
AccountSettingsPage
accountSettingsPage
=
new
AccountSettingsPage
(
driver
);
accountSettingsPage
.
confirmLogin
(
firstName
,
lastName
,
email
);
accountSettingsPage
.
confirmLogin
(
firstName
,
lastName
,
email
,
phone
);
}
}
...
...
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