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
ce74d36f
Commit
ce74d36f
authored
Apr 13, 2021
by
Darrick Yong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up code
parent
7f187fca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
16 deletions
+9
-16
LoginPage.java
src/main/java/LoginPage.java
+1
-5
RightNavBar.java
src/main/java/RightNavBar.java
+4
-0
GetAccountProperties.java
src/main/java/helpers/GetAccountProperties.java
+2
-0
TestSafeway.java
src/test/java/TestSafeway.java
+2
-11
No files found.
src/main/java/LoginPage.java
View file @
ce74d36f
...
...
@@ -14,7 +14,6 @@ public class LoginPage {
this
.
driver
=
driver
;
}
public
WebElement
getNameInput
()
{
return
driver
.
findElement
(
By
.
xpath
(
"//input[@name='userId']"
));
}
...
...
@@ -31,10 +30,6 @@ public class LoginPage {
return
new
WebDriverWait
(
this
.
driver
,
5
);
}
// public void navigate(String url) {
// this.driver.get(url);
// }
public
void
login
(
String
username
,
String
password
)
{
getWaiter
().
until
(
ExpectedConditions
.
visibilityOfElementLocated
(
By
.
id
(
"btnSignIn"
)));
...
...
@@ -42,5 +37,6 @@ public class LoginPage {
getNameInput
().
sendKeys
(
username
);
getPassInput
().
sendKeys
(
password
);
getSubmitBtn
().
click
();
}
}
src/main/java/RightNavBar.java
View file @
ce74d36f
...
...
@@ -23,4 +23,8 @@ public class RightNavBar {
signInLink
.
click
();
}
public
void
openAccountSettings
()
{
accountSettingsLink
.
click
();
}
}
src/main/java/GetAccountProperties.java
→
src/main/java/
helpers/
GetAccountProperties.java
View file @
ce74d36f
package
helpers
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.InputStream
;
...
...
src/test/java/TestSafeway.java
View file @
ce74d36f
import
helpers.GetAccountProperties
;
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.io.IOException
;
import
java.util.Map
;
public
class
TestSafeway
{
Map
<
String
,
String
>
props
=
new
GetAccountProperties
().
getProps
();
...
...
@@ -20,7 +19,6 @@ public class TestSafeway {
public
TestSafeway
()
throws
IOException
{
}
private
static
String
getOS
()
{
return
System
.
getProperty
(
"os.name"
);
}
...
...
@@ -28,7 +26,6 @@ public class TestSafeway {
@Test
public
void
testSafewayLogin
()
{
if
(
getOS
().
startsWith
(
"Mac OS"
))
{
System
.
out
.
println
(
"mac"
);
System
.
setProperty
(
"webdriver.chrome.driver"
,
"src/main/resources/chromedriver"
);
}
...
...
@@ -47,18 +44,12 @@ public class TestSafeway {
waiter
.
until
(
ExpectedConditions
.
visibilityOfElementLocated
(
By
.
linkText
(
"Account"
)));
homePage
.
openRightNav
();
rightNavBar
.
accountSettingsLink
.
click
();
rightNavBar
.
openAccountSettings
();
waiter
.
until
(
ExpectedConditions
.
visibilityOfElementLocated
(
By
.
linkText
(
"Account Settings"
)));
AccountSettingsPage
accountSettingsPage
=
new
AccountSettingsPage
(
driver
);
accountSettingsPage
.
confirmLogin
(
firstName
,
lastName
,
email
);
}
}
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