-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify login method in tests and add new admin monitoring…
… and user management tests (#7041)
- Loading branch information
Showing
14 changed files
with
421 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
.../src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminApplicationSystemTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.hack23.cia.systemintegrationtest.admin; | ||
|
||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
|
||
import com.hack23.cia.systemintegrationtest.AbstractUITest; | ||
import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; | ||
import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PageCommandAdminConstants; | ||
|
||
// ...imports... | ||
|
||
@Category(IntegrationTest.class) | ||
public class AdminApplicationSystemTest extends AbstractUITest { | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyApplicationSessionPaginationTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION); | ||
pageVisit.verifyPageContent("Application Session"); | ||
|
||
// Test last page | ||
pageVisit.performClickAction(pageVisit.findButton("last page")); | ||
|
||
// Test next page | ||
pageVisit.performClickAction(pageVisit.findButton("next page")); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyApplicationEventsChartTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_EVENTS_CHARTS); | ||
pageVisit.verifyPageContent("Charts"); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyApplicationSessionChartsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION_CHARTS); | ||
pageVisit.verifyPageContent("Admin Application Session Charts"); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION_CHARTS); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyAgentOperationsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_AGENT_OPERATION); | ||
pageVisit.verifyPageContent("Agent Operations"); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_AGENT_OPERATION); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyApplicationGridOperationsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION); | ||
pageVisit.verifyPageContent("Application Session"); | ||
pageVisit.selectFirstGridRow(); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION); | ||
pageVisit.verifyPageContent("ApplicationActionEvent"); | ||
} | ||
|
||
// ...other application management tests... | ||
} |
39 changes: 39 additions & 0 deletions
39
...rc/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationSystemTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.hack23.cia.systemintegrationtest.admin; | ||
|
||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
|
||
import com.hack23.cia.systemintegrationtest.AbstractUITest; | ||
import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; | ||
import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PageCommandAdminConstants; | ||
|
||
@Category(IntegrationTest.class) | ||
public class AdminConfigurationSystemTest extends AbstractUITest { | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyLanguageConfigurationTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_LANGUAGE); | ||
pageVisit.verifyPageContent("Language"); | ||
pageVisit.selectFirstGridRow(); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_LANGUAGE); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyCountryConfigurationTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_COUNTRY); | ||
pageVisit.verifyPageContent("Country"); | ||
pageVisit.selectFirstGridRow(); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_COUNTRY); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyPortalConfigurationTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_PORTAL); | ||
pageVisit.verifyPageContent("Portal Configuration"); | ||
pageVisit.selectFirstGridRow(); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_PORTAL); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
.../src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataSummarySystemTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.hack23.cia.systemintegrationtest.admin; | ||
|
||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
import org.openqa.selenium.WebElement; | ||
|
||
import com.hack23.cia.systemintegrationtest.AbstractUITest; | ||
import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; | ||
import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PageCommandAdminConstants; | ||
|
||
// ...imports... | ||
|
||
@Category(IntegrationTest.class) | ||
public class AdminDataSummarySystemTest extends AbstractUITest { | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyDataManagementOperationsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); | ||
|
||
// Test refresh views | ||
WebElement refreshButton = pageVisit.findButton("Refresh Views"); | ||
assertNotNull(refreshButton); | ||
pageVisit.performClickAction(refreshButton); | ||
|
||
// Test update search index | ||
WebElement indexButton = pageVisit.findButton("Update Search Index"); | ||
assertNotNull(indexButton); | ||
pageVisit.performClickAction(indexButton); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyDataManagementRemoveOperationsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); | ||
|
||
assertNotNull("Expect to find Remove Application History button", | ||
pageVisit.findButton("Remove Application History")); | ||
assertNotNull("Expect to find Remove Documents button", | ||
pageVisit.findButton("Remove Documents")); | ||
assertNotNull("Expect to find Remove Politicians button", | ||
pageVisit.findButton("Remove Politicians")); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyAuthorDataSummaryTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_AUTHOR_DATASUMMARY); | ||
pageVisit.verifyPageContent("Author Summary"); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_AUTHOR_DATASUMMARY); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyRefreshViewsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); | ||
final WebElement refreshViewsButton = pageVisit.findButton("Refresh Views"); | ||
assertNotNull("Expect to find a Refresh Views Button", refreshViewsButton); | ||
pageVisit.performClickAction(refreshViewsButton); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyRemoveDataOperationsButtonsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); | ||
assertNotNull("Expect to find Remove Application History button", pageVisit.findButton("Remove Application History")); | ||
assertNotNull("Expect to find Remove Documents button", pageVisit.findButton("Remove Documents")); | ||
assertNotNull("Expect to find Remove Politicians button", pageVisit.findButton("Remove Politicians")); | ||
} | ||
|
||
// ...other data management tests... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ public final class AdminEmailTest extends AbstractUITest { | |
public void shouldSendValidEmail() { | ||
retryOnFailure(() -> { | ||
try { | ||
pageVisit.loginAsAdmin(pageVisit); | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_EMAIL_VIEW_NAME, "")); | ||
pageVisit.verifyPageContent("email"); | ||
pageVisit.sendEmailOnEmailPage("[email protected]", "Test Subject", "Test content"); | ||
|
@@ -31,7 +31,7 @@ public void shouldSendValidEmail() { | |
public void shouldFailWithInvalidEmail() { | ||
retryOnFailure(() -> { | ||
try { | ||
pageVisit.loginAsAdmin(pageVisit); | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_EMAIL_VIEW_NAME, "")); | ||
pageVisit.verifyPageContent("email"); | ||
pageVisit.sendEmailOnEmailPage("invalidemail", "Test Subject", "Test content"); | ||
|
28 changes: 28 additions & 0 deletions
28
...y/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringSystemTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.hack23.cia.systemintegrationtest.admin; | ||
|
||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
|
||
import com.hack23.cia.systemintegrationtest.AbstractUITest; | ||
import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; | ||
import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PageCommandAdminConstants; | ||
|
||
@Category(IntegrationTest.class) | ||
public class AdminMonitoringSystemTest extends AbstractUITest { | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyMonitoringAccessAndContentTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_MONITORING); | ||
pageVisit.verifyPageContent("Admin Monitoring"); | ||
pageVisit.verifyPageContent("System Status"); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyMonitoringHealthIndicatorsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_MONITORING); | ||
pageVisit.verifyPageContent("Health Indicators"); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_MONITORING); | ||
} | ||
} |
105 changes: 105 additions & 0 deletions
105
...-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminPageSystemTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package com.hack23.cia.systemintegrationtest.admin; | ||
|
||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
|
||
import com.hack23.cia.systemintegrationtest.AbstractUITest; | ||
import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; | ||
import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PageCommandAdminConstants; | ||
|
||
@Category(IntegrationTest.class) | ||
public class AdminPageSystemTest extends AbstractUITest { | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyAgencyPageTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_AGENCY); | ||
pageVisit.verifyPageContent("Agency"); | ||
pageVisit.selectFirstGridRow(); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_AGENCY); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyAgentOperationTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_AGENT_OPERATION); | ||
pageVisit.verifyPageContent("Agent Operation"); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_AGENT_OPERATION); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyApplicationConfigurationPageTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_CONFIGURATION); | ||
pageVisit.verifyPageContent("Application Configuration"); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_APPLICATION_CONFIGURATION); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyApplicationEventsPageTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_EVENTS); | ||
pageVisit.verifyPageContent("Admin Application Events"); | ||
pageVisit.selectFirstGridRow(); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_APPLICATION_EVENTS); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyApplicationSessionPageTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION); | ||
pageVisit.verifyPageContent("Application Session"); | ||
pageVisit.selectFirstGridRow(); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION); | ||
pageVisit.verifyPageContent("ApplicationActionEvent"); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyMonitoringPageFailedAccessTest() throws Exception { | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_MONITORING); | ||
pageVisit.verifyPageContent("Access denied:adminmonitoring"); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyMonitoringPageSuccessTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_MONITORING); | ||
pageVisit.verifyPageContent("Admin Monitoring"); | ||
assertFalse("Dont expect this content", pageVisit.getIframesHtmlBodyAsText().contains("Login with Username and Password")); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyDataSummaryPageOperationsTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); | ||
|
||
// Verify all buttons exist | ||
assertNotNull("Expect to find a Refresh Views Button", pageVisit.findButton("Refresh Views")); | ||
assertNotNull("Expect to find Remove Application History button", pageVisit.findButton("Remove Application History")); | ||
assertNotNull("Expect to find Remove Documents button", pageVisit.findButton("Remove Documents")); | ||
assertNotNull("Expect to find Remove Politicians button", pageVisit.findButton("Remove Politicians")); | ||
assertNotNull("Expect to find Update Search Index button", pageVisit.findButton("Update Search Index")); | ||
|
||
// Test refresh views operation | ||
pageVisit.performClickAction(pageVisit.findButton("Refresh Views")); | ||
|
||
// Test search index update | ||
pageVisit.performClickAction(pageVisit.findButton("Update Search Index")); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyLanguagePageTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_LANGUAGE); | ||
pageVisit.verifyPageContent("Language"); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_LANGUAGE); | ||
} | ||
|
||
@Test(timeout = DEFAULT_TIMEOUT) | ||
public void verifyUserAccountPageTest() throws Exception { | ||
pageVisit.loginAsAdmin(); | ||
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_USERACCOUNT); | ||
pageVisit.verifyPageContent("User Account"); | ||
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_USERACCOUNT); | ||
} | ||
} |
Oops, something went wrong.