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
5fc64694
Commit
5fc64694
authored
4 years ago
by
sbobo3
Browse files
Options
Downloads
Patches
Plain Diff
Fixed Selenium tests that were failing.
parent
5e04f75c
No related branches found
No related tags found
2 merge requests
!7
Uc20
,
!2
UC20 Data Access Object Completed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iTrust/test/edu/ncsu/csc/itrust/selenium/CauseOfDeathTrendsReportSeleniumTest.java
+42
-27
42 additions, 27 deletions
...itrust/selenium/CauseOfDeathTrendsReportSeleniumTest.java
with
42 additions
and
27 deletions
iTrust/test/edu/ncsu/csc/itrust/selenium/CauseOfDeathTrendsReportSeleniumTest.java
+
42
−
27
View file @
5fc64694
...
...
@@ -18,7 +18,7 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
}
public
void
testViewCODTrendsReports_AllPatientsAllGenders
()
throws
Exception
{
driver
=
(
HtmlUnitDriver
)
login
(
"900000000
3
"
,
"pw"
);
driver
=
(
HtmlUnitDriver
)
login
(
"900000000
0
"
,
"pw"
);
// Click Diagnosis Trends
driver
.
findElement
(
By
.
cssSelector
(
"h2.panel-title"
)).
click
();
...
...
@@ -32,7 +32,7 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
driver
.
findElement
(
By
.
name
(
"endDate"
)).
sendKeys
(
"12/31/2020"
);
driver
.
findElement
(
By
.
id
(
"view_report"
)).
click
();
assertTrue
(
driver
.
getCurrentUrl
().
equals
(
ADDRESS
+
"auth/hcp/causeOfDeathTrendsReport.jsp"
));
assertLogged
(
TransactionType
.
DEATH_TRENDS_VIEW
,
900000000
3
L
,
0L
,
assertLogged
(
TransactionType
.
DEATH_TRENDS_VIEW
,
900000000
0
L
,
0L
,
"View cause-of-death trends report"
);
WebElement
table
=
driver
.
findElement
(
By
.
id
(
"causeOfDeathTrendsTable"
));
...
...
@@ -42,19 +42,19 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
assertEquals
(
cause1
,
"Influenza"
);
assertEquals
(
code1
,
487.00
);
assertEquals
(
deaths1
,
5
);
assertEquals
(
deaths1
,
4
);
String
cause2
=
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
3
).
getText
();
double
code2
=
Double
.
parseDouble
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
4
).
getText
());
int
deaths2
=
Integer
.
parseInt
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
5
).
getText
());
assertEquals
(
cause2
,
"
Tuberculosis of the lung
"
);
assertEquals
(
code2
,
11.4
0
);
assertEquals
(
deaths2
,
3
);
assertEquals
(
cause2
,
"
Diabetes with ketoacidosis
"
);
assertEquals
(
code2
,
250.1
0
);
assertEquals
(
deaths2
,
1
);
}
public
void
testViewCODTrendsReports_AllPatientsOnlyMale
()
throws
Exception
{
driver
=
(
HtmlUnitDriver
)
login
(
"900000000
3
"
,
"pw"
);
driver
=
(
HtmlUnitDriver
)
login
(
"900000000
0
"
,
"pw"
);
// Click Diagnosis Trends
driver
.
findElement
(
By
.
cssSelector
(
"h2.panel-title"
)).
click
();
...
...
@@ -69,7 +69,7 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
driver
.
findElement
(
By
.
name
(
"endDate"
)).
sendKeys
(
"12/31/2020"
);
driver
.
findElement
(
By
.
id
(
"view_report"
)).
click
();
assertTrue
(
driver
.
getCurrentUrl
().
equals
(
ADDRESS
+
"auth/hcp/causeOfDeathTrendsReport.jsp"
));
assertLogged
(
TransactionType
.
DEATH_TRENDS_VIEW
,
900000000
3
L
,
0L
,
assertLogged
(
TransactionType
.
DEATH_TRENDS_VIEW
,
900000000
0
L
,
0L
,
"View cause-of-death trends report"
);
WebElement
table
=
driver
.
findElement
(
By
.
id
(
"causeOfDeathTrendsTable"
));
...
...
@@ -79,15 +79,15 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
assertEquals
(
cause1
,
"Influenza"
);
assertEquals
(
code1
,
487.00
);
assertEquals
(
deaths1
,
3
);
assertEquals
(
deaths1
,
2
);
String
cause2
=
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
3
).
getText
();
double
code2
=
Double
.
parseDouble
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
4
).
getText
());
int
deaths2
=
Integer
.
parseInt
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
5
).
getText
());
assertEquals
(
cause2
,
"
Malaria
"
);
assertEquals
(
code2
,
84.5
0
);
assertEquals
(
deaths2
,
2
);
assertEquals
(
cause2
,
"
Diabetes with ketoacidosis
"
);
assertEquals
(
code2
,
250.1
0
);
assertEquals
(
deaths2
,
1
);
}
public
void
testViewCODTrendsReports_AllPatientsOnlyFemale
()
throws
Exception
{
...
...
@@ -117,14 +117,6 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
assertEquals
(
cause1
,
"Influenza"
);
assertEquals
(
code1
,
487.00
);
assertEquals
(
deaths1
,
2
);
String
cause2
=
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
3
).
getText
();
double
code2
=
Double
.
parseDouble
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
4
).
getText
());
int
deaths2
=
Integer
.
parseInt
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
5
).
getText
());
assertEquals
(
cause2
,
"Tuberculosis of the lung"
);
assertEquals
(
code2
,
11.40
);
assertEquals
(
deaths2
,
1
);
}
public
void
testViewCODTrendsReports_MyPatientsAllGenders
()
throws
Exception
{
...
...
@@ -151,9 +143,17 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
double
code1
=
Double
.
parseDouble
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
1
).
getText
());
int
deaths1
=
Integer
.
parseInt
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
2
).
getText
());
assertEquals
(
cause1
,
"Diabetes with ketoacidosis"
);
assertEquals
(
code1
,
250.10
);
assertEquals
(
deaths1
,
1
);
assertEquals
(
cause1
,
"Influenza"
);
assertEquals
(
code1
,
487.00
);
assertEquals
(
deaths1
,
4
);
String
cause2
=
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
3
).
getText
();
double
code2
=
Double
.
parseDouble
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
4
).
getText
());
int
deaths2
=
Integer
.
parseInt
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
5
).
getText
());
assertEquals
(
cause2
,
"Diabetes with ketoacidosis"
);
assertEquals
(
code2
,
250.10
);
assertEquals
(
deaths2
,
1
);
}
public
void
testViewCODTrendsReports_MyPatientsOnlyMale
()
throws
Exception
{
...
...
@@ -181,9 +181,17 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
double
code1
=
Double
.
parseDouble
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
1
).
getText
());
int
deaths1
=
Integer
.
parseInt
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
2
).
getText
());
assertEquals
(
cause1
,
"Diabetes with ketoacidosis"
);
assertEquals
(
code1
,
250.10
);
assertEquals
(
deaths1
,
1
);
assertEquals
(
cause1
,
"Influenza"
);
assertEquals
(
code1
,
487.00
);
assertEquals
(
deaths1
,
2
);
String
cause2
=
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
3
).
getText
();
double
code2
=
Double
.
parseDouble
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
4
).
getText
());
int
deaths2
=
Integer
.
parseInt
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
5
).
getText
());
assertEquals
(
cause2
,
"Diabetes with ketoacidosis"
);
assertEquals
(
code2
,
250.10
);
assertEquals
(
deaths2
,
1
);
}
public
void
testViewCODTrendsReports_MyPatientsOnlyFemale
()
throws
Exception
{
...
...
@@ -206,7 +214,14 @@ public class CauseOfDeathTrendsReportSeleniumTest extends iTrustSeleniumTest {
assertLogged
(
TransactionType
.
DEATH_TRENDS_VIEW
,
9000000003L
,
0L
,
"View cause-of-death trends report"
);
assertTrue
(
driver
.
getPageSource
().
contains
(
"No results returned"
));
WebElement
table
=
driver
.
findElement
(
By
.
id
(
"causeOfDeathTrendsTable"
));
String
cause1
=
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
0
).
getText
();
double
code1
=
Double
.
parseDouble
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
1
).
getText
());
int
deaths1
=
Integer
.
parseInt
(
table
.
findElements
(
By
.
tagName
(
"td"
)).
get
(
2
).
getText
());
assertEquals
(
cause1
,
"Influenza"
);
assertEquals
(
code1
,
487.00
);
assertEquals
(
deaths1
,
2
);
}
public
void
testViewCODTrendsReports_EmptyDates
()
throws
Exception
{
...
...
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