Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
POM_page_factory_exercise
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
Shaphen Pangburn
POM_page_factory_exercise
Commits
7d103107
Commit
7d103107
authored
Apr 13, 2021
by
Shaphen Pangburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify configurations and add code to test working functionality
parent
23d21892
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
33 deletions
+46
-33
build.gradle
build.gradle
+6
-7
PracticeApplication.java
...om/nisum/pompagefactory/practice/PracticeApplication.java
+0
-13
PracticeApplicationTests.java
...sum/pompagefactory/practice/PracticeApplicationTests.java
+0
-13
SafewayLogin.java
.../java/com/nisum/pompagefactory/practice/SafewayLogin.java
+40
-0
No files found.
build.gradle
View file @
7d103107
plugins
{
plugins
{
id
'org.springframework.boot'
version
'2.4.4'
id
'io.spring.dependency-management'
version
'1.0.11.RELEASE'
id
'java'
id
'java'
}
}
group
=
'com.nisum.pom-page-factory'
group
'com.nisum.pom-page-factory'
version
=
'0.0.1-SNAPSHOT'
version
'0.0.1-SNAPSHOT'
sourceCompatibility
=
'11'
repositories
{
repositories
{
mavenCentral
()
mavenCentral
()
}
}
dependencies
{
dependencies
{
implementation
'org.springframework.boot:spring-boot-starter'
implementation
group:
'org.seleniumhq.selenium'
,
name:
'selenium-java'
,
version:
'3.141.59'
testImplementation
'org.springframework.boot:spring-boot-starter-test'
testImplementation
'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly
'org.junit.jupiter:junit-jupiter-engine'
}
}
test
{
test
{
...
...
src/main/java/com/nisum/pompagefactory/practice/PracticeApplication.java
deleted
100644 → 0
View file @
23d21892
package
com
.
nisum
.
pompagefactory
.
practice
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
PracticeApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
PracticeApplication
.
class
,
args
);
}
}
src/test/java/com/nisum/pompagefactory/practice/PracticeApplicationTests.java
deleted
100644 → 0
View file @
23d21892
package
com
.
nisum
.
pompagefactory
.
practice
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
PracticeApplicationTests
{
@Test
void
contextLoads
()
{
}
}
src/test/java/com/nisum/pompagefactory/practice/SafewayLogin.java
0 → 100644
View file @
7d103107
package
com
.
nisum
.
pompagefactory
.
practice
;
import
org.junit.jupiter.api.*
;
import
org.openqa.selenium.By
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.openqa.selenium.chrome.ChromeDriver
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
class
SafewayLogin
{
@Test
public
void
testSafewayLogin
()
throws
InterruptedException
{
System
.
setProperty
(
"webdriver.chrome.driver"
,
"/Users/spangburn/Desktop/nisum_learning/drivers/chromedriver"
);
WebDriver
driver
=
new
ChromeDriver
();
driver
.
get
(
"https://www.safeway.com/"
);
Thread
.
sleep
(
1000
);
WebElement
signInDropdown
=
driver
.
findElement
(
By
.
linkText
(
"Sign In / Up"
));
signInDropdown
.
click
();
Thread
.
sleep
(
1000
);
WebElement
signInButton
=
driver
.
findElement
(
By
.
id
(
"sign-in-modal-link"
));
signInButton
.
click
();
Thread
.
sleep
(
2000
);
WebElement
trySignIn
=
driver
.
findElement
(
By
.
id
(
"btnSignIn"
));
trySignIn
.
click
();
Thread
.
sleep
(
5000
);
WebElement
failedText1
=
driver
.
findElement
(
By
.
xpath
(
"//*[@id=\"errorMsgEmail\"]/ul/li"
));
WebElement
failedText2
=
driver
.
findElement
(
By
.
xpath
(
"//*[@id=\"errorMsgPwd\"]/ul/li"
));
assertEquals
(
"Please enter your email address."
,
failedText1
.
getText
());
assertEquals
(
"Please enter a password."
,
failedText2
.
getText
());
driver
.
quit
();
}
}
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