Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs427fa20team22
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
htmoss2
cs427fa20team22
Commits
b91391e6
Commit
b91391e6
authored
4 years ago
by
xuechen5
Browse files
Options
Downloads
Patches
Plain Diff
Added Selenium test for whole form input and Non-matching passwords
parent
d25030fb
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Uc91v2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iTrust/test/edu/ncsu/csc/itrust/selenium/PreRegisterPatientTest.java
+46
-0
46 additions, 0 deletions
.../edu/ncsu/csc/itrust/selenium/PreRegisterPatientTest.java
with
46 additions
and
0 deletions
iTrust/test/edu/ncsu/csc/itrust/selenium/PreRegisterPatientTest.java
+
46
−
0
View file @
b91391e6
...
@@ -48,6 +48,38 @@ public class PreRegisterPatientTest extends iTrustSeleniumTest {
...
@@ -48,6 +48,38 @@ public class PreRegisterPatientTest extends iTrustSeleniumTest {
assertTrue
(
driver
.
findElement
(
By
.
xpath
(
"//body"
)).
getText
().
contains
(
"New Pre-registered Patient Information"
));
assertTrue
(
driver
.
findElement
(
By
.
xpath
(
"//body"
)).
getText
().
contains
(
"New Pre-registered Patient Information"
));
}
}
public
void
testPreRegisterPatientSuccessAll
()
throws
Exception
{
goToPreRegister
();
// Fill the form
driver
.
findElement
(
By
.
xpath
(
"//input[@name='firstName']"
)).
sendKeys
(
"fname"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='lastName']"
)).
sendKeys
(
"lname"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='email']"
)).
sendKeys
(
"name@email.com"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='password']"
)).
sendKeys
(
"Password123"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='verifyPassword']"
)).
sendKeys
(
"Password123"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='streetAddress1']"
)).
sendKeys
(
"1234"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='streetAddress2']"
)).
sendKeys
(
"123 ave"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='city']"
)).
sendKeys
(
"Urbana C"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='zip']"
)).
sendKeys
(
"12345"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='phone']"
)).
sendKeys
(
"1234567890"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='height']"
)).
sendKeys
(
"6.3"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='weight']"
)).
sendKeys
(
"180"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='icName']"
)).
sendKeys
(
"ABC"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='icAddress1']"
)).
sendKeys
(
"123"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='icAddress2']"
)).
sendKeys
(
"123 RD"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='icCity']"
)).
sendKeys
(
"Chicago"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='icZip']"
)).
sendKeys
(
"54321"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='icPhone']"
)).
sendKeys
(
"0001234567"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@id='smoker_yes']"
)).
click
();
//driver.findElement(By.name("icState")).selectByValue("NC");
// Submit
driver
.
findElement
(
By
.
id
(
"submit_preregister"
)).
click
();
assertTrue
(
driver
.
findElement
(
By
.
xpath
(
"//body"
)).
getText
().
contains
(
"New Pre-registered Patient Information"
));
}
public
void
testMissingElements
()
{
public
void
testMissingElements
()
{
goToPreRegister
();
goToPreRegister
();
...
@@ -100,4 +132,18 @@ public class PreRegisterPatientTest extends iTrustSeleniumTest {
...
@@ -100,4 +132,18 @@ public class PreRegisterPatientTest extends iTrustSeleniumTest {
assertTrue
(
driver
.
findElement
(
By
.
xpath
(
"//body"
)).
getText
().
contains
(
"This form has not been validated correctly"
));
assertTrue
(
driver
.
findElement
(
By
.
xpath
(
"//body"
)).
getText
().
contains
(
"This form has not been validated correctly"
));
}
}
public
void
testNonMatchPasswords
()
{
goToPreRegister
();
driver
.
findElement
(
By
.
xpath
(
"//input[@name='firstName']"
)).
sendKeys
(
"fname"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='lastName']"
)).
sendKeys
(
"lname"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='email']"
)).
sendKeys
(
"not-an-email"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='password']"
)).
sendKeys
(
"Password123"
);
driver
.
findElement
(
By
.
xpath
(
"//input[@name='verifyPassword']"
)).
sendKeys
(
"Password1234"
);
driver
.
findElement
(
By
.
id
(
"submit_preregister"
)).
click
();
assertFalse
(
driver
.
findElement
(
By
.
xpath
(
"//body"
)).
getText
().
contains
(
"This form has not been validated correctly"
));
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment