Skip to content

Commit

Permalink
Refactor view content verification in admin tests; replace calls to d…
Browse files Browse the repository at this point in the history
…eprecated method with direct pageVisit verification
  • Loading branch information
pethers authored Jan 25, 2025
1 parent d6da5e2 commit 5e0bc4b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,4 @@ public void adminSetup() throws Exception {
pageVisit.loginAsAdmin();
}

/**
* Verify view content.
*
* @param contentToVerify the content to verify
*/
protected void verifyViewContent(final String... contentToVerify) {
for (final String content : contentToVerify) {
pageVisit.verifyPageContent(content);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final class AdminConfigurationTest extends AbstractAdminTest {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyPortalConfiguration() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_PORTAL);
verifyViewContent(AdminViewConstants.ADMIN_PORTAL_MANAGEMENT, AdminViewConstants.PORTAL_OVERVIEW,
pageVisit.verifyViewContent(AdminViewConstants.ADMIN_PORTAL_MANAGEMENT, AdminViewConstants.PORTAL_OVERVIEW,
AdminViewConstants.PORTAL_MANAGEMENT_OVERVIEW);
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_PORTAL);
}
Expand All @@ -36,7 +36,7 @@ public void verifyPortalConfiguration() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyCountryConfiguration() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_COUNTRY);
verifyViewContent(AdminViewConstants.ADMIN_COUNTRY_MANAGEMENT, AdminViewConstants.COUNTRY_OVERVIEW,
pageVisit.verifyViewContent(AdminViewConstants.ADMIN_COUNTRY_MANAGEMENT, AdminViewConstants.COUNTRY_OVERVIEW,
AdminViewConstants.COUNTRY_OVERVIEW_DESCRIPTION);
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_COUNTRY);
}
Expand All @@ -49,7 +49,7 @@ public void verifyCountryConfiguration() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyLanguageConfiguration() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_LANGUAGE);
verifyViewContent(AdminViewConstants.ADMIN_LANGUAGE_MANAGEMENT, AdminViewConstants.LANGUAGE_OVERVIEW,
pageVisit.verifyViewContent(AdminViewConstants.ADMIN_LANGUAGE_MANAGEMENT, AdminViewConstants.LANGUAGE_OVERVIEW,
AdminViewConstants.LANGUAGE_ADMINISTRATION);
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_LANGUAGE);
}
Expand All @@ -62,7 +62,7 @@ public void verifyLanguageConfiguration() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyAgencyConfiguration() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_AGENCY);
verifyViewContent(AdminViewConstants.ADMIN_AGENCY_MANAGEMENT, AdminViewConstants.AGENCY_OVERVIEW_HEADER,
pageVisit.verifyViewContent(AdminViewConstants.ADMIN_AGENCY_MANAGEMENT, AdminViewConstants.AGENCY_OVERVIEW_HEADER,
AdminViewConstants.AGENCY_OVERVIEW);
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_AGENCY);
}
Expand All @@ -75,7 +75,7 @@ public void verifyAgencyConfiguration() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyApplicationConfiguration() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_CONFIGURATION);
verifyViewContent(AdminViewConstants.ADMIN_APPLICATION_CONFIGURATION,
pageVisit.verifyViewContent(AdminViewConstants.ADMIN_APPLICATION_CONFIGURATION,
AdminViewConstants.APPLICATION_CONFIGURATION_OVERVIEW,
AdminViewConstants.APPLICATION_CONFIGURATION_OVERVIEW);
pageVisit.selectFirstGridRow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class AdminDataTest extends AbstractAdminTest {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyDataSummary() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY);
verifyViewContent(
pageVisit.verifyViewContent(
AdminViewConstants.ADMIN_DATA_SUMMARY_OVERVIEW,
AdminViewConstants.DATA_SUMMARY_OVERVIEW
);
Expand All @@ -39,7 +39,7 @@ public void verifyDataSummary() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyDataSummaryAuthor() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_AUTHOR_DATASUMMARY);
verifyViewContent(
pageVisit.verifyViewContent(
AdminViewConstants.ADMIN_AUTHOR_SUMMARY,
AdminViewConstants.AUTHOR_OVERVIEW, AdminViewConstants.AUTHOR_DETAILED_SUMMARY
);
Expand All @@ -55,7 +55,7 @@ public void verifyDataSummaryAuthor() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyApplicationEvents() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_EVENTS);
verifyViewContent(
pageVisit.verifyViewContent(
AdminViewConstants.ADMIN_APPLICATION_EVENTS, AdminViewConstants.EVENT_DETAILS,
AdminViewConstants.EVENT_REVIEW
);
Expand All @@ -70,7 +70,7 @@ public void verifyApplicationEvents() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyApplicationEventsCharts() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_EVENTS_CHARTS);
verifyViewContent(
pageVisit.verifyViewContent(
AdminViewConstants.ADMIN_APPLICATION_EVENT_CHARTS, AdminViewConstants.EVENT_ANALYSIS_HEADER, AdminViewConstants.EVENT_ANALYSIS
);
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_APPLICATION_EVENTS_CHARTS);
Expand All @@ -84,13 +84,13 @@ public void verifyApplicationEventsCharts() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyApplicationSessions() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION);
verifyViewContent(
pageVisit.verifyViewContent(
AdminViewConstants.ADMIN_APPLICATION_SESSIONS,
AdminViewConstants.SESSION_DETAILS,
AdminViewConstants.SESSION_OVERVIEW
);
pageVisit.selectFirstGridRow();
verifyViewContent(
pageVisit.verifyViewContent(
AdminViewConstants.APPLICATION_SESSION_DETAILS,
AdminViewConstants.SESSION_TYPE,
AdminViewConstants.USER_ID,
Expand All @@ -107,7 +107,7 @@ public void verifyApplicationSessions() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifySessionCharts() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION_CHARTS);
verifyViewContent(
pageVisit.verifyViewContent(
AdminViewConstants.ADMIN_APPLICATION_SESSION_CHARTS,
AdminViewConstants.SESSION_ANALYSIS
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class AdminOperationsTest extends AbstractAdminTest {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyAgentOperation() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_AGENT_OPERATION);
verifyViewContent(
pageVisit.verifyViewContent(
AdminViewConstants.ADMIN_AGENT_OPERATION_OVERVIEW,
AdminViewConstants.ADMIN_AGENT_OPERATION,
AdminViewConstants.ADMIN_AGENT_OPERATION_TASKS_OVERVIEW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final class AdminSecurityTest extends AbstractAdminTest {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifyUserAccount() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_USERACCOUNT);
verifyViewContent(AdminViewConstants.ADMIN_USER_ACCOUNT_MANAGEMENT, AdminViewConstants.USER_ACCOUNT_OVERVIEW,
pageVisit.verifyViewContent(AdminViewConstants.ADMIN_USER_ACCOUNT_MANAGEMENT, AdminViewConstants.USER_ACCOUNT_OVERVIEW,
AdminViewConstants.USER_ACCOUNT_MANAGEMENT_DESCRIPTION);
pageVisit.selectFirstGridRow();
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_USERACCOUNT);
Expand All @@ -37,7 +37,7 @@ public void verifyUserAccount() throws Exception {
@Test(timeout = DEFAULT_TIMEOUT)
public void verifySessionAccess() throws Exception {
pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION);
verifyViewContent(AdminViewConstants.ADMIN_APPLICATION_SESSIONS, AdminViewConstants.SESSION_DETAILS,
pageVisit.verifyViewContent(AdminViewConstants.ADMIN_APPLICATION_SESSIONS, AdminViewConstants.SESSION_DETAILS,
AdminViewConstants.SESSION_OVERVIEW);
pageVisit.selectFirstGridRow();
pageVisit.validatePage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,18 @@ public void visitDirectPage(final PageModeMenuCommand page) {
assertNotNull(driver.getWindowHandle());
}

/**
* Verify view content.
*
* @param contentToVerify the content to verify
*/
public void verifyViewContent(final String... contentToVerify) {
for (final String content : contentToVerify) {
verifyPageContent(content);
}
}


/**
* Visit main view.
*/
Expand Down

0 comments on commit 5e0bc4b

Please sign in to comment.