From e7b3fc34fbd6baa9e5b3c4165b00ad0c4b3c27d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Pether=20S=C3=B6rling?= Date: Fri, 17 Jan 2025 17:54:59 +0100 Subject: [PATCH] ui test refactoring (#7043) --- .devcontainer/init-postgresql.sh | 3 +- citizen-intelligence-agency/build.xml | 4 +- .../views/admin/AdminViewConstants.java | 15 + ...ionsOverviewPageModContentFactoryImpl.java | 36 +-- ...inMonitoringPageModContentFactoryImpl.java | 8 +- .../api/MenuItemAdminConstants.java | 40 +-- .../api/MenuItemCommitteeConstants.java | 26 +- .../menufactory/api/MenuItemConstants.java | 40 +-- .../api/MenuItemCountryConstants.java | 14 +- .../api/MenuItemDataConstants.java | 4 +- .../api/MenuItemDecisionConstants.java | 16 +- .../api/MenuItemDocumentConstants.java | 22 +- .../api/MenuItemGovernmentConstants.java | 18 +- .../api/MenuItemLayoutConstants.java | 14 +- .../api/MenuItemLeadershipConstants.java | 12 +- .../api/MenuItemMinistryConstants.java | 22 +- .../api/MenuItemNavigationConstants.java | 24 +- .../api/MenuItemPageVisitConstants.java | 16 +- .../api/MenuItemParliamentConstants.java | 34 +- .../api/MenuItemPartyConstants.java | 20 +- .../api/MenuItemPoliticianConstants.java | 24 +- .../api/MenuItemRiskConstants.java | 8 +- .../api/MenuItemStatisticsConstants.java | 16 +- .../api/MenuItemUserConstants.java | 28 +- .../api/PageCommandUserConstants.java | 16 +- .../common/pagemode/CardInfoRowUtil.java | 2 +- .../views/common/pagemode/LeaderCardUtil.java | 8 +- .../common/pagemode/PartyLeaderUtil.java | 4 +- .../pagemode/PoliticianLeaderboardUtil.java | 10 +- .../AbstractRoleSystemITest.java | 5 +- .../systemintegrationtest/AbstractUITest.java | 84 ++--- .../CitizenIntelligenceAgencyServer.java | 23 +- .../admin/AdminAgentTest.java | 45 ++- .../admin/AdminApplicationSystemTest.java | 97 +++--- .../admin/AdminConfigurationSystemTest.java | 49 +-- .../admin/AdminConfigurationTest.java | 39 +-- .../admin/AdminDataSummarySystemTest.java | 101 +++--- .../admin/AdminDataTest.java | 20 +- .../admin/AdminEmailTest.java | 50 ++- .../admin/AdminMonitoringSystemTest.java | 21 +- .../admin/AdminMonitoringTest.java | 14 - .../admin/AdminPageSystemTest.java | 186 +++++------ .../admin/AdminRoleSystemITest.java | 114 +++---- .../admin/AdminSystemRightsTest.java | 32 +- .../admin/AdminUserManagementSystemTest.java | 31 +- .../admin/AdminUserManagementTest.java | 124 +++---- .../admin/SessionManagementTest.java | 74 ++--- .../suites/IntegrationTestSuite.java | 23 +- .../systemintegrationtest/ui/ClickHelper.java | 27 +- .../ui/ElementHelper.java | 25 +- .../{suites => ui}/TestConstants.java | 9 +- .../systemintegrationtest/ui/TestUtils.java | 5 +- .../ui/UserPageVisit.java | 229 ++----------- .../ui/UserPageVisitHelper.java | 120 ++++++- .../ui/WebDriverFactory.java | 4 +- .../user/AuthorizationTest.java | 63 ++-- .../user/BallotViewTest.java | 19 +- .../systemintegrationtest/user/ChartTest.java | 47 ++- .../user/CommitteeViewTest.java | 22 +- .../user/DocumentViewTest.java | 21 +- .../user/MinistryViewTest.java | 25 +- .../user/PartyViewTest.java | 47 ++- .../user/PoliticianViewTest.java | 23 +- .../user/SearchViewTest.java | 20 +- .../user/UserAuthenticationTest.java | 302 ++++++++---------- .../user/UserNavigationTest.java | 191 +++++------ .../user/UserRoleSystemITest.java | 69 ++-- .../user/ViewNavigationTest.java | 115 +++---- .../user/ViewPageTest.java | 56 ++-- .../user/ViewRankingTest.java | 17 +- .../src/test/resources/logback-test.xml | 55 ++-- .../src/test/resources/logback-test.xml | 3 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- parent-pom/pom.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- 101 files changed, 1432 insertions(+), 1776 deletions(-) delete mode 100644 citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringTest.java rename citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/{suites => ui}/TestConstants.java (73%) diff --git a/.devcontainer/init-postgresql.sh b/.devcontainer/init-postgresql.sh index 06797a2a0a3..8a22e8b99b2 100644 --- a/.devcontainer/init-postgresql.sh +++ b/.devcontainer/init-postgresql.sh @@ -35,6 +35,7 @@ export NVM_DIR="" su - postgres -c "psql -c 'CREATE USER eris WITH password '\''discord'\'';'" su - postgres -c "psql -c 'CREATE DATABASE cia_dev;'" su - postgres -c "psql -c 'GRANT ALL PRIVILEGES ON DATABASE cia_dev to eris;'" +su - postgres -c "psql -c 'ALTER USER eris WITH SUPERUSER;'" su - postgres -c "psql -d cia_dev -c 'GRANT ALL ON SCHEMA public TO eris;'" su - postgres -c "psql -d cia_dev -c 'ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO eris;'" su - postgres -c "psql -d cia_dev -c 'ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO eris;'" @@ -100,7 +101,7 @@ echo "ssl = on" >> /etc/postgresql/16/main/postgresql.conf echo "ssl_cert_file = '/var/lib/postgresql/16/main/server.crt'" >> /etc/postgresql/16/main/postgresql.conf echo "ssl_key_file = '/var/lib/postgresql/16/main/server.key'" >> /etc/postgresql/16/main/postgresql.conf echo "max_prepared_transactions = 100" >> /etc/postgresql/16/main/postgresql.conf -echo "shared_preload_libraries = 'pg_stat_statements, pgaudit, pgcrypto'" >> /etc/postgresql/16/main/postgresql.conf +echo "shared_preload_libraries = 'pg_stat_statements, pgaudit, pgcrypto, pgml'" >> /etc/postgresql/16/main/postgresql.conf echo "pgaudit.log = ddl" >> /etc/postgresql/16/main/postgresql.conf echo "pg_stat_statements.track = all" >> /etc/postgresql/16/main/postgresql.conf echo "pg_stat_statements.max = 10000" >> /etc/postgresql/16/main/postgresql.conf diff --git a/citizen-intelligence-agency/build.xml b/citizen-intelligence-agency/build.xml index cb8af35a9f9..d92d82f9068 100644 --- a/citizen-intelligence-agency/build.xml +++ b/citizen-intelligence-agency/build.xml @@ -126,7 +126,7 @@ + line="clean install site -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" /> @@ -220,4 +220,4 @@ - \ No newline at end of file + diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/AdminViewConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/AdminViewConstants.java index 503577de861..dd54c00324e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/AdminViewConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/AdminViewConstants.java @@ -242,4 +242,19 @@ public final class AdminViewConstants { /** The Constant EMAIL_OVERVIEW. */ public static final String EMAIL_OVERVIEW = "Email Overview"; + /** The Constant ADMIN_MONITORING. */ + public static final String ADMIN_MONITORING = "Admin Monitoring"; + + /** The Constant MONITORING_CONTEXT_PATH. */ + public static final String MONITORING_CONTEXT_PATH = "./monitoring"; + + /** The Constant ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON. */ + public static final String ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON = "Deploy Agents:Sweden"; + + /** The Constant ADMIN_AGENT_OPERATION_DEPLOY_WORLD_BUTTON. */ + public static final String ADMIN_AGENT_OPERATION_DEPLOY_WORLD_BUTTON = "Deploy Agents:World"; + + public static final String ADMIN_AGENT_OPERATION_DEPLOY_DESC = "Gathering osint"; + + } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/agentoperations/pagemode/AgentOperationsOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/agentoperations/pagemode/AgentOperationsOverviewPageModContentFactoryImpl.java index 3813ef4af22..8aab75bb6bf 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/agentoperations/pagemode/AgentOperationsOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/agentoperations/pagemode/AgentOperationsOverviewPageModContentFactoryImpl.java @@ -18,8 +18,6 @@ */ package com.hack23.cia.web.impl.ui.application.views.admin.agentoperations.pagemode; -import java.text.MessageFormat; - import org.springframework.security.access.annotation.Secured; import org.springframework.stereotype.Component; @@ -49,21 +47,12 @@ public final class AgentOperationsOverviewPageModContentFactoryImpl extends AbstractAgentOperationsPageModContentFactoryImpl { - /** The Constant BUTTON_ID_PATTERN. */ - private static final String BUTTON_ID_PATTERN = "{0}.{1}.{2}"; - - /** The Constant BUTTON_PATTERN. */ - private static final String BUTTON_PATTERN = "Start {0} {1}"; - /** The Constant NAME. */ public static final String NAME = AdminViews.ADMIN_AGENT_OPERATIONVIEW_NAME; - /** The Constant WILL_FETCH_DATA_FROM_SOURCE. */ - private static final String WILL_FETCH_DATA_FROM_SOURCE = "Will fetch data from source"; /** - * Instantiates a new agent operations overview page mod content factory - * impl. + * Instantiates a new agent operations overview page mod content factory impl. */ public AgentOperationsOverviewPageModContentFactoryImpl() { super(); @@ -76,7 +65,8 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - CardInfoRowUtil.createPageHeader(panel, content, AdminViewConstants.ADMIN_AGENT_OPERATION_OVERVIEW, AdminViewConstants.ADMIN_AGENT_OPERATION, AdminViewConstants.ADMIN_AGENT_OPERATION_TASKS_OVERVIEW); + CardInfoRowUtil.createPageHeader(panel, content, AdminViewConstants.ADMIN_AGENT_OPERATION_OVERVIEW, + AdminViewConstants.ADMIN_AGENT_OPERATION, AdminViewConstants.ADMIN_AGENT_OPERATION_TASKS_OVERVIEW); final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); @@ -91,16 +81,20 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout); - for (final DataAgentTarget dataAgentTarget : DataAgentTarget.values()) { - final Button importDataButton = new Button(MessageFormat.format(BUTTON_PATTERN, DataAgentOperation.IMPORT, dataAgentTarget) , VaadinIcons.BULLSEYE); - importDataButton.addClickListener(new StartAgentClickListener(dataAgentTarget, DataAgentOperation.IMPORT)); - importDataButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, DataAgentOperation.IMPORT, dataAgentTarget)); - RowUtil.createRowItem(grid, importDataButton, WILL_FETCH_DATA_FROM_SOURCE); - } + final Button deployAgentSwedenButton = new Button(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON, VaadinIcons.BULLSEYE); + deployAgentSwedenButton.addClickListener( + new StartAgentClickListener(DataAgentTarget.MODEL_EXTERNAL_RIKSDAGEN, DataAgentOperation.IMPORT)); + deployAgentSwedenButton.setId(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON); + RowUtil.createRowItem(grid, deployAgentSwedenButton, AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_DESC); + final Button deployAgentWorldButton = new Button(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_WORLD_BUTTON, VaadinIcons.BULLSEYE); + deployAgentWorldButton.addClickListener( + new StartAgentClickListener(DataAgentTarget.MODEL_EXTERNAL_WORLDBANK, DataAgentOperation.IMPORT)); + deployAgentWorldButton.setId(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_WORLD_BUTTON); + RowUtil.createRowItem(grid, deployAgentWorldButton, AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_DESC); final String pageId = getPageId(parameters); - getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, ApplicationEventGroup.ADMIN, - NAME, null, pageId); + getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, + ApplicationEventGroup.ADMIN, NAME, null, pageId); return content; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminMonitoringPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminMonitoringPageModContentFactoryImpl.java index ef1ff7573bd..13aa130b928 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminMonitoringPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/pagemode/AdminMonitoringPageModContentFactoryImpl.java @@ -23,6 +23,7 @@ import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup; import com.hack23.cia.web.impl.ui.application.action.ViewAction; +import com.hack23.cia.web.impl.ui.application.views.admin.AdminViewConstants; import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.vaadin.server.ExternalResource; @@ -38,11 +39,6 @@ @Component public final class AdminMonitoringPageModContentFactoryImpl extends AbstractAdminSystemPageModContentFactoryImpl { - /** The Constant ADMIN_MONITORING. */ - private static final String ADMIN_MONITORING = "Admin Monitoring"; - - /** The Constant MONITORING_CONTEXT_PATH. */ - private static final String MONITORING_CONTEXT_PATH = "./monitoring"; /** The Constant NAME. */ public static final String NAME = AdminViews.ADMIN_MONITORING_VIEW_NAME; @@ -64,7 +60,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getMenuItemFactory().createMainPageMenuBar(menuBar); - final BrowserFrame browser = new BrowserFrame(ADMIN_MONITORING, new ExternalResource(MONITORING_CONTEXT_PATH)); + final BrowserFrame browser = new BrowserFrame(AdminViewConstants.ADMIN_MONITORING, new ExternalResource(AdminViewConstants.MONITORING_CONTEXT_PATH)); browser.setSizeFull(); content.addComponent(browser); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemAdminConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemAdminConstants.java index 5cd2322b4aa..c38b24e3ec2 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemAdminConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemAdminConstants.java @@ -4,59 +4,59 @@ * The Interface MenuItemAdminConstants. */ public interface MenuItemAdminConstants { - + /** The admin text. */ String ADMIN_TEXT = "Admin"; - + /** The agency. */ String AGENCY = "Agency"; - + /** The agent operations text. */ String AGENT_OPERATIONS_TEXT = "Agent operations"; - + /** The application. */ String APPLICATION = "Application"; - + /** The application configuration. */ String APPLICATION_CONFIGURATION = "System settings"; - + /** The application event. */ String APPLICATION_EVENT = "Application Event"; - + /** The application event charts. */ String APPLICATION_EVENT_CHARTS = "Application Event charts"; - + /** The application session. */ String APPLICATION_SESSION = "Application Session"; - + /** The application session charts. */ String APPLICATION_SESSION_CHARTS = "Active Daily Users"; - + /** The system performance. */ String SYSTEM_PERFORMANCE = "System Performance"; - + /** The management. */ String MANAGEMENT = "Management"; - + /** The configuration. */ String CONFIGURATION = "Configuration"; - + /** The portal. */ String PORTAL = "Portal"; - + /** The email. */ String EMAIL = "Email"; - + /** The language. */ String LANGUAGE = "Language"; - + /** The Constant DATA_AUTHOR_SUMMARY. */ String DATA_AUTHOR_SUMMARY = "Data author summary"; - + /** The Constant DATA_SUMMARY_TEXT. */ String DATA_SUMMARY_TEXT = "Data Summary"; - - - + + + } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemCommitteeConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemCommitteeConstants.java index 028f5109150..624670ec495 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemCommitteeConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemCommitteeConstants.java @@ -4,47 +4,47 @@ * Constants for committee-related menu items. */ public interface MenuItemCommitteeConstants { - + /** The committee ranking text. */ // Base committee labels String COMMITTEE_RANKING_TEXT = "Committee Ranking"; - + /** The committee roles. */ String COMMITTEE_ROLES = "Committee Roles"; - + /** The committees link text. */ String COMMITTEES_LINK_TEXT = "Committees"; - + /** The committee ranking description. */ // Committee descriptions String COMMITTEE_RANKING_DESCRIPTION = "Committees: shaping policy debates."; - + /** The committees description. */ String COMMITTEES_DESCRIPTION = "All committees: roles and responsibilities."; - + /** The committee roles description. */ String COMMITTEE_ROLES_DESCRIPTION = "Committee roles description"; - + /** The page visit history description. */ String PAGE_VISIT_HISTORY_DESCRIPTION = "View history of page visit for this page."; - + /** The documents text. */ // Document and ballot related String DOCUMENTS_TEXT = "Documents"; - + /** The ballots text. */ String BALLOTS_TEXT = "Ballots"; - + /** The ballot decision summary text. */ String BALLOT_DECISION_SUMMARY_TEXT = "Ballot Decision Summary"; - + /** The current committees text. */ // Other committee constants String CURRENT_COMMITTEES_TEXT = "Current Committees"; - + /** The committee history text. */ String COMMITTEE_HISTORY_TEXT = "Committee History"; - + /** The committee details text. */ String COMMITTEE_DETAILS_TEXT = "Committee Details"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemConstants.java index 2e6d0f1f114..20c5511ccff 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemConstants.java @@ -3,7 +3,7 @@ /** * The Interface MenuItemConstants. */ -public interface MenuItemConstants extends +public interface MenuItemConstants extends MenuItemLayoutConstants, MenuItemPartyConstants, MenuItemUserConstants, @@ -22,71 +22,71 @@ public interface MenuItemConstants extends MenuItemParliamentConstants, MenuItemRiskConstants, MenuItemPageVisitConstants { - + /** The dashboard. */ // Core navigation constants String DASHBOARD = "Dashboard"; - + /** The main. */ String MAIN = "Main"; - + /** The start text. */ String START_TEXT = "Start"; - + /** The overview text. */ String OVERVIEW_TEXT = "Overview"; - + /** The ranking text. */ String RANKING_TEXT = "Ranking"; - + /** The by topic. */ String BY_TOPIC = "By Topic"; - + /** The list all. */ String LIST_ALL = "List All"; /** The login. */ // Security related constants String LOGIN = "Login"; - + /** The logout. */ String LOGOUT = "Logout"; - + /** The register. */ String REGISTER = "Register"; - + /** The role admin. */ String ROLE_ADMIN = "ROLE_ADMIN"; - + /** The role user. */ String ROLE_USER = "ROLE_USER"; /** The user home. */ // UserHomeMenuItemFactoryImpl constants String USER_HOME = "User Home"; - + /** The user profile. */ String USER_PROFILE = "User Profile"; - + /** The user settings. */ String USER_SETTINGS = "User Settings"; - + /** The user logout. */ String USER_LOGOUT = "User Logout"; - + /** The user home description. */ String USER_HOME_DESCRIPTION = "Navigate to user home page"; - + /** The user profile description. */ String USER_PROFILE_DESCRIPTION = "View and edit user profile"; - + /** The user settings description. */ String USER_SETTINGS_DESCRIPTION = "Adjust user settings"; - + /** The user logout description. */ String USER_LOGOUT_DESCRIPTION = "Logout from the application"; - + /** The Constant MANAGEMENT. */ String MANAGEMENT = "Management"; diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemCountryConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemCountryConstants.java index d2a3a4ea8d1..5fbbfc4a3e4 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemCountryConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemCountryConstants.java @@ -4,25 +4,25 @@ * The Interface MenuItemCountryConstants. */ public interface MenuItemCountryConstants { - + /** The country. */ String COUNTRY = "Country"; - + /** The country ranking text. */ String COUNTRY_RANKING_TEXT = "Country Ranking"; - + /** The country overview text. */ String COUNTRY_OVERVIEW_TEXT = "Country Overview"; - + /** The country indicators sweden. */ String COUNTRY_INDICATORS_SWEDEN = "Country Indicators Sweden"; - + /** The country ranking link text. */ String COUNTRY_RANKING_LINK_TEXT = "Country Ranking"; - + /** The country ranking description. */ String COUNTRY_RANKING_DESCRIPTION = "Sweden's governance: key indicators."; - + /** The sweden dashboard. */ String SWEDEN_DASHBOARD = "Sweden Dashboard"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDataConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDataConstants.java index a3245bdb9e3..8e2dd659c2e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDataConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDataConstants.java @@ -4,10 +4,10 @@ * The Interface MenuItemDataConstants. */ public interface MenuItemDataConstants { - + /** The data points for year above. */ int DATA_POINTS_FOR_YEAR_ABOVE = 2000; - + /** The minimum number data points. */ int MINIMUM_NUMBER_DATA_POINTS = 10; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDecisionConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDecisionConstants.java index 7ba605b4be4..be57c2fbb59 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDecisionConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDecisionConstants.java @@ -4,31 +4,31 @@ * The Interface MenuItemDecisionConstants. */ public interface MenuItemDecisionConstants { - + /** The decision flow. */ String DECISION_FLOW = "Decision Flow"; - + /** The decision activity by type. */ String DECISION_ACTIVITY_BY_TYPE = "Decision Activity by Type"; - + /** The decision activity description. */ String DECISION_ACTIVITY_DESCRIPTION = "Decision activity description"; - + /** The decision flow description. */ String DECISION_FLOW_DESCRIPTION = "Decision flow description"; /** The decision summary text. */ String DECISION_SUMMARY_TEXT = "Decision Summary"; - + /** The decision summary description. */ String DECISION_SUMMARY_DESCRIPTION = "Decision summary description"; - + /** The decision type daily summary text. */ String DECISION_TYPE_DAILY_SUMMARY_TEXT = "Decision Type Daily Summary"; - + /** The decision type daily summary description. */ String DECISION_TYPE_DAILY_SUMMARY_DESCRIPTION = "Decision type daily summary description"; - + /** The ballot decision summary description. */ String BALLOT_DECISION_SUMMARY_DESCRIPTION = "Ballot decision summary description"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDocumentConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDocumentConstants.java index a8cc34e1686..8e5a4428ba6 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDocumentConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemDocumentConstants.java @@ -4,37 +4,37 @@ * The Interface MenuItemDocumentConstants. */ public interface MenuItemDocumentConstants { - + /** The document. */ String DOCUMENT = "Document"; - + /** The documents. */ String DOCUMENTS = "Documents"; - + /** The document details. */ String DOCUMENT_DETAILS = "Document Details"; - + /** The document data. */ String DOCUMENT_DATA = "Document Data"; - + /** The document references. */ String DOCUMENT_REFERENCES = "Document References"; - + /** The document decision. */ String DOCUMENT_DECISION = "Document Decision"; - + /** The document attachements. */ String DOCUMENT_ATTACHEMENTS = "Document Attachments"; - + /** The document overview text. */ String DOCUMENT_OVERVIEW_TEXT = "Document Overview"; - + /** The document activity text. */ String DOCUMENT_ACTIVITY_TEXT = "Document Activity"; - + /** The document history text. */ String DOCUMENT_HISTORY_TEXT = "Document History"; - + /** The documents description. */ String DOCUMENTS_DESCRIPTION = "All documents: official records."; // ...add other document-related constants... diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemGovernmentConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemGovernmentConstants.java index 3c2605887e5..015a8796b3b 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemGovernmentConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemGovernmentConstants.java @@ -4,31 +4,31 @@ * The Interface MenuItemGovernmentConstants. */ public interface MenuItemGovernmentConstants { - + /** The government body ranking. */ String GOVERNMENT_BODY_RANKING = "Government body Ranking"; - + /** The government bodies. */ String GOVERNMENT_BODIES = "Government bodies"; - + /** The government outcome. */ String GOVERNMENT_OUTCOME = "Government Outcome"; - + /** The government roles chart. */ String GOVERNMENT_ROLES_CHART = "Government Roles Chart"; - + /** The government body overview text. */ String GOVERNMENT_BODY_OVERVIEW_TEXT = "Government Body Overview"; - + /** The government body ranking description. */ String GOVERNMENT_BODY_RANKING_DESCRIPTION = "Government bodies: performance snapshots."; - + /** The government bodies description. */ String GOVERNMENT_BODIES_DESCRIPTION = "All bodies: structure and influence."; - + /** The government outcome description. */ String GOVERNMENT_OUTCOME_DESCRIPTION = "Government outcome description"; - + /** The government roles chart description. */ String GOVERNMENT_ROLES_CHART_DESCRIPTION = "Government roles chart description"; // ...add other government-related constants... diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemLayoutConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemLayoutConstants.java index 581dc6a79bc..f57d32c88d4 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemLayoutConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemLayoutConstants.java @@ -4,25 +4,25 @@ * The Interface MenuItemLayoutConstants. */ public interface MenuItemLayoutConstants { - + /** The display size lg device. */ int DISPLAY_SIZE_LG_DEVICE = 4; - + /** The display size md device. */ int DISPLAY_SIZE_MD_DEVICE = 4; - + /** The display size xs device. */ int DISPLAY_SIZE_XS_DEVICE = 12; - + /** The displays size xm device. */ int DISPLAYS_SIZE_XM_DEVICE = 6; - + /** The menu bar width. */ String MENU_BAR_WIDTH = "80%"; - + /** The header style name. */ String HEADER_STYLE_NAME = "Header"; - + /** The link style name. */ String LINK_STYLE_NAME = "link"; diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemLeadershipConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemLeadershipConstants.java index 39222bc94a2..eee9ac9cef1 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemLeadershipConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemLeadershipConstants.java @@ -4,22 +4,22 @@ * The Interface MenuItemLeadershipConstants. */ public interface MenuItemLeadershipConstants { - + /** The current leaders. */ String CURRENT_LEADERS = "Current Leaders"; - + /** The current leaders description. */ String CURRENT_LEADERS_DESCRIPTION = "Current leaders description"; - + /** The leader history. */ String LEADER_HISTORY = "Leader History"; - + /** The leader history description. */ String LEADER_HISTORY_DESCRIPTION = "Leader history description"; - + /** The desc leaders scoreboard. */ String DESC_LEADERS_SCOREBOARD = "Leaders: comparing party leadership impact."; - + /** The part leaders scoreboard. */ String PART_LEADERS_SCOREBOARD = "Party leaders scoreboard"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemMinistryConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemMinistryConstants.java index 28dc5df7920..0d913c9797c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemMinistryConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemMinistryConstants.java @@ -4,37 +4,37 @@ * The Interface MenuItemMinistryConstants. */ public interface MenuItemMinistryConstants { - + /** The ministries link text. */ String MINISTRIES_LINK_TEXT = "Ministries"; - + /** The ministry ranking. */ String MINISTRY_RANKING = "Ministry Ranking"; - + /** The ministry ranking link text. */ String MINISTRY_RANKING_LINK_TEXT = MINISTRY_RANKING; - + /** The ministry ranking description. */ String MINISTRY_RANKING_DESCRIPTION = "Ministry influence on policy."; - + /** The ministries description. */ String MINISTRIES_DESCRIPTION = "All ministries: roles and commitments."; - + /** The ministry document activity text. */ String MINISTRY_DOCUMENT_ACTIVITY_TEXT = "Document Activity"; - + /** The ministry overview text. */ String MINISTRY_OVERVIEW_TEXT = "Overview"; - + /** The ministries leader scoreboard. */ String MINISTRIES_LEADER_SCOREBOARD = "Government Ministers Scoreboard"; - + /** The ministries leader scoreboard description. */ String MINISTRIES_LEADER_SCOREBOARD_DESCRIPTION = "Cabinet leaders: power and institutional impact."; - + /** The current ministries current members text. */ String CURRENT_MINISTRIES_CURRENT_MEMBERS_TEXT = "Current Ministries, Current Members"; - + /** The all ministries total members. */ String ALL_MINISTRIES_TOTAL_MEMBERS = "All Ministries, Total Members"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemNavigationConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemNavigationConstants.java index 29920bf56af..fdffd77db3a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemNavigationConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemNavigationConstants.java @@ -4,41 +4,41 @@ * Core navigation constants. */ public interface MenuItemNavigationConstants { - + /** The dashboard. */ String DASHBOARD = "Dashboard"; - + /** The main. */ String MAIN = "Main"; - + /** The start text. */ String START_TEXT = "Start"; - + /** The overview text. */ String OVERVIEW_TEXT = "Overview"; - + /** The ranking text. */ String RANKING_TEXT = "Ranking"; - + /** The by topic. */ String BY_TOPIC = "By Topic"; - + /** The list all. */ String LIST_ALL = "List All"; - + /** The login. */ // Security related String LOGIN = "Login"; - + /** The logout. */ String LOGOUT = "Logout"; - + /** The register. */ String REGISTER = "Register"; - + /** The role admin. */ String ROLE_ADMIN = "ROLE_ADMIN"; - + /** The role user. */ String ROLE_USER = "ROLE_USER"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPageVisitConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPageVisitConstants.java index 79a7fd73a6f..a383610e439 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPageVisitConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPageVisitConstants.java @@ -4,33 +4,33 @@ * Constants for page visit history related menu items. */ public interface MenuItemPageVisitConstants { - + /** The page visit history text. */ String PAGE_VISIT_HISTORY_TEXT = "Page Visit History"; - + /** The desc page visit history. */ String DESC_PAGE_VISIT_HISTORY = "Visit history: tracking public engagement patterns."; - + /** The ministry page visit history text. */ // Ministry related String MINISTRY_PAGE_VISIT_HISTORY_TEXT = "Page Visit History"; - + /** The ministry page visit history description. */ String MINISTRY_PAGE_VISIT_HISTORY_DESCRIPTION = "View history of page visit for this page."; - + /** The document page visit history text. */ // Document related String DOCUMENT_PAGE_VISIT_HISTORY_TEXT = "Document Page Visit History"; - + /** The country page visit history text. */ // Country related String COUNTRY_PAGE_VISIT_HISTORY_TEXT = "Country Page Visit History"; - + /** The government body page visit history text. */ // Government Body related String GOVERNMENT_BODY_PAGE_VISIT_HISTORY_TEXT = "Government Body Page Visit History"; - + /** The government body page visit history description. */ String GOVERNMENT_BODY_PAGE_VISIT_HISTORY_DESCRIPTION = "Government body page visit history description"; } \ No newline at end of file diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemParliamentConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemParliamentConstants.java index 26fc091c817..68d2772dc37 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemParliamentConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemParliamentConstants.java @@ -4,56 +4,56 @@ * The Interface MenuItemParliamentConstants. */ public interface MenuItemParliamentConstants { - + /** The parliament ranking text. */ String PARLIAMENT_RANKING_TEXT = "Parliament Ranking"; - + /** The parliament ranking link text. */ String PARLIAMENT_RANKING_LINK_TEXT = "Parliament Ranking"; - + /** The parliament ranking description. */ String PARLIAMENT_RANKING_DESCRIPTION = "Parliament: legislative effectiveness."; - + /** The swedish parliament indicators. */ String SWEDISH_PARLIAMENT_INDICATORS = "Swedish Parliament Indicators"; - + /** The ministry document activity text. */ String MINISTRY_DOCUMENT_ACTIVITY_TEXT = "Document Activity"; /** The ministry overview text. */ String MINISTRY_OVERVIEW_TEXT = "Overview"; - + /** The all parties total days served in parliament. */ // Label constants String ALL_PARTIES_TOTAL_DAYS_SERVED_IN_PARLIAMENT = "All parties total days served in parliament"; - + /** The current parties active in committees head count. */ String CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_HEAD_COUNT = "Current parties in committees"; - + /** The current parties active in ministries head count text. */ String CURRENT_PARTIES_ACTIVE_IN_MINISTRIES_HEAD_COUNT_TEXT = "Current parties in government"; - + /** The current parties active in parliament head count. */ String CURRENT_PARTIES_ACTIVE_IN_PARLIAMENT_HEAD_COUNT = "Current parties in parliament"; - + /** The party by total members based on roles in departments committees and parliament. */ String PARTY_BY_TOTAL_MEMBERS_BASED_ON_ROLES_IN_DEPARTMENTS_COMMITTEES_AND_PARLIAMENT = "Party by total members across EU/gov/committees/parliament"; - + /** The desc all parties roles. */ // Political analyst perspective descriptions (~50 chars) String DESC_ALL_PARTIES_ROLES = "All parties: influence across key institutions."; - + /** The desc government headcount. */ String DESC_GOVERNMENT_HEADCOUNT = "Governing parties: evaluating institutional strength."; - + /** The desc committees headcount. */ String DESC_COMMITTEES_HEADCOUNT = "Committees: parties' agenda-setting influence."; - + /** The desc parliament headcount. */ String DESC_PARLIAMENT_HEADCOUNT = "Parliament: mapping party legislative leverage."; - + /** The desc days served parliament. */ String DESC_DAYS_SERVED_PARLIAMENT = "All parties: experience shaping policy timelines."; - - + + } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPartyConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPartyConstants.java index 109bd16bafe..e04fe780cc7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPartyConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPartyConstants.java @@ -4,36 +4,36 @@ * The Interface MenuItemPartyConstants. */ public interface MenuItemPartyConstants { - + /** The party won daily summary chart. */ String PARTY_WON_DAILY_SUMMARY_CHART = "Party Won Daily Summary Chart"; - + /** The party winner. */ String PARTY_WINNER = "Party Winner"; - + /** The party gender. */ String PARTY_GENDER = "Party Gender"; - + /** The party age. */ String PARTY_AGE = "Party Age"; - + /** The party ranking. */ String PARTY_RANKING = "Party Ranking"; - + /** The party ranking link text. */ String PARTY_RANKING_LINK_TEXT = PARTY_RANKING; - + /** The parties link text. */ String PARTIES_LINK_TEXT = "Parties"; - + /** The party ranking description. */ String PARTY_RANKING_DESCRIPTION = "Parties: influence on agenda."; - + /** The parties description. */ String PARTIES_DESCRIPTION = "All parties: leadership and policy roles."; // String constants - + /** The Constant ROLE_CHART_PARTY_LEADERS. */ String ROLE_CHART_PARTY_LEADERS = "Role chart, party leaders"; diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPoliticianConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPoliticianConstants.java index f1992759dde..7edda39217c 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPoliticianConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemPoliticianConstants.java @@ -4,40 +4,40 @@ * Constants related to politicians in the menu system. */ public interface MenuItemPoliticianConstants { - + /** The politician ranking. */ String POLITICIAN_RANKING = "Politician Ranking"; - + /** The politician ranking link text. */ String POLITICIAN_RANKING_LINK_TEXT = POLITICIAN_RANKING; - + /** The politicians link text. */ String POLITICIANS_LINK_TEXT = "Politicians"; - + /** The politician ranking description. */ String POLITICIAN_RANKING_DESCRIPTION = "Politicians: individual impact."; - + /** The politicians description. */ String POLITICIANS_DESCRIPTION = "All politicians: service and contributions."; - + /** The current members text. */ String CURRENT_MEMBERS_TEXT = "Current Members"; - + /** The member history text. */ String MEMBER_HISTORY_TEXT = "Member History"; - + /** The current members description. */ String CURRENT_MEMBERS_DESCRIPTION = "Current members description"; - + /** The member history description. */ String MEMBER_HISTORY_DESCRIPTION = "Member history description"; - + /** The roles text. */ String ROLES_TEXT = "Roles"; - + /** The role ghant text. */ String ROLE_GHANT_TEXT = "Role Ghant"; - + /** The role ghant description. */ String ROLE_GHANT_DESCRIPTION = "Role ghant description"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemRiskConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemRiskConstants.java index ec7b00ea61c..0870f8b3e97 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemRiskConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemRiskConstants.java @@ -4,16 +4,16 @@ * The Interface MenuItemRiskConstants. */ public interface MenuItemRiskConstants { - + /** The risk summary. */ String RISK_SUMMARY = "Risk Summary"; - + /** The risk summary description. */ String RISK_SUMMARY_DESCRIPTION = "Risk summary description"; - + /** The rule violations. */ String RULE_VIOLATIONS = "Rule Violations"; - + /** The rule violations description. */ String RULE_VIOLATIONS_DESCRIPTION = "Rule violations description"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemStatisticsConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemStatisticsConstants.java index f814f9357fc..5784cfcd750 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemStatisticsConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemStatisticsConstants.java @@ -4,28 +4,28 @@ * The Interface MenuItemStatisticsConstants. */ public interface MenuItemStatisticsConstants { - + /** The headcount. */ String HEADCOUNT = "Headcount"; - + /** The headcount chart. */ String HEADCOUNT_CHART = "Headcount Chart"; - + /** The headcount description. */ String HEADCOUNT_DESCRIPTION = "Headcount description"; - + /** The income. */ String INCOME = "Income"; - + /** The income description. */ String INCOME_DESCRIPTION = "Income description"; - + /** The expenditure. */ String EXPENDITURE = "Expenditure"; - + /** The expenditure description. */ String EXPENDITURE_DESCRIPTION = "Expenditure description"; - + /** The total members. */ String TOTAL_MEMBERS = "Total members"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemUserConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemUserConstants.java index 7fc3fd3c754..a9aafc616e9 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemUserConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemUserConstants.java @@ -4,46 +4,46 @@ * The Interface MenuItemUserConstants. */ public interface MenuItemUserConstants { - + /** The user home. */ String USER_HOME = "User Home"; - + /** The user profile. */ String USER_PROFILE = "User Profile"; - + /** The user settings. */ String USER_SETTINGS = "User Settings"; - + /** The user logout. */ String USER_LOGOUT = "User Logout"; - + /** The user home description. */ String USER_HOME_DESCRIPTION = "Navigate to user home page"; - + /** The user profile description. */ String USER_PROFILE_DESCRIPTION = "View and edit user profile"; - + /** The user settings description. */ String USER_SETTINGS_DESCRIPTION = "Adjust user settings"; - + /** The user logout description. */ String USER_LOGOUT_DESCRIPTION = "Logout from the application"; - + /** The user visits. */ String USER_VISITS = "User Visits"; - + /** The user events. */ String USER_EVENTS = "User Events"; - + /** The user visits description. */ String USER_VISITS_DESCRIPTION = "View user visit history"; - + /** The user events description. */ String USER_EVENTS_DESCRIPTION = "View user event history"; - + /** The useraccount. */ String USERACCOUNT = "Useraccount"; - + /** The userhome. */ String USERHOME = "Userhome"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/PageCommandUserConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/PageCommandUserConstants.java index 4a0b570033e..9441a9ec668 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/PageCommandUserConstants.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/PageCommandUserConstants.java @@ -18,17 +18,17 @@ public interface PageCommandUserConstants extends PageCommandAdminConstants { // Page mode commands PageModeMenuCommand COMMAND_CHARTS_ALL_PARTIES = new PageModeMenuCommand( UserViews.PARTY_RANKING_VIEW_NAME, PageMode.CHARTS, ChartIndicators.ALLPARTIES.toString()); - + /** The command charts current committees. */ PageModeMenuCommand COMMAND_CHARTS_CURRENT_COMMITTEES = new PageModeMenuCommand( UserViews.PARTY_RANKING_VIEW_NAME, PageMode.CHARTS, ChartIndicators.CURRENTCOMMITTEES.toString()); - + /** The command charts current government parties. */ PageModeMenuCommand COMMAND_CHARTS_CURRENT_GOVERNMENT_PARTIES = new PageModeMenuCommand( UserViews.PARTY_RANKING_VIEW_NAME, PageMode.CHARTS, ChartIndicators.CURRENTGOVERMENTPARTIES.toString()); - + /** The command charts current parties. */ PageModeMenuCommand COMMAND_CHARTS_CURRENT_PARTIES = new PageModeMenuCommand( UserViews.PARTY_RANKING_VIEW_NAME, PageMode.CHARTS, ChartIndicators.CURRENTPARTIES.toString()); @@ -39,27 +39,27 @@ public interface PageCommandUserConstants extends PageCommandAdminConstants { PageModeMenuCommand GOVERNMENT_BODY_COMMAN_OVERVIEW = new PageModeMenuCommand( UserViews.GOVERNMENT_BODY_RANKING_VIEW_NAME, PageMode.OVERVIEW); - + /** The government body command datagrid. */ PageModeMenuCommand GOVERNMENT_BODY_COMMAND_DATAGRID = new PageModeMenuCommand( UserViews.GOVERNMENT_BODY_RANKING_VIEW_NAME, PageMode.DATAGRID); - + /** The government body command expenditure. */ PageModeMenuCommand GOVERNMENT_BODY_COMMAND_EXPENDITURE = new PageModeMenuCommand( UserViews.GOVERNMENT_BODY_RANKING_VIEW_NAME, GovernmentBodyPageMode.EXPENDITURE.toString()); - + /** The government body command headcount. */ PageModeMenuCommand GOVERNMENT_BODY_COMMAND_HEADCOUNT = new PageModeMenuCommand( UserViews.GOVERNMENT_BODY_RANKING_VIEW_NAME, GovernmentBodyPageMode.HEADCOUNT.toString()); - + /** The government body command income. */ PageModeMenuCommand GOVERNMENT_BODY_COMMAND_INCOME = new PageModeMenuCommand( UserViews.GOVERNMENT_BODY_RANKING_VIEW_NAME, GovernmentBodyPageMode.INCOME.toString()); - + /** The government body min command pagevisithistory. */ PageModeMenuCommand GOVERNMENT_BODY_MIN_COMMAND_PAGEVISITHISTORY = new PageModeMenuCommand( UserViews.GOVERNMENT_BODY_RANKING_VIEW_NAME, diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/CardInfoRowUtil.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/CardInfoRowUtil.java index e193791b912..93e3200fc1d 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/CardInfoRowUtil.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/CardInfoRowUtil.java @@ -204,7 +204,7 @@ public static final VerticalLayout createStatsContainer() { public static final class LayoutConstants { public static final String CARD_TENURE = "card-tenure"; public static final String CARD_EXPERIENCE = "card-experience-section"; - public static final String CARD_INFO_VALUE = "card-info-value"; + public static final String CARD_INFO_VALUE = "card-info-value"; public static final String CARD_INFO_ICON = "card-info-icon"; public static final String METRIC_LABEL = "metric-label"; } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/LeaderCardUtil.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/LeaderCardUtil.java index eb2956dec8e..4693b98c595 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/LeaderCardUtil.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/LeaderCardUtil.java @@ -96,17 +96,17 @@ private VerticalLayout createCardContent() { private void addExperienceRow(VerticalLayout container, int govYears, int partyYears, int parliamentYears) { final HorizontalLayout experienceLayout = CardInfoRowUtil.createStandardRow(); experienceLayout.addStyleName(CardInfoRowUtil.LayoutConstants.CARD_EXPERIENCE); - + final Label expIcon = CardInfoRowUtil.createIconLabel(VaadinIcons.USER_CHECK, "Political Experience"); final Label expLabel = new Label("Experience:"); expLabel.addStyleName("card-experience-text"); - - final String expText = String.format(Locale.ENGLISH, + + final String expText = String.format(Locale.ENGLISH, "Government: %dy, Party: %dy, Parliament: %dy", govYears, partyYears, parliamentYears); final Label expValue = new Label(expText); expValue.addStyleName(CardInfoRowUtil.LayoutConstants.CARD_INFO_VALUE); - + experienceLayout.addComponents(expIcon, expLabel, expValue); container.addComponent(experienceLayout); } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PartyLeaderUtil.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PartyLeaderUtil.java index 41410c3ff0b..d4be86861fa 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PartyLeaderUtil.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PartyLeaderUtil.java @@ -53,8 +53,8 @@ public static ViewRiksdagenPartyRoleMember getPartyLeaderRole(ApplicationManager * @return a map of person ids to boolean indicating if they are party leaders */ public static Map computePartyLeaders(ApplicationManager applicationManager, Iterable personIds) { - Map result = new HashMap<>(); - for (String personId : personIds) { + final Map result = new HashMap<>(); + for (final String personId : personIds) { result.put(personId, isPartyLeader(applicationManager, personId)); } return result; diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PoliticianLeaderboardUtil.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PoliticianLeaderboardUtil.java index b900741b81d..fb496834201 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PoliticianLeaderboardUtil.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/pagemode/PoliticianLeaderboardUtil.java @@ -284,12 +284,12 @@ private String buildTopString(List items, } @SuppressWarnings("unused") - private void addMetricsSection(VerticalLayout layout, String sectionTitle, + private void addMetricsSection(VerticalLayout layout, String sectionTitle, ViewRiksdagenPolitician politician, ViewRiksdagenPoliticianBallotSummary ballotSummary, MetricType metricType) { - + final VerticalLayout sectionLayout = CardInfoRowUtil.createSectionLayout(sectionTitle); - + switch(metricType) { case PARLIAMENTARY: addParliamentaryPerformanceMetrics(sectionLayout, politician, ballotSummary); @@ -301,13 +301,13 @@ private void addMetricsSection(VerticalLayout layout, String sectionTitle, addPartyAlignmentMetrics(sectionLayout, politician, ballotSummary); break; } - + layout.addComponent(sectionLayout); } private enum MetricType { PARLIAMENTARY, - LEGISLATIVE, + LEGISLATIVE, PARTY_ALIGNMENT } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/AbstractRoleSystemITest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/AbstractRoleSystemITest.java index 0453b919d99..9459e33e1ab 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/AbstractRoleSystemITest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/AbstractRoleSystemITest.java @@ -21,11 +21,9 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.FixMethodOrder; -import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; import com.hack23.cia.testfoundation.AbstractSystemIntegrationTest; -import com.hack23.cia.testfoundation.Parallelized; import io.github.bonigarcia.wdm.WebDriverManager; import io.github.bonigarcia.wdm.config.DriverManagerType; @@ -33,7 +31,6 @@ /** * The Class AbstractRoleSystemITest. */ -@RunWith(Parallelized.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public abstract class AbstractRoleSystemITest extends AbstractSystemIntegrationTest { @@ -50,7 +47,7 @@ public abstract class AbstractRoleSystemITest extends AbstractSystemIntegrationT usingExternalServer = false; } - + CitizenIntelligenceAgencyServer.setEnv("CIA_APP_ENCRYPTION_PASSWORD", "allhaildiscordia"); } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/AbstractUITest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/AbstractUITest.java index 20a8328662e..774f373f5ba 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/AbstractUITest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/AbstractUITest.java @@ -1,56 +1,56 @@ package com.hack23.cia.systemintegrationtest; import org.junit.After; +import org.junit.AfterClass; import org.junit.Before; +import org.junit.BeforeClass; import org.openqa.selenium.WebDriver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; +import com.hack23.cia.systemintegrationtest.ui.TestConstants; import com.hack23.cia.systemintegrationtest.ui.UserPageVisit; import com.hack23.cia.systemintegrationtest.ui.WebDriverFactory; public abstract class AbstractUITest extends AbstractRoleSystemITest { - private static final Logger LOG = LoggerFactory.getLogger(AbstractUITest.class); - protected static final long DEFAULT_TIMEOUT = TestConstants.DEFAULT_TIMEOUT; - protected static final String BASE_URL = System.getProperty("system.test.target.url", - CitizenIntelligenceAgencyServer.ACCESS_URL); - - protected WebDriver driver; - protected UserPageVisit pageVisit; - - @Before - public void setup() { - LOG.info("Setting up test with browser"); - driver = WebDriverFactory.createDriver(); - pageVisit = new UserPageVisit(driver); - } - - @After - public void teardown() { - LOG.info("Tearing down test"); - if (driver != null) { - try { - driver.quit(); - } catch (Exception e) { - LOG.error("Error closing WebDriver", e); - } - } - } - - - protected void retryOnFailure(Runnable test, int maxRetries) { - Exception lastException = null; - for (int i = 0; i < maxRetries; i++) { - try { - test.run(); - return; - } catch (Exception e) { - lastException = e; - LOG.warn("Test failed, attempt {} of {}", i + 1, maxRetries); - } - } - throw new AssertionError("Test failed after " + maxRetries + " attempts", lastException); - } + private static final Logger LOG = LoggerFactory.getLogger(AbstractUITest.class); + protected static final long DEFAULT_TIMEOUT = TestConstants.DEFAULT_TIMEOUT; + protected static final String BASE_URL = System.getProperty("system.test.target.url", + CitizenIntelligenceAgencyServer.ACCESS_URL); + + protected static WebDriver driver; + protected static UserPageVisit pageVisit; + + @BeforeClass + public static void globalSetup() { + LOG.info("Setting up test with browser"); + driver = WebDriverFactory.createDriver(); + pageVisit = new UserPageVisit(driver); + } + + @AfterClass + public static void globalTeardown() { + LOG.info("Tearing down WebDriver after all tests have run"); + if (driver != null) { + driver.quit(); + } + } + + @Before + public void setup() { + cleanBrowser(); + } + + @After + public void teardown() { + cleanBrowser(); + } + + private void cleanBrowser() { + if (driver != null) { + driver.manage().deleteAllCookies(); + driver.get("about:blank"); + } + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/CitizenIntelligenceAgencyServer.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/CitizenIntelligenceAgencyServer.java index affa296eff1..891915c3605 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/CitizenIntelligenceAgencyServer.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/CitizenIntelligenceAgencyServer.java @@ -71,18 +71,7 @@ public final class CitizenIntelligenceAgencyServer { /** The server. */ private Server server; - /** - * Instantiates a new citizen intelligence agency server. - */ - public CitizenIntelligenceAgencyServer() { - super(); - initLogger(); - } - - /** - * Inits the logger. - */ - private static void initLogger() { + static { System.setProperty("logback.configurationFile", "src/main/resources/logback.xml"); System.setProperty("slf4j", "true"); System.setProperty("org.eclipse.jetty.util.log.class", "org.eclipse.jetty.util.log.Slf4jLog"); @@ -94,6 +83,15 @@ private static void initLogger() { java.util.logging.Logger.getLogger("global").setLevel(Level.FINEST); } + + /** + * Instantiates a new citizen intelligence agency server. + */ + public CitizenIntelligenceAgencyServer() { + super(); + } + + /** * The main method. * @@ -230,7 +228,6 @@ public void start() throws Exception { */ public void startServer() { try { - initLogger(); init(); start(); while (!server.isStarted()) { diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminAgentTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminAgentTest.java index 3277f944399..b6fb2628e96 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminAgentTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminAgentTest.java @@ -2,42 +2,33 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; import org.openqa.selenium.WebElement; import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; -import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; -import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; +import com.hack23.cia.systemintegrationtest.ui.TestConstants; +import com.hack23.cia.web.impl.ui.application.views.admin.AdminViewConstants; +import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PageCommandAdminConstants; -@RunWith(Parameterized.class) @Category(IntegrationTest.class) public final class AdminAgentTest extends AbstractUITest { + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldStartImportOperations() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_AGENT_OPERATION); + pageVisit.verifyPageContent(AdminViewConstants.ADMIN_AGENT_OPERATION_OVERVIEW); + pageVisit.verifyPageContent(AdminViewConstants.ADMIN_AGENT_OPERATION); + pageVisit.verifyPageContent(AdminViewConstants.ADMIN_AGENT_OPERATION_TASKS_OVERVIEW); - @Test(timeout = TestConstants.DEFAULT_TIMEOUT, expected = Exception.class) - public void shouldStartImportOperations() throws Exception { - try { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_AGENT_OPERATIONVIEW_NAME, "")); + final WebElement worldBankButton = pageVisit + .findButton(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON); + assertNotNull(worldBankButton); - WebElement worldBankButton = pageVisit.findButton("Start IMPORT MODEL_EXTERNAL_WORLDBANK"); - assertNotNull("WorldBank import button should exist", worldBankButton); + final WebElement riksdagenButton = pageVisit + .findButton(AdminViewConstants.ADMIN_AGENT_OPERATION_DEPLOY_SWEDEN_BUTTON); + assertNotNull(riksdagenButton); - WebElement riksdagenButton = pageVisit.findButton("Start IMPORT MODEL_EXTERNAL_RIKSDAGEN"); - assertNotNull("Riksdagen import button should exist", riksdagenButton); - - pageVisit.performClickAction(riksdagenButton); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } catch (AssertionError e) { - throw new Exception("Test failed", e); - } - } + pageVisit.performClickAction(riksdagenButton); + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminApplicationSystemTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminApplicationSystemTest.java index 7047fdb0a27..2075f72a40e 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminApplicationSystemTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminApplicationSystemTest.java @@ -5,6 +5,7 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; +import com.hack23.cia.web.impl.ui.application.views.admin.AdminViewConstants; import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PageCommandAdminConstants; // ...imports... @@ -12,51 +13,53 @@ @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... + @Test(timeout = DEFAULT_TIMEOUT) + public void verifyApplicationSessionPaginationTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION); + pageVisit.verifyPageContent(AdminViewConstants.ADMIN_APPLICATION_SESSION); + + // Test last page + pageVisit.performClickAction(pageVisit.findButton("last page")); + + // Test next page + pageVisit.performClickAction(pageVisit.findButton("first 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(AdminViewConstants.ADMIN_APPLICATION_EVENT_CHARTS); + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void verifyApplicationSessionChartsTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION_CHARTS); + pageVisit.verifyPageContent(AdminViewConstants.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(AdminViewConstants.ADMIN_AGENT_OPERATION_OVERVIEW); + 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(AdminViewConstants.ADMIN_APPLICATION_SESSION); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(PageCommandAdminConstants.COMMAND_APPLICATION_SESSION); + pageVisit.verifyPageContent(AdminViewConstants.APPLICATION_SESSION_DETAILS); + } + + // ...other application management tests... } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationSystemTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationSystemTest.java index 63c33eaddeb..547ae389e25 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationSystemTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationSystemTest.java @@ -5,35 +5,36 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; +import com.hack23.cia.web.impl.ui.application.views.admin.AdminViewConstants; 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 verifyLanguageConfigurationTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_LANGUAGE); + pageVisit.verifyPageContent(AdminViewConstants.LANGUAGE_OVERVIEW); + 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 verifyCountryConfigurationTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_COUNTRY); + pageVisit.verifyPageContent(AdminViewConstants.COUNTRY_OVERVIEW); + 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); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void verifyPortalConfigurationTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_PORTAL); + pageVisit.verifyPageContent(AdminViewConstants.PORTAL_OVERVIEW); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(PageCommandAdminConstants.COMMAND_PORTAL); + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationTest.java index 00dcd5b2701..19ccaf0a124 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminConfigurationTest.java @@ -1,43 +1,26 @@ package com.hack23.cia.systemintegrationtest.admin; -import org.junit.Assert; 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.systemintegrationtest.suites.TestConstants; +import com.hack23.cia.systemintegrationtest.ui.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @Category(IntegrationTest.class) public final class AdminConfigurationTest extends AbstractUITest { - - - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldUpdateConfiguration() throws Exception { - Assert.assertNotNull("NO_WEBDRIVER_EXIST_FOR_BROWSER", driver); + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldUpdateConfiguration() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_CONFIGURATION_VIEW_NAME, "")); + pageVisit.verifyPageContent("Admin Application Configuration"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_CONFIGURATION_VIEW_NAME, "")); + pageVisit.updateConfigurationProperty("Update Configuration.propertyValue", String.valueOf(false)); + pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_CONFIGURATION_VIEW_NAME, "")); - try { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage( - new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_CONFIGURATION_VIEW_NAME, "")); - pageVisit.verifyPageContent("Admin Application Configuration"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage( - new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_CONFIGURATION_VIEW_NAME, "")); - pageVisit.updateConfigurationProperty("Update Configuration.propertyValue", String.valueOf(false)); - pageVisit.validatePage( - new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_CONFIGURATION_VIEW_NAME, "")); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } catch (AssertionError | Exception e) { - throw new RuntimeException("Test failed", e); - } - } + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataSummarySystemTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataSummarySystemTest.java index f74f18c12ec..935f8224ff1 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataSummarySystemTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataSummarySystemTest.java @@ -13,60 +13,59 @@ @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 verifyDataManagementOperationsTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); - @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 refresh views + final WebElement refreshButton = pageVisit.findButton("Refresh Views"); + assertNotNull(refreshButton); + pageVisit.performClickAction(refreshButton); - @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 update search index + final WebElement indexButton = pageVisit.findButton("Update Search Index"); + assertNotNull(indexButton); + pageVisit.performClickAction(indexButton); + } - @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 verifyDataManagementRemoveOperationsTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); - @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")); - } + 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... + @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... } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataTest.java index c62f716f63f..6d99d904cdf 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminDataTest.java @@ -5,22 +5,18 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; +import com.hack23.cia.systemintegrationtest.ui.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @Category(IntegrationTest.class) public final class AdminDataTest extends AbstractUITest { - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldViewAdminData() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); - pageVisit.verifyPageContent("Admin Data Summary"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldViewAdminData() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); + pageVisit.verifyPageContent("Admin Data Summary"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminEmailTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminEmailTest.java index 50998753e36..ac2ded99f66 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminEmailTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminEmailTest.java @@ -5,39 +5,31 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; +import com.hack23.cia.systemintegrationtest.ui.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @Category(IntegrationTest.class) public final class AdminEmailTest extends AbstractUITest { - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldSendValidEmail() { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_EMAIL_VIEW_NAME, "")); - pageVisit.verifyPageContent("email"); - pageVisit.sendEmailOnEmailPage("james@hack23.com", "Test Subject", "Test content"); - pageVisit.checkNotificationMessage("Email Sentdesc"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldFailWithInvalidEmail() { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_EMAIL_VIEW_NAME, "")); - pageVisit.verifyPageContent("email"); - pageVisit.sendEmailOnEmailPage("invalidemail", "Test Subject", "Test content"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldSendValidEmail() throws Exception { + + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_EMAIL_VIEW_NAME, "")); + pageVisit.verifyPageContent("email"); + pageVisit.sendEmailOnEmailPage("james@hack23.com", "Test Subject", "Test content"); + pageVisit.checkNotificationMessage("Email Sentdesc"); + + } + + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldFailWithInvalidEmail() throws Exception { + + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_EMAIL_VIEW_NAME, "")); + pageVisit.verifyPageContent("email"); + pageVisit.sendEmailOnEmailPage("invalidemail", "Test Subject", "Test content"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringSystemTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringSystemTest.java index f30b8150f92..c9cc4b73bb2 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringSystemTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringSystemTest.java @@ -5,24 +5,17 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; +import com.hack23.cia.web.impl.ui.application.views.admin.AdminViewConstants; 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 verifyMonitoringAccessAndContentTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_MONITORING); + pageVisit.verifyPageContent(AdminViewConstants.ADMIN_MONITORING); + } - @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); - } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringTest.java deleted file mode 100644 index 19abaf85c13..00000000000 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminMonitoringTest.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.hack23.cia.systemintegrationtest.admin; - -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; - -@Category(IntegrationTest.class) -public class AdminMonitoringTest { - @Test - public void testAdminMonitoring() { - // Test implementation - } -} diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminPageSystemTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminPageSystemTest.java index 5c5d2bb4072..2d3de2dbe27 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminPageSystemTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminPageSystemTest.java @@ -10,96 +10,98 @@ @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); - } + @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); + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminRoleSystemITest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminRoleSystemITest.java index bd9739b615c..833cdb7f4d5 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminRoleSystemITest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminRoleSystemITest.java @@ -34,68 +34,68 @@ @Category(IntegrationTest.class) public final class AdminRoleSystemITest extends AbstractUITest { - // Remove duplicates and keep only specialized tests: - // - Application Session pagination tests - // - Data Summary specific operations - // - Other unique functionality tests + // Remove duplicates and keep only specialized tests: + // - Application Session pagination tests + // - Data Summary specific operations + // - Other unique functionality tests - @Test(timeout = DEFAULT_TIMEOUT) - public void siteAdminApplicationSessionLastPageTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); - pageVisit.verifyPageContent("Application Session"); - final WebElement nextPageButton = pageVisit.findButton("last page"); - pageVisit.performClickAction(nextPageButton); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void siteAdminApplicationSessionLastPageTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); + pageVisit.verifyPageContent("Application Session"); + final WebElement nextPageButton = pageVisit.findButton("last page"); + pageVisit.performClickAction(nextPageButton); + } - @Test(timeout = DEFAULT_TIMEOUT) - public void siteAdminApplicationSessionNextPageTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); - pageVisit.verifyPageContent("Application Session"); - final WebElement nextPageButton = pageVisit.findButton("next page"); - pageVisit.performClickAction(nextPageButton); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void siteAdminApplicationSessionNextPageTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); + pageVisit.verifyPageContent("Application Session"); + final WebElement nextPageButton = pageVisit.findButton("next page"); + pageVisit.performClickAction(nextPageButton); + } - @Test(timeout = DEFAULT_TIMEOUT) - public void visitAdminDataSummaryViewRefreshViewsTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); - 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 visitAdminDataSummaryViewRefreshViewsTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); + 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 visitAdminDataSummaryViewRemoveApplicationHistoryTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); - final WebElement removeApplicationHistoryButton = pageVisit.findButton("Remove Application History"); - assertNotNull("Expect to find a Button", removeApplicationHistoryButton); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void visitAdminDataSummaryViewRemoveApplicationHistoryTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); + final WebElement removeApplicationHistoryButton = pageVisit.findButton("Remove Application History"); + assertNotNull("Expect to find a Button", removeApplicationHistoryButton); + } - @Test(timeout = DEFAULT_TIMEOUT) - public void visitAdminDataSummaryViewRemoveDocumentsTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); - final WebElement removeDocumentsButton = pageVisit.findButton("Remove Documents"); - assertNotNull("Expect to find a Button", removeDocumentsButton); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void visitAdminDataSummaryViewRemoveDocumentsTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); + final WebElement removeDocumentsButton = pageVisit.findButton("Remove Documents"); + assertNotNull("Expect to find a Button", removeDocumentsButton); + } - @Test(timeout = DEFAULT_TIMEOUT) - public void visitAdminDataSummaryViewRemovePoliticianTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); - final WebElement removePoliticiansButton = pageVisit.findButton("Remove Politicians"); - assertNotNull("Expect to find a Button", removePoliticiansButton); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void visitAdminDataSummaryViewRemovePoliticianTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); + final WebElement removePoliticiansButton = pageVisit.findButton("Remove Politicians"); + assertNotNull("Expect to find a Button", removePoliticiansButton); + } - @Test(timeout = DEFAULT_TIMEOUT) - public void visitAdminDataSummaryViewUpdateSearchIndexTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); - final WebElement updateSearchIndexButton = pageVisit.findButton("Update Search Index"); - assertNotNull("Expect to find a Update Search Index Button", updateSearchIndexButton); - pageVisit.performClickAction(updateSearchIndexButton); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void visitAdminDataSummaryViewUpdateSearchIndexTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_DATA_SUMMARY_VIEW_NAME, "")); + final WebElement updateSearchIndexButton = pageVisit.findButton("Update Search Index"); + assertNotNull("Expect to find a Update Search Index Button", updateSearchIndexButton); + pageVisit.performClickAction(updateSearchIndexButton); + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminSystemRightsTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminSystemRightsTest.java index b2a021dd083..bac455bce6f 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminSystemRightsTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminSystemRightsTest.java @@ -10,21 +10,21 @@ @Category(IntegrationTest.class) public class AdminSystemRightsTest extends AbstractUITest { - @Test(timeout = DEFAULT_TIMEOUT) - public void verifyMonitoringDeniedForAnonymousTest() throws Exception { - pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_MONITORING); - pageVisit.verifyPageContent("Access denied:adminmonitoring"); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void verifyMonitoringDeniedForAnonymousTest() throws Exception { + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_MONITORING); + pageVisit.verifyPageContent("Access denied:adminmonitoring"); + } - @Test(timeout = DEFAULT_TIMEOUT) - public void verifyAdminConfigurationsDeniedForAnonymousTest() throws Exception { - pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_CONFIGURATION); - pageVisit.verifyPageContent("Access denied"); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void verifyAdminDataManagementDeniedForAnonymousTest() throws Exception { - pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); - pageVisit.verifyPageContent("Access denied"); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void verifyAdminConfigurationsDeniedForAnonymousTest() throws Exception { + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_APPLICATION_CONFIGURATION); + pageVisit.verifyPageContent("Access denied"); + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void verifyAdminDataManagementDeniedForAnonymousTest() throws Exception { + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_DATASUMMARY); + pageVisit.verifyPageContent("Access denied"); + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminUserManagementSystemTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminUserManagementSystemTest.java index e0a554d6dd6..576a72ae10e 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminUserManagementSystemTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminUserManagementSystemTest.java @@ -5,25 +5,26 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; +import com.hack23.cia.web.impl.ui.application.views.admin.AdminViewConstants; import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PageCommandAdminConstants; @Category(IntegrationTest.class) public class AdminUserManagementSystemTest extends AbstractUITest { - @Test(timeout = DEFAULT_TIMEOUT) - public void verifyUserAccountManagementTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_USERACCOUNT); - pageVisit.verifyPageContent("User Account Management"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(PageCommandAdminConstants.COMMAND_USERACCOUNT); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void verifyUserAccountManagementTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_USERACCOUNT); + pageVisit.verifyPageContent("User Account Management"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(PageCommandAdminConstants.COMMAND_USERACCOUNT); + } - @Test(timeout = DEFAULT_TIMEOUT) - public void verifyEmailConfigurationTest() throws Exception { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_EMAIL); - pageVisit.verifyPageContent("Email Configuration"); - pageVisit.validatePage(PageCommandAdminConstants.COMMAND_EMAIL); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void verifyEmailConfigurationTest() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(PageCommandAdminConstants.COMMAND_EMAIL); + pageVisit.verifyPageContent(AdminViewConstants.ADMIN_EMAIL_MANAGEMENT); + pageVisit.validatePage(PageCommandAdminConstants.COMMAND_EMAIL); + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminUserManagementTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminUserManagementTest.java index f32e8269dfc..7d6d6f9878f 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminUserManagementTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/AdminUserManagementTest.java @@ -6,91 +6,53 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @Category(IntegrationTest.class) public final class AdminUserManagementTest extends AbstractUITest { - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldManageLanguageSettings() { - try { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_LANGUAGE_VIEW_NAME, "")); - pageVisit.verifyPageContent("Language"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_LANGUAGE_VIEW_NAME, "")); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldManageUserAccount() { - try { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, "")); - pageVisit.verifyPageContent("User"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, "")); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldManageCountrySettings() { - try { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_COUNTRY_VIEW_NAME, "")); - pageVisit.verifyPageContent("Country"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_COUNTRY_VIEW_NAME, "")); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldDeleteUserAccount() { - try { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, "")); - pageVisit.verifyPageContent("Admin User Account Management"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, "")); - final WebElement deleteButton = pageVisit.findButton("Perform DELETE"); - assertNotNull("Expect to find a Delete Button", deleteButton); - pageVisit.performClickAction(deleteButton); - pageVisit.checkNotificationMessage("Operation completeddesc"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldManageLanguageSettings() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_LANGUAGE_VIEW_NAME, "")); + pageVisit.verifyPageContent("Language"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_LANGUAGE_VIEW_NAME, "")); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldManageUserAccount() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, "")); + pageVisit.verifyPageContent("User"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, "")); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldManageCountrySettings() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_COUNTRY_VIEW_NAME, "")); + pageVisit.verifyPageContent("Country"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_COUNTRY_VIEW_NAME, "")); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldDeleteUserAccount() throws Exception { + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, "")); + pageVisit.verifyPageContent("Admin User Account Management"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_USERACCOUNT_VIEW_NAME, "")); + final WebElement deleteButton = pageVisit.findButton("Perform DELETE"); + assertNotNull("Expect to find a Delete Button", deleteButton); + pageVisit.performClickAction(deleteButton); + pageVisit.checkNotificationMessage("Operation completeddesc"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/SessionManagementTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/SessionManagementTest.java index d848c7e3f72..c8d7b61bf5e 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/SessionManagementTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/admin/SessionManagementTest.java @@ -6,50 +6,42 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; @Category(IntegrationTest.class) public final class SessionManagementTest extends AbstractUITest { - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldHandleSessionPagination() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); - pageVisit.verifyPageContent("Application Session"); - - // Test last page navigation - WebElement lastPageButton = pageVisit.findButton("last page"); - pageVisit.performClickAction(lastPageButton); - - // Test next page navigation - WebElement nextPageButton = pageVisit.findButton("next page"); - pageVisit.performClickAction(nextPageButton); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new RuntimeException("Test interrupted", e); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldShowSessionDetails() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.loginAsAdmin(); - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); - pageVisit.verifyPageContent("Application Session"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); - pageVisit.verifyPageContent("ApplicationActionEvent"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldHandleSessionPagination() throws Exception { + + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); + pageVisit.verifyPageContent("Application Session"); + + // Test next page navigation + final WebElement nextPageButton = pageVisit.findButton("next page"); + pageVisit.performClickAction(nextPageButton); + + // Test last page navigation + final WebElement lastPageButton = pageVisit.findButton("last page"); + pageVisit.performClickAction(lastPageButton); + + final WebElement firstPageButton = pageVisit.findButton("first page"); + pageVisit.performClickAction(firstPageButton); + + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldShowSessionDetails() throws Exception { + + pageVisit.loginAsAdmin(); + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); + pageVisit.verifyPageContent("Application Session"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "")); + pageVisit.verifyPageContent("ApplicationActionEvent"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/suites/IntegrationTestSuite.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/suites/IntegrationTestSuite.java index 7defb464a7b..d62fb5b2c14 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/suites/IntegrationTestSuite.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/suites/IntegrationTestSuite.java @@ -4,20 +4,29 @@ import org.junit.runners.Suite; import com.hack23.cia.systemintegrationtest.admin.AdminAgentTest; +import com.hack23.cia.systemintegrationtest.admin.AdminApplicationSystemTest; +import com.hack23.cia.systemintegrationtest.admin.AdminConfigurationSystemTest; import com.hack23.cia.systemintegrationtest.admin.AdminConfigurationTest; +import com.hack23.cia.systemintegrationtest.admin.AdminDataSummarySystemTest; import com.hack23.cia.systemintegrationtest.admin.AdminDataTest; import com.hack23.cia.systemintegrationtest.admin.AdminEmailTest; +import com.hack23.cia.systemintegrationtest.admin.AdminMonitoringSystemTest; +import com.hack23.cia.systemintegrationtest.admin.AdminPageSystemTest; +import com.hack23.cia.systemintegrationtest.admin.AdminRoleSystemITest; +import com.hack23.cia.systemintegrationtest.admin.AdminUserManagementSystemTest; import com.hack23.cia.systemintegrationtest.admin.AdminUserManagementTest; import com.hack23.cia.systemintegrationtest.admin.SessionManagementTest; import com.hack23.cia.systemintegrationtest.user.AuthorizationTest; import com.hack23.cia.systemintegrationtest.user.BallotViewTest; import com.hack23.cia.systemintegrationtest.user.CommitteeViewTest; +import com.hack23.cia.systemintegrationtest.user.DocumentViewTest; import com.hack23.cia.systemintegrationtest.user.MinistryViewTest; import com.hack23.cia.systemintegrationtest.user.PartyViewTest; import com.hack23.cia.systemintegrationtest.user.PoliticianViewTest; import com.hack23.cia.systemintegrationtest.user.SearchViewTest; import com.hack23.cia.systemintegrationtest.user.UserAuthenticationTest; import com.hack23.cia.systemintegrationtest.user.UserNavigationTest; +import com.hack23.cia.systemintegrationtest.user.UserRoleSystemITest; import com.hack23.cia.systemintegrationtest.user.ViewPageTest; import com.hack23.cia.systemintegrationtest.user.ViewRankingTest; @@ -32,7 +41,8 @@ PoliticianViewTest.class, CommitteeViewTest.class, BallotViewTest.class, - + UserRoleSystemITest.class, + DocumentViewTest.class, // User Tests UserAuthenticationTest.class, UserNavigationTest.class, @@ -40,13 +50,22 @@ // Admin Tests AdminConfigurationTest.class, + AdminConfigurationSystemTest.class, AdminUserManagementTest.class, AdminDataTest.class, AdminEmailTest.class, AdminAgentTest.class, + AdminApplicationSystemTest.class, + AdminDataSummarySystemTest.class, + AdminMonitoringSystemTest.class, + AdminRoleSystemITest.class, + AdminUserManagementSystemTest.class, + AdminUserManagementTest.class, + // System Tests - SessionManagementTest.class + SessionManagementTest.class, + AdminPageSystemTest.class }) public class IntegrationTestSuite { // Empty test suite diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/ClickHelper.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/ClickHelper.java index 681f700183c..6be39fba19e 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/ClickHelper.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/ClickHelper.java @@ -2,18 +2,15 @@ import java.time.Duration; -import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class ClickHelper { - private static final Logger LOG = LoggerFactory.getLogger(ClickHelper.class); private final Actions actions; private final UserPageVisitHelper helper; + public static boolean enableScreenShot = false; public ClickHelper(WebDriver driver, UserPageVisitHelper helper) { this.actions = new Actions(driver); @@ -21,17 +18,15 @@ public ClickHelper(WebDriver driver, UserPageVisitHelper helper) { } public void clickWithRetry(WebElement element) { - try { - clickElement(element); - } catch (Exception e) { - LOG.debug("Regular click failed, trying with delay", e); - clickWithDelay(element); - } + clickElement(element); } public void clickWithDelay(WebElement element) { - helper.waitForElement(By.id(element.getDomAttribute("id"))); + clickElement(element); + } + + private void clickElement(WebElement element) { actions.pause(Duration.ofMillis(250)) .clickAndHold(helper.refreshElement(element)) .release() @@ -39,13 +34,9 @@ public void clickWithDelay(WebElement element) { .perform(); helper.waitForPageLoad(); - helper.grabScreenshot(); - } - private void clickElement(WebElement element) { - helper.waitForElement(By.id(element.getDomAttribute("id"))); - helper.refreshElement(element).click(); - helper.waitForPageLoad(); - helper.grabScreenshot(); + if(enableScreenShot) { + helper.grabScreenshot(); + } } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/ElementHelper.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/ElementHelper.java index c476128a0f0..fb6e719fa43 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/ElementHelper.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/ElementHelper.java @@ -1,42 +1,47 @@ package com.hack23.cia.systemintegrationtest.ui; -import org.openqa.selenium.*; -import org.openqa.selenium.support.ui.*; import java.time.Duration; -import java.util.*; +import java.util.ArrayList; +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; public class ElementHelper { private final WebDriver driver; private final Duration waitTimeout; - + public ElementHelper(WebDriver driver, Duration waitTimeout) { this.driver = driver; this.waitTimeout = waitTimeout; } - + public WebElement waitForClickable(By locator) { return new WebDriverWait(driver, waitTimeout) .until(ExpectedConditions.elementToBeClickable(locator)); } - + public List findButtons() { - List buttons = new ArrayList<>(); + final List buttons = new ArrayList<>(); buttons.addAll(driver.findElements(By.className("v-nativebutton"))); buttons.addAll(driver.findElements(By.className("v-button"))); buttons.addAll(driver.findElements(By.className("v-button-caption"))); buttons.addAll(driver.findElements(By.tagName("a"))); return buttons; } - + public WebElement findButtonByText(String text) { return findButtons().stream() .filter(button -> matchesButtonText(button, text)) .findFirst() .orElse(null); } - + private boolean matchesButtonText(WebElement button, String text) { - String buttonText = button.getText().trim(); + final String buttonText = button.getText().trim(); return text.equalsIgnoreCase(buttonText) || buttonText.endsWith(text); } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/suites/TestConstants.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/TestConstants.java similarity index 73% rename from citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/suites/TestConstants.java rename to citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/TestConstants.java index 6e9f00b4cf2..7311733e973 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/suites/TestConstants.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/TestConstants.java @@ -1,13 +1,12 @@ -package com.hack23.cia.systemintegrationtest.suites; +package com.hack23.cia.systemintegrationtest.ui; import java.time.Duration; import java.util.UUID; public final class TestConstants { - public static final long DEFAULT_TIMEOUT = 6000; - public static final int DEFAULT_MAX_RETRIES = 2; - public static final int WAIT_FOR_PAGE_DELAY = 3500; - public static final Duration WAIT_FOR_PAGE_ELEMENT = Duration.ofMillis(120000); + public static final long DEFAULT_TIMEOUT = 25000; + public static final int WAIT_FOR_PAGE_DELAY = 7500; + public static final Duration WAIT_FOR_PAGE_ELEMENT = Duration.ofMillis(7500); private TestConstants() { // Prevent instantiation diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/TestUtils.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/TestUtils.java index 625151b76ac..e409bc962ff 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/TestUtils.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/TestUtils.java @@ -2,14 +2,15 @@ import java.util.Arrays; import java.util.List; + import org.passay.CharacterRule; import org.passay.EnglishCharacterData; import org.passay.PasswordGenerator; public final class TestUtils { - + private TestUtils() {} - + public static String generatePassword() { final List rules = Arrays.asList( new CharacterRule(EnglishCharacterData.UpperCase, 1), diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/UserPageVisit.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/UserPageVisit.java index b1a477527eb..985a6198d43 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/UserPageVisit.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/UserPageVisit.java @@ -18,13 +18,7 @@ */ package com.hack23.cia.systemintegrationtest.ui; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; import java.util.Set; @@ -33,19 +27,13 @@ import org.openqa.selenium.Cookie; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.Keys; -import org.openqa.selenium.OutputType; -import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import com.hack23.cia.systemintegrationtest.CitizenIntelligenceAgencyServer; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ApplicationPageMode; @@ -57,10 +45,6 @@ */ public final class UserPageVisit extends Assert { - /** The screen shot number. */ - private static int screenShotNumber; - - protected static String systemTestTargetAdminEmail; protected static String systemTestTargetAdminPassword; @@ -68,8 +52,6 @@ public final class UserPageVisit extends Assert { /** The Constant systemTestTargetUrl. */ private static final String systemTestTargetUrl; - private static final Logger LOG = LoggerFactory.getLogger(UserPageVisit.class); - static { final String systemTestTargetUrlProperty = System.getProperty("system.test.target.url"); if (systemTestTargetUrlProperty != null && !systemTestTargetUrlProperty.trim().isEmpty()) { @@ -90,7 +72,7 @@ public final class UserPageVisit extends Assert { } /** The driver. */ - private final WebDriver driver; + final WebDriver driver; private final UserPageVisitHelper helper; private final ElementHelper elementHelper; @@ -114,29 +96,12 @@ public UserPageVisit(final WebDriver driver) { action = new Actions(driver); } - /** - * Grab screenshot. - * - * @param webDriver - * the web driver - */ - private static void grabScreenshot(final WebDriver webDriver) { - final File scrFile = ((TakesScreenshot) webDriver).getScreenshotAs(OutputType.FILE); - try { - screenShotNumber = screenShotNumber + 1; - final Path targetPath = Path.of("target", "screenshot_" + screenShotNumber + ".png"); - Files.copy(scrFile.toPath(), targetPath, StandardCopyOption.REPLACE_EXISTING); - } catch (final IOException e) { - e.printStackTrace(); - } - } - public void changePassword(final String password, final String newPassword, final String repeatNewPassword) { setFieldValue("Change password.currentPassword", password); setFieldValue("Change password.newPassword", newPassword); setFieldValue("Change password.repeatNewPassword", repeatNewPassword); - WebElement button = elementHelper.waitForClickable(By.id("Change password")); + final WebElement button = elementHelper.waitForClickable(By.id("Change password")); clickHelper.clickWithRetry(button); } @@ -149,8 +114,8 @@ public void changePassword(final String password, final String newPassword, fina */ public boolean checkHtmlBodyContainsText(final String text) { final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); - wait.until(containsViewAction(ViewAction.VISIT_MAIN_VIEW)); - wait.until(containsText(text)); + wait.until(helper.containsViewAction(ViewAction.VISIT_MAIN_VIEW)); + wait.until(helper.containsText(this, text)); return true; } @@ -180,71 +145,6 @@ public void closeModal() { } - public ExpectedCondition containsButton(final String value) { - return new ExpectedCondition<>() { - - @Override - public Boolean apply(final WebDriver driver) { - for (final WebElement webElement : getButtons()) { - - final WebElement refreshElement = StaleElementUtils.refreshElement(webElement, driver); - if (ExpectedConditions.not(ExpectedConditions.stalenessOf(refreshElement)).apply(driver) - && (value.equalsIgnoreCase(refreshElement.getText().trim()) - || refreshElement.getText().trim().endsWith(value))) { - return true; - } - } - - return false; - } - - @Override - public String toString() { - return String.format("Button \"%s\". ", value); - } - }; - } - - public ExpectedCondition containsMenuItem(final WebElement element, final String... caption) { - return new ExpectedCondition<>() { - @Override - public Boolean apply(final WebDriver driver) { - return !ExpectedConditions.stalenessOf(element).apply(driver) - && getMenuItem(element, 1, caption) != null; - } - }; - } - - public ExpectedCondition containsText(final String value) { - return new ExpectedCondition<>() { - - @Override - public Boolean apply(final WebDriver driver) { - return getHtmlBodyAsText().contains(value); - } - - @Override - public String toString() { - return String.format("containsText \"%s\". ", value); - } - }; - } - - public ExpectedCondition containsViewAction(final ViewAction value) { - return new ExpectedCondition<>() { - - @Override - public Boolean apply(final WebDriver driver) { - return getActionsAvailable().contains(value); - } - - @Override - public String toString() { - return String.format("ViewAction \"%s\". ", value); - } - }; - } - public void disableGoogleAuthenticator(final String password) { setFieldValue("Disable Google Authenticator.userpassword", password); @@ -288,9 +188,9 @@ public void enableGoogleAuthenticator(final String password) { */ public WebElement findButton(final String buttonLabel) { final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); - wait.until(containsButton(buttonLabel)); + wait.until(helper.containsButton(buttonLabel)); - for (final WebElement webElement : getButtons()) { + for (final WebElement webElement : helper.getButtons()) { final WebElement refreshElement = StaleElementUtils.refreshElement(webElement, driver); if (ExpectedConditions.not(ExpectedConditions.stalenessOf(refreshElement)).apply(driver) && (buttonLabel.equalsIgnoreCase(refreshElement.getText().trim()) @@ -327,43 +227,6 @@ public List getActionIdsBy(final ViewAction action) { return idList; } - /** - * Gets the actions available. - * - * @return the actions available - */ - public Set getActionsAvailable() { - final Set actions = new HashSet<>(); - - for (final ViewAction actionValue : ViewAction.values()) { - if (driver.findElements(By.id(actionValue.name())).size() > 0) { - actions.add(actionValue); - } - } - return actions; - } - - private List getButtonElements() { - final List result = new ArrayList<>(driver.findElements(By.className("v-nativebutton"))); - result.addAll(driver.findElements(By.className("v-button"))); - result.addAll(driver.findElements(By.className("v-button-caption"))); - result.addAll(driver.findElements(By.tagName("a"))); - - return result; - } - - /** - * Gets the buttons. - * - * @return the buttons - */ - public List getButtons() { - final List result = getButtonElements(); - final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); - wait.until(ExpectedConditions.refreshed(ExpectedConditions.visibilityOfAllElements(result))); - - return getButtonElements(); - } /** * Gets the grid headers. @@ -431,7 +294,7 @@ public final void loginAsAdmin() throws Exception { * * @return the html body as text */ - private String getHtmlBodyAsText() { + String getHtmlBodyAsText() { return driver.findElement(By.tagName("body")).getText(); } @@ -484,7 +347,7 @@ public WebElement getMenuItem(final String... caption) { * the caption * @return the menu item */ - private WebElement getMenuItem(final WebElement element, final int level, final String... caption) { + WebElement getMenuItem(final WebElement element, final int level, final String... caption) { final List findElements = element.findElements(By.className("v-menubar-menuitem-caption")); if (caption.length == level) { for (final WebElement webElement : findElements) { @@ -527,7 +390,7 @@ private WebElement getMenuItem(final WebElement element, final int level, final public WebElement getMenuItem(final WebElement element, final String... caption) { final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); - wait.until(containsMenuItem(element, caption)); + wait.until(helper.containsMenuItem(this, element, caption)); return getMenuItem(element, 1, caption); } @@ -598,7 +461,7 @@ public void logoutUser() { body.sendKeys(Keys.ESCAPE); final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); - wait.until(containsViewAction(ViewAction.VISIT_MAIN_VIEW)); + wait.until(helper.containsViewAction(ViewAction.VISIT_MAIN_VIEW)); wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.tagName("body"))); driver.navigate().refresh(); @@ -627,11 +490,7 @@ public void logoutUser() { * the click element */ public void performClickAction(final WebElement clickElement) { - assertNotNull(clickElement); - helper.waitForElement(By.id(clickElement.getDomAttribute("id"))); - helper.refreshElement(clickElement).click(); - helper.waitForPageLoad(); - helper.grabScreenshot(); + performClickActionWithRetry(clickElement); } /** @@ -743,7 +602,7 @@ public void validatePage(final PageModeMenuCommand page) { final String url = systemTestTargetUrl + "#!" + page.getPagePath(); final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); - wait.until(containsViewAction(ViewAction.VISIT_MAIN_VIEW)); + wait.until(helper.containsViewAction(ViewAction.VISIT_MAIN_VIEW)); final String text = getHtmlBodyAsText(); assertNotNull(text); @@ -762,7 +621,7 @@ public void validatePage(final PageModeMenuCommand page) { * the view actions */ public void verifyViewActions(final ViewAction[] viewActions) { - final Set actionsAvailable = getActionsAvailable(); + final Set actionsAvailable = helper.getActionsAvailable(); for (final ViewAction viewAction : viewActions) { assertTrue(actionsAvailable.contains(viewAction)); @@ -786,16 +645,6 @@ public void VisitCommitteeRankingView() { assertTrue(!actionIdsBy.isEmpty()); } - /** - * Visit committee view. - * - * @param id - * the id - */ - public void VisitCommitteeView(final String id) { - visitEntityView(id); - } - /** * Visit direct page. * @@ -804,21 +653,17 @@ public void VisitCommitteeView(final String id) { */ public void visitDirectPage(final PageModeMenuCommand page) { final String url = systemTestTargetUrl + "#!" + page.getPagePath(); - LOG.info("Navigating to URL: {}", url); driver.get(url); action.pause(500L).perform(); final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); wait.until(webDriver -> { - String readyState = (String) ((JavascriptExecutor) webDriver).executeScript("return document.readyState"); - LOG.info("Document ready state: {}", readyState); + final String readyState = (String) ((JavascriptExecutor) webDriver).executeScript("return document.readyState"); return "complete".equals(readyState); }); - wait.until(containsViewAction(ViewAction.VISIT_MAIN_VIEW)); - - grabScreenshot(driver); + wait.until(helper.containsViewAction(ViewAction.VISIT_MAIN_VIEW)); final String text = getHtmlBodyAsText(); assertNotNull(text); @@ -865,15 +710,6 @@ public void VisitMinistryRankingView() { assertTrue(actionIdsBy.size() > 0); } - /** - * Visit ministry view. - * - * @param id - * the id - */ - public void VisitMinistryView(final String id) { - visitEntityView(id); - } /** * Visit party ranking view. @@ -882,8 +718,6 @@ public void VisitPartyRankingView() { performClickActionWithRetry(driver.findElement(By .id(ViewAction.VISIT_PARTY_RANKING_VIEW.name()))); - LOG.info("Visiting Party Ranking View"); - assertEquals("https://localhost:28443/#!partyranking", driver.getCurrentUrl()); verifyViewActions(new ViewAction[] { ViewAction.VISIT_MAIN_VIEW }); @@ -893,15 +727,6 @@ public void VisitPartyRankingView() { } - /** - * Visit party view. - * - * @param id - * the id - */ - public void VisitPartyView(final String id) { - visitEntityView(id); - } /** * Visit politician ranking view. @@ -918,16 +743,6 @@ public void VisitPoliticianRankingView() { } - /** - * Visit politician view. - * - * @param id - * the id - */ - public void VisitPoliticianView(final String id) { - visitEntityView(id); - } - /** * Visit start page. */ @@ -935,13 +750,12 @@ public void visitStartPage() { driver.get(systemTestTargetUrl); final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); - wait.until(containsViewAction(ViewAction.VISIT_MAIN_VIEW)); + wait.until(helper.containsViewAction(ViewAction.VISIT_MAIN_VIEW)); assertEquals(systemTestTargetUrl, driver.getCurrentUrl()); assertEquals("Citizen Intelligence Agency", driver.getTitle()); assertNotNull(driver.getWindowHandle()); - grabScreenshot(driver); verifyViewActions(new ViewAction[] { ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, @@ -958,24 +772,17 @@ public UserPageVisit verifyPageContent(String expectedContent) { assertTrue("Expected content: " + expectedContent, checkHtmlBodyContainsText(expectedContent)); return this; - } catch (Exception e) { - LOG.error("Failed to verify page content", e); + } catch (final Exception e) { throw new RuntimeException("Page content verification failed", e); } } public UserPageVisit selectFirstGridRow() { - WebElement firstRow = getGridRows().get(0); + final WebElement firstRow = getGridRows().get(0); performClickActionWithRetry(firstRow); return this; } - // Consolidate duplicate visit view methods into one - private void visitEntityView(final String id) { - final WebElement viewLink = driver.findElement(By.id(id)); - performClickActionWithRetry(viewLink); - verifyViewActions(new ViewAction[] { ViewAction.VISIT_MAIN_VIEW }); - } // The public click methods needed by all the calls public void performClickActionWithRetry(WebElement element) { diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/UserPageVisitHelper.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/UserPageVisitHelper.java index 738a123db66..67ad8a160a7 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/UserPageVisitHelper.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/UserPageVisitHelper.java @@ -6,6 +6,10 @@ import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.time.Duration; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; @@ -19,6 +23,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.hack23.cia.web.impl.ui.application.action.ViewAction; + public class UserPageVisitHelper { private static final Logger LOG = LoggerFactory.getLogger(UserPageVisitHelper.class); private static final Duration DEFAULT_WAIT = Duration.ofMillis(120000); @@ -39,15 +45,17 @@ public void waitForPageLoad() { new WebDriverWait(driver, DEFAULT_WAIT) .until(webDriver -> "complete".equals( ((JavascriptExecutor) webDriver).executeScript("return document.readyState"))); + new WebDriverWait(driver, DEFAULT_WAIT).until(containsViewAction(ViewAction.VISIT_MAIN_VIEW)); + } public void grabScreenshot() { try { - File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); + final File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); screenShotNumber++; - Path targetPath = Path.of("target", "screenshot_" + screenShotNumber + ".png"); + final Path targetPath = Path.of("target", "screenshot_" + screenShotNumber + ".png"); Files.copy(scrFile.toPath(), targetPath, StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { + } catch (final IOException e) { LOG.error("Failed to save screenshot", e); } } @@ -65,4 +73,110 @@ public ExpectedCondition elementIsStale(WebElement element) { return ExpectedConditions.stalenessOf(element); } + public ExpectedCondition containsButton(final String value) { + return new ExpectedCondition<>() { + + @Override + public Boolean apply(final WebDriver driver) { + for (final WebElement webElement : getButtons()) { + final WebElement refreshElement = StaleElementUtils.refreshElement(webElement, driver); + + if (ExpectedConditions.not(ExpectedConditions.stalenessOf(refreshElement)).apply(driver) + && (value.equalsIgnoreCase(refreshElement.getText().trim()) + || refreshElement.getText().trim().endsWith(value))) { + return true; + } + } + + return false; + } + + @Override + public String toString() { + return String.format("Button \"%s\". ", value); + } + }; + } + + public ExpectedCondition containsMenuItem(final UserPageVisit userPageVisit, final WebElement element, final String... caption) { + return new ExpectedCondition<>() { + @Override + public Boolean apply(final WebDriver driver) { + return !ExpectedConditions.stalenessOf(element).apply(driver) + && userPageVisit.getMenuItem(element, 1, caption) != null; + } + }; + } + + public ExpectedCondition containsText(final UserPageVisit userPageVisit, final String value) { + return new ExpectedCondition<>() { + + @Override + public Boolean apply(final WebDriver driver) { + return userPageVisit.getHtmlBodyAsText().contains(value); + } + + @Override + public String toString() { + return String.format("containsText \"%s\". ", value); + } + }; + } + + public ExpectedCondition containsViewAction(final ViewAction value) { + return new ExpectedCondition<>() { + + @Override + public Boolean apply(final WebDriver driver) { + return getActionsAvailable().contains(value); + } + + @Override + public String toString() { + return String.format("ViewAction \"%s\". ", value); + } + }; + } + + List getButtonElements() { + final List result = new ArrayList<>(driver.findElements(By.className("v-nativebutton"))); + result.addAll(driver.findElements(By.className("v-button"))); + result.addAll(driver.findElements(By.className("v-button-caption"))); + result.addAll(driver.findElements(By.tagName("a"))); + + return result; + } + + + /** + * Gets the buttons. + * + * @param userPageVisit TODO + * @return the buttons + */ + public List getButtons() { + final List result = getButtonElements(); + final WebDriverWait wait = new WebDriverWait(driver, TestConstants.WAIT_FOR_PAGE_ELEMENT); + wait.until(ExpectedConditions.refreshed(ExpectedConditions.visibilityOfAllElements(result))); + + return getButtonElements(); + } + + /** + * Gets the actions available. + * + * @param userPageVisit TODO + * @return the actions available + */ + public Set getActionsAvailable() { + final Set actions = new HashSet<>(); + + for (final ViewAction actionValue : ViewAction.values()) { + if (driver.findElements(By.id(actionValue.name())).size() > 0) { + actions.add(actionValue); + } + } + return actions; + } + } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/WebDriverFactory.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/WebDriverFactory.java index de46f3c4f1d..58c6d5cee6f 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/WebDriverFactory.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/ui/WebDriverFactory.java @@ -17,13 +17,13 @@ private WebDriverFactory() { public static WebDriver createDriver() { LOG.info("Creating WebDriver for browser"); - WebDriver driver = createChromeDriver(); + final WebDriver driver = createChromeDriver(); configureDriver(driver); return driver; } private static WebDriver createChromeDriver() { - ChromeOptions options = new ChromeOptions(); + final ChromeOptions options = new ChromeOptions(); options.addArguments( "--allow-insecure-localhost", "--start-maximized"); diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/AuthorizationTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/AuthorizationTest.java index d013346ba28..cb7a1cd6979 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/AuthorizationTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/AuthorizationTest.java @@ -5,7 +5,6 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.CommonsViews; @@ -13,44 +12,26 @@ @Category(IntegrationTest.class) public class AuthorizationTest extends AbstractUITest { - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldDenyAccessToAdminPages() { - try { - retryOnFailure(() -> { - try { - // Try accessing admin pages without login - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_AGENT_OPERATIONVIEW_NAME, "")); - pageVisit.verifyPageContent("Access denied"); - - pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_MONITORING_VIEW_NAME, "")); - pageVisit.verifyPageContent("Access denied"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldAllowAccessToPublicPages() { - try { - retryOnFailure(() -> { - try { - // Public pages should be accessible without login - pageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, "")); - pageVisit.verifyPageContent("Welcome"); - - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, "")); - pageVisit.verifyPageContent("Politicians"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldDenyAccessToAdminPages() { + // Try accessing admin pages without login + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_AGENT_OPERATIONVIEW_NAME, "")); + pageVisit.verifyPageContent("Access denied"); + + pageVisit.visitDirectPage(new PageModeMenuCommand(AdminViews.ADMIN_MONITORING_VIEW_NAME, "")); + pageVisit.verifyPageContent("Access denied"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldAllowAccessToPublicPages() { + // Public pages should be accessible without login + pageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, "")); + pageVisit.verifyPageContent("Welcome"); + + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, "")); + pageVisit.verifyPageContent("Politicians"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/BallotViewTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/BallotViewTest.java index 42300438a56..0d258e6397a 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/BallotViewTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/BallotViewTest.java @@ -11,16 +11,11 @@ @Category(IntegrationTest.class) public final class BallotViewTest extends AbstractUITest { - - @Test(timeout = DEFAULT_TIMEOUT) - public void testBallotView() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.BALLOT_VIEW_NAME, "")); - pageVisit.verifyPageContent("Ballot View"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, 3); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void testBallotView() throws Exception { + + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.BALLOT_VIEW_NAME, "")); + pageVisit.verifyPageContent("Ballot View"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ChartTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ChartTest.java index fc2fb5d16c8..d9c2cd0abc3 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ChartTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ChartTest.java @@ -34,8 +34,7 @@ public final class ChartTest extends Assert { /** * To json string. * - * @param object - * the object + * @param object the object * @return the string */ public static String toJsonString(final Object object) { @@ -47,32 +46,28 @@ public static String toJsonString(final Object object) { Object fieldValue = entry.getValue(); if (!fieldName.contains("jacocoData")) { - if (ObjectHelper.isArray(fieldValue)) { + if (ObjectHelper.isArray(fieldValue)) { - if (fieldValue instanceof Object[][]) { - fieldValue = ObjectHelper - .toArrayString((Object[][]) fieldValue); - } else if (fieldValue instanceof boolean[]) { + if (fieldValue instanceof Object[][]) { + fieldValue = ObjectHelper.toArrayString((Object[][]) fieldValue); + } else if (fieldValue instanceof boolean[]) { - } else + } else - { - fieldValue = ObjectHelper - .toArrayString((Object[]) fieldValue); + { + fieldValue = ObjectHelper.toArrayString((Object[]) fieldValue); + } } - } - if (fieldValue != null) { - fieldValue = !ObjectHelper.isString(fieldValue) ? fieldValue - : fieldValue.toString().replace('"', '\''); - builder.append(builder.length() > 0 ? ", " : ""); - builder.append(fieldName).append(": "); - builder.append(ObjectHelper.isString(fieldValue) ? "\"" - : ""); - builder.append(fieldValue); - builder.append(ObjectHelper.isString(fieldValue) ? "\"" - : ""); - } + if (fieldValue != null) { + fieldValue = !ObjectHelper.isString(fieldValue) ? fieldValue + : fieldValue.toString().replace('"', '\''); + builder.append(builder.length() > 0 ? ", " : ""); + builder.append(fieldName).append(": "); + builder.append(ObjectHelper.isString(fieldValue) ? "\"" : ""); + builder.append(fieldValue); + builder.append(ObjectHelper.isString(fieldValue) ? "\"" : ""); + } } } return builder.insert(0, "{").append("}").toString(); @@ -90,7 +85,7 @@ public void addSerieTest() { final XYseries label = new XYseriesFix(); label.setLabel("sune"); toJsonString(label); - assertNotNull("Problem with toJsonString, no label",label); + assertNotNull("Problem with toJsonString, no label", label); } static class XYaxisFix extends XYaxis { @@ -108,8 +103,7 @@ public XYaxisFix() { /** * Instantiates a new x yaxis fix. * - * @param y - * the y + * @param y the y */ public XYaxisFix(final XYaxes y) { super(y); @@ -122,7 +116,6 @@ public String getValue() { } - static class XYseriesFix extends XYseries { /** The Constant serialVersionUID. */ diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/CommitteeViewTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/CommitteeViewTest.java index 3b89ab35064..e35dc6cf288 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/CommitteeViewTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/CommitteeViewTest.java @@ -11,17 +11,13 @@ @Category(IntegrationTest.class) public final class CommitteeViewTest extends AbstractUITest { - @Test(timeout = DEFAULT_TIMEOUT) - public void testCommitteeView() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, "")); - pageVisit.verifyPageContent("Committee View"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, "")); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, 3); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void testCommitteeView() throws Exception { + + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, "")); + pageVisit.verifyPageContent("Committee View"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(UserViews.COMMITTEE_VIEW_NAME, "")); + + } } \ No newline at end of file diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/DocumentViewTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/DocumentViewTest.java index 65ff5082ad2..0bbdc7f189c 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/DocumentViewTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/DocumentViewTest.java @@ -11,18 +11,13 @@ @Category(IntegrationTest.class) public final class DocumentViewTest extends AbstractUITest { + @Test(timeout = DEFAULT_TIMEOUT) + public void testDocumentView() throws Exception { - @Test(timeout = DEFAULT_TIMEOUT) - public void testDocumentView() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, "")); - pageVisit.verifyPageContent("Document View"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, "")); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, 3); - } + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, "")); + pageVisit.verifyPageContent("Document View"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, "")); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/MinistryViewTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/MinistryViewTest.java index ee3ccabbe70..37324be7518 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/MinistryViewTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/MinistryViewTest.java @@ -1,7 +1,5 @@ package com.hack23.cia.systemintegrationtest.user; -import static com.hack23.cia.systemintegrationtest.suites.TestConstants.DEFAULT_MAX_RETRIES; - import org.junit.Test; import org.junit.experimental.categories.Category; @@ -13,19 +11,14 @@ @Category(IntegrationTest.class) public class MinistryViewTest extends AbstractUITest { - - @Test(timeout = DEFAULT_TIMEOUT) - public void testMinistryView() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.OVERVIEW)); - pageVisit.verifyPageContent("Ministries"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.OVERVIEW)); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, DEFAULT_MAX_RETRIES); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void testMinistryView() throws Exception { + + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.OVERVIEW)); + pageVisit.verifyPageContent("Ministries"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.OVERVIEW)); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/PartyViewTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/PartyViewTest.java index d4908e858fe..2e7be8ca07b 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/PartyViewTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/PartyViewTest.java @@ -5,39 +5,28 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PartyPageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews; @Category(IntegrationTest.class) public final class PartyViewTest extends AbstractUITest { - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldViewPartyCommitteeRoles() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, - PartyPageMode.COMMITTEEROLES.toString(), "S")); - } catch (Exception e) { - throw new RuntimeException("Failed to visit party committee roles page", e); - } - pageVisit.verifyPageContent("Committee Roles"); - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldViewPartyDocumentHistory() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, - PartyPageMode.DOCUMENTHISTORY.toString(), "S")); - } catch (Exception e) { - e.printStackTrace(); - } - pageVisit.verifyPageContent("Document History"); - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - // ... other party view tests + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldViewPartyCommitteeRoles() throws Exception { + + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.COMMITTEEROLES.toString(), "S")); + pageVisit.verifyPageContent("Committee Roles"); + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldViewPartyDocumentHistory() throws Exception { + + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.DOCUMENTHISTORY.toString(), "S")); + pageVisit.verifyPageContent("Document History"); + } + + // ... other party view tests } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/PoliticianViewTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/PoliticianViewTest.java index 6e941501d73..33ac83fe828 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/PoliticianViewTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/PoliticianViewTest.java @@ -10,19 +10,14 @@ @Category(IntegrationTest.class) public class PoliticianViewTest extends AbstractUITest { - - @Test(timeout = DEFAULT_TIMEOUT) - public void testPoliticianView() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, "")); - pageVisit.verifyPageContent("Politicians"); - pageVisit.selectFirstGridRow(); - pageVisit.validatePage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, "")); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, 3); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void testPoliticianView() throws Exception { + + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, "")); + pageVisit.verifyPageContent("Politicians"); + pageVisit.selectFirstGridRow(); + pageVisit.validatePage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, "")); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/SearchViewTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/SearchViewTest.java index 3267bfc8251..e903c70c648 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/SearchViewTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/SearchViewTest.java @@ -1,7 +1,5 @@ package com.hack23.cia.systemintegrationtest.user; -import static com.hack23.cia.systemintegrationtest.suites.TestConstants.DEFAULT_MAX_RETRIES; - import org.junit.Test; import org.junit.experimental.categories.Category; @@ -13,15 +11,11 @@ @Category(IntegrationTest.class) public class SearchViewTest extends AbstractUITest { - @Test(timeout = DEFAULT_TIMEOUT) - public void testSearch() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.SEARCH_DOCUMENT_VIEW_NAME, "")); - pageVisit.verifyPageContent("Search"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, DEFAULT_MAX_RETRIES); - } + @Test(timeout = DEFAULT_TIMEOUT) + public void testSearch() throws Exception { + + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.SEARCH_DOCUMENT_VIEW_NAME, "")); + pageVisit.verifyPageContent("Search"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserAuthenticationTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserAuthenticationTest.java index adaefd9fe82..8bd5bddb282 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserAuthenticationTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserAuthenticationTest.java @@ -7,7 +7,7 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; +import com.hack23.cia.systemintegrationtest.ui.TestConstants; import com.hack23.cia.systemintegrationtest.ui.UserPageVisit; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ApplicationPageMode; @@ -15,169 +15,139 @@ @Category(IntegrationTest.class) public final class UserAuthenticationTest extends AbstractUITest { - private static final String EMAIL_SUFFIX = "@test.com"; - private static final String PATH_PREFIX = "main/"; - private static final String ERROR_USER_EXISTS = "USER_ALREADY_EXISTS"; - private static final String ERROR_INVALID_CREDENTIALS = "USERNAME_OR_PASSWORD_DO_NOT_MATCH"; - - - private String generatePassword() { - return "Test123!" + UUID.randomUUID().toString(); - } - - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldRegisterNewUser() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, - ApplicationPageMode.REGISTER.toString())); - - String username = UUID.randomUUID().toString(); - String password = generatePassword(); - - pageVisit.registerNewUser(username, password); - pageVisit.logoutUser(); - - UserPageVisit loginPageVisit = new UserPageVisit(driver); - loginPageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, - ApplicationPageMode.LOGIN.toString())); - loginPageVisit.loginUser(username + EMAIL_SUFFIX, password); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldRegisterUserWithWeakPasswordFail() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, - ApplicationPageMode.REGISTER.toString())); - - String username = UUID.randomUUID().toString(); - pageVisit.registerNewUserCheckView(username, "weak", - PATH_PREFIX + ApplicationPageMode.REGISTER.toString()); - pageVisit.checkNotificationMessage("Register failed:" + - "[Password must be 8 or more characters in length., Password must contain 1 or more uppercase characters., " - + - "Password must contain 1 or more digit characters., Password must contain 1 or more special characters.]"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldNotRegisterDuplicateUser() throws Exception { - retryOnFailure(() -> { - try { - String username = UUID.randomUUID().toString(); - String password = generatePassword(); - - // First registration - pageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, - ApplicationPageMode.REGISTER.toString())); - pageVisit.registerNewUser(username, password); - pageVisit.logoutUser(); - - // Try registering same user again - UserPageVisit secondRegisterVisit = new UserPageVisit(driver); - secondRegisterVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, - ApplicationPageMode.REGISTER.toString())); - secondRegisterVisit.registerNewUserCheckView(username, password, - PATH_PREFIX + ApplicationPageMode.REGISTER.toString()); - secondRegisterVisit.checkNotificationMessage("Register failed:" + - ERROR_USER_EXISTS); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldManageUserSecurity() throws Exception { - retryOnFailure(() -> { - try { - String username = UUID.randomUUID().toString(); - String password = generatePassword(); - String newPassword = generatePassword(); - - // Register and login - pageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, - ApplicationPageMode.REGISTER.toString())); - pageVisit.registerNewUser(username, password); - - // Security settings navigation - pageVisit.performClickAction(pageVisit.getMenuItem("Useraccount")); - pageVisit.performClickAction(pageVisit.getMenuItem("Security settings")); - - // Test password change - pageVisit.changePassword(password, newPassword, newPassword); - pageVisit.checkNotificationMessage("Password changed successfully"); - - // Test 2FA - pageVisit.enableGoogleAuthenticator(newPassword); - pageVisit.closeModal(); - pageVisit.disableGoogleAuthenticator(newPassword); - - // Verify login with new password - pageVisit.logoutUser(); - pageVisit.loginUser(username + EMAIL_SUFFIX, newPassword); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldFailLoginWithWrongPassword() throws Exception { - retryOnFailure(() -> { - try { - String username = UUID.randomUUID().toString(); - String password = generatePassword(); - - // Register user - pageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, - ApplicationPageMode.REGISTER.toString())); - pageVisit.registerNewUser(username, password); - pageVisit.logoutUser(); - - // Try wrong password - pageVisit.loginUserCheckView(username + EMAIL_SUFFIX, "wrongpassword", - PATH_PREFIX + ApplicationPageMode.LOGIN); - pageVisit.checkNotificationMessage("Login failed:" + - ERROR_INVALID_CREDENTIALS); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = TestConstants.DEFAULT_TIMEOUT) - public void shouldEnableAndDisableGoogleAuthenticator() throws Exception { - retryOnFailure(() -> { - try { - String username = UUID.randomUUID().toString(); - String password = generatePassword(); - - // Register and login - pageVisit.visitDirectPage(new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, - ApplicationPageMode.REGISTER.toString())); - pageVisit.registerNewUser(username, password); - - // Enable 2FA - pageVisit.performClickAction(pageVisit.getMenuItem("Useraccount")); - pageVisit.performClickAction(pageVisit.getMenuItem("Security settings")); - pageVisit.enableGoogleAuthenticator(password); - pageVisit.verifyPageContent("Two-factor authentication enabled"); - - // Disable 2FA - pageVisit.disableGoogleAuthenticator(password); - pageVisit.verifyPageContent("Two-factor authentication disabled"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } + private static final String EMAIL_SUFFIX = "@test.com"; + private static final String PATH_PREFIX = "main/"; + private static final String ERROR_USER_EXISTS = "USER_ALREADY_EXISTS"; + private static final String ERROR_INVALID_CREDENTIALS = "USERNAME_OR_PASSWORD_DO_NOT_MATCH"; + + private String generatePassword() { + return "Test123!" + UUID.randomUUID().toString(); + } + + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldRegisterNewUser() throws Exception { + + pageVisit.visitDirectPage( + new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString())); + + final String username = UUID.randomUUID().toString(); + final String password = generatePassword(); + + pageVisit.registerNewUser(username, password); + pageVisit.logoutUser(); + + final UserPageVisit loginPageVisit = new UserPageVisit(driver); + loginPageVisit.visitDirectPage( + new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.LOGIN.toString())); + loginPageVisit.loginUser(username + EMAIL_SUFFIX, password); + + } + + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldRegisterUserWithWeakPasswordFail() throws Exception { + + pageVisit.visitDirectPage( + new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString())); + + final String username = UUID.randomUUID().toString(); + pageVisit.registerNewUserCheckView(username, "weak", PATH_PREFIX + ApplicationPageMode.REGISTER.toString()); + pageVisit.checkNotificationMessage("Register failed:" + + "[Password must be 8 or more characters in length., Password must contain 1 or more uppercase characters., " + + "Password must contain 1 or more digit characters., Password must contain 1 or more special characters.]"); + + } + + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldNotRegisterDuplicateUser() throws Exception { + + final String username = UUID.randomUUID().toString(); + final String password = generatePassword(); + + // First registration + pageVisit.visitDirectPage( + new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString())); + pageVisit.registerNewUser(username, password); + pageVisit.logoutUser(); + + // Try registering same user again + final UserPageVisit secondRegisterVisit = new UserPageVisit(driver); + secondRegisterVisit.visitDirectPage( + new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString())); + secondRegisterVisit.registerNewUserCheckView(username, password, + PATH_PREFIX + ApplicationPageMode.REGISTER.toString()); + secondRegisterVisit.checkNotificationMessage("Register failed:" + ERROR_USER_EXISTS); + + } + + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldManageUserSecurity() throws Exception { + + final String username = UUID.randomUUID().toString(); + final String password = generatePassword(); + final String newPassword = generatePassword(); + + // Register and login + pageVisit.visitDirectPage( + new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString())); + pageVisit.registerNewUser(username, password); + + // Security settings navigation + pageVisit.performClickAction(pageVisit.getMenuItem("Useraccount")); + pageVisit.performClickAction(pageVisit.getMenuItem("Security settings")); + + // Test password change + pageVisit.changePassword(password, newPassword, newPassword); + pageVisit.checkNotificationMessage("Password changed successfully"); + + // Test 2FA + pageVisit.enableGoogleAuthenticator(newPassword); + pageVisit.closeModal(); + pageVisit.disableGoogleAuthenticator(newPassword); + + // Verify login with new password + pageVisit.logoutUser(); + pageVisit.loginUser(username + EMAIL_SUFFIX, newPassword); + + } + + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldFailLoginWithWrongPassword() throws Exception { + + final String username = UUID.randomUUID().toString(); + final String password = generatePassword(); + + // Register user + pageVisit.visitDirectPage( + new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString())); + pageVisit.registerNewUser(username, password); + pageVisit.logoutUser(); + + // Try wrong password + pageVisit.loginUserCheckView(username + EMAIL_SUFFIX, "wrongpassword", PATH_PREFIX + ApplicationPageMode.LOGIN); + pageVisit.checkNotificationMessage("Login failed:" + ERROR_INVALID_CREDENTIALS); + + } + + @Test(timeout = TestConstants.DEFAULT_TIMEOUT) + public void shouldEnableAndDisableGoogleAuthenticator() throws Exception { + + final String username = UUID.randomUUID().toString(); + final String password = generatePassword(); + + // Register and login + pageVisit.visitDirectPage( + new PageModeMenuCommand(CommonsViews.MAIN_VIEW_NAME, ApplicationPageMode.REGISTER.toString())); + pageVisit.registerNewUser(username, password); + + // Enable 2FA + pageVisit.performClickAction(pageVisit.getMenuItem("Useraccount")); + pageVisit.performClickAction(pageVisit.getMenuItem("Security settings")); + pageVisit.enableGoogleAuthenticator(password); + pageVisit.verifyPageContent("Two-factor authentication enabled"); + + // Disable 2FA + pageVisit.disableGoogleAuthenticator(password); + pageVisit.verifyPageContent("Two-factor authentication disabled"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserNavigationTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserNavigationTest.java index b53bb96695a..c198d18df38 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserNavigationTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserNavigationTest.java @@ -7,7 +7,6 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; import com.hack23.cia.web.impl.ui.application.action.ViewAction; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; @@ -15,112 +14,86 @@ @Category(IntegrationTest.class) public final class UserNavigationTest extends AbstractUITest { - // Constants for page modes - private static final String DOCUMENT_ACTIVITY = "DOCUMENTACTIVITY"; - private static final String ROLE_SUMMARY = "ROLESUMMARY"; - private static final String DECISION_FLOW_CHART = "DECISION_FLOW_CHART"; - private static final String RISK_SUMMARY = "RISK_SUMMARY"; - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigatePoliticianViews() throws Exception { - retryOnFailure(() -> { - try { - String politicianId = "0980681611418"; - - // Overview - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, - PageMode.OVERVIEW, politicianId)); - pageVisit.verifyPageContent("Politician"); - - // Document Activity - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, - DOCUMENT_ACTIVITY, politicianId)); - pageVisit.verifyPageContent("Document Activity"); - - // Role Summary - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, - ROLE_SUMMARY, politicianId)); - pageVisit.verifyPageContent("Role Summary"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigateParliamentViews() throws Exception { - retryOnFailure(() -> { - try { - // Overview - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.PARLIAMENT_RANKING_VIEW_NAME, - PageMode.OVERVIEW)); - pageVisit.verifyPageContent("Parliament"); - - // Decision Flow Chart - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.PARLIAMENT_RANKING_VIEW_NAME, - PageMode.CHARTS, DECISION_FLOW_CHART)); - pageVisit.verifyPageContent("Decision Flow"); - - // Risk Summary - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.PARLIAMENT_RANKING_VIEW_NAME, - PageMode.RULES, RISK_SUMMARY)); - pageVisit.selectFirstGridRow(); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigateCommitteeRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.VisitCommitteeRankingView(); - pageVisit.verifyPageContent("Committee Rankings"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigateMinistryRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.VisitMinistryRankingView(); - pageVisit.verifyPageContent("Ministry Rankings"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigatePartyRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.VisitPartyRankingView(); - pageVisit.verifyPageContent("Party Rankings"); - - List actionIdsBy = pageVisit.getActionIdsBy(ViewAction.VISIT_PARTY_VIEW); - assertTrue(actionIdsBy.size() > 0); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigatePoliticianRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.VisitPoliticianRankingView(); - pageVisit.verifyPageContent("Politician Rankings"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - // Other navigation tests... + // Constants for page modes + private static final String DOCUMENT_ACTIVITY = "DOCUMENTACTIVITY"; + private static final String ROLE_SUMMARY = "ROLESUMMARY"; + private static final String DECISION_FLOW_CHART = "DECISION_FLOW_CHART"; + private static final String RISK_SUMMARY = "RISK_SUMMARY"; + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigatePoliticianViews() throws Exception { + + final String politicianId = "0980681611418"; + + // Overview + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.OVERVIEW, politicianId)); + pageVisit.verifyPageContent("Politician"); + + // Document Activity + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, DOCUMENT_ACTIVITY, politicianId)); + pageVisit.verifyPageContent("Document Activity"); + + // Role Summary + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, ROLE_SUMMARY, politicianId)); + pageVisit.verifyPageContent("Role Summary"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigateParliamentViews() throws Exception { + + // Overview + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.PARLIAMENT_RANKING_VIEW_NAME, PageMode.OVERVIEW)); + pageVisit.verifyPageContent("Parliament"); + + // Decision Flow Chart + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.PARLIAMENT_RANKING_VIEW_NAME, PageMode.CHARTS, DECISION_FLOW_CHART)); + pageVisit.verifyPageContent("Decision Flow"); + + // Risk Summary + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.PARLIAMENT_RANKING_VIEW_NAME, PageMode.RULES, RISK_SUMMARY)); + pageVisit.selectFirstGridRow(); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigateCommitteeRanking() throws Exception { + + pageVisit.VisitCommitteeRankingView(); + pageVisit.verifyPageContent("Committee Rankings"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigateMinistryRanking() throws Exception { + + pageVisit.VisitMinistryRankingView(); + pageVisit.verifyPageContent("Ministry Rankings"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigatePartyRanking() throws Exception { + + pageVisit.VisitPartyRankingView(); + pageVisit.verifyPageContent("Party Rankings"); + + final List actionIdsBy = pageVisit.getActionIdsBy(ViewAction.VISIT_PARTY_VIEW); + assertTrue(actionIdsBy.size() > 0); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigatePoliticianRanking() throws Exception { + + pageVisit.VisitPoliticianRankingView(); + pageVisit.verifyPageContent("Politician Rankings"); + + } + + // Other navigation tests... } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserRoleSystemITest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserRoleSystemITest.java index c04728f7818..a354395dd08 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserRoleSystemITest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/UserRoleSystemITest.java @@ -23,7 +23,6 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserHomePageMode; @@ -32,49 +31,35 @@ @Category(IntegrationTest.class) public final class UserRoleSystemITest extends AbstractUITest { + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldViewMinistryContent() throws Exception { - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldViewMinistryContent() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, - PageMode.OVERVIEW, "N%C3%A4ringsdepartementet")); - pageVisit.verifyPageContent("Ministry"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.MINISTRY_VIEW_NAME, PageMode.OVERVIEW, "N%C3%A4ringsdepartementet")); + pageVisit.verifyPageContent("Ministry"); - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldViewPartyContent() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, - PageMode.OVERVIEW, "S")); - pageVisit.verifyPageContent("Party"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } + } - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldHandleUnauthorizedAccess() throws Exception { - retryOnFailure(() -> { - try { - // Test user events access - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, - UserHomePageMode.USER_EVENTS.toString())); - pageVisit.verifyPageContent("Access denied:userhome"); + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldViewPartyContent() throws Exception { - // Test security settings access - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, - UserHomePageMode.SECURITY_SETTINGS.toString())); - pageVisit.verifyPageContent("Access denied:userhome"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PageMode.OVERVIEW, "S")); + pageVisit.verifyPageContent("Party"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldHandleUnauthorizedAccess() throws Exception { + + // Test user events access + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, UserHomePageMode.USER_EVENTS.toString())); + pageVisit.verifyPageContent("Access denied:userhome"); + + // Test security settings access + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.USERHOME_VIEW_NAME, UserHomePageMode.SECURITY_SETTINGS.toString())); + pageVisit.verifyPageContent("Access denied:userhome"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewNavigationTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewNavigationTest.java index 76db8a21f62..aea9ec49e98 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewNavigationTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewNavigationTest.java @@ -5,7 +5,6 @@ import com.hack23.cia.systemintegrationtest.AbstractUITest; import com.hack23.cia.systemintegrationtest.categories.IntegrationTest; -import com.hack23.cia.systemintegrationtest.suites.TestConstants; import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PoliticianPageMode; @@ -13,71 +12,51 @@ @Category(IntegrationTest.class) public final class ViewNavigationTest extends AbstractUITest { - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigateCommitteeRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.VisitCommitteeRankingView(); - pageVisit.verifyPageContent("Committee Rankings"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigateMinistryRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.VisitMinistryRankingView(); - pageVisit.verifyPageContent("Ministry Rankings"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigatePartyRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.VisitPartyRankingView(); - pageVisit.verifyPageContent("Party Rankings"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigatePoliticianRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.VisitPoliticianRankingView(); - pageVisit.verifyPageContent("Politician Rankings"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldNavigatePoliticianViews() throws Exception { - retryOnFailure(() -> { - try { - String politicianId = "0980681611418"; - - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, - PageMode.OVERVIEW.toString(), politicianId)); - pageVisit.verifyPageContent("Politician"); - - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, - PoliticianPageMode.DOCUMENTACTIVITY.toString(), politicianId)); - pageVisit.verifyPageContent("Document Activity"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, TestConstants.DEFAULT_MAX_RETRIES); - } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigateCommitteeRanking() throws Exception { + + pageVisit.VisitCommitteeRankingView(); + pageVisit.verifyPageContent("Committee Rankings"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigateMinistryRanking() throws Exception { + + pageVisit.VisitMinistryRankingView(); + pageVisit.verifyPageContent("Ministry Rankings"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigatePartyRanking() throws Exception { + + pageVisit.VisitPartyRankingView(); + pageVisit.verifyPageContent("Party Rankings"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigatePoliticianRanking() throws Exception { + + pageVisit.VisitPoliticianRankingView(); + pageVisit.verifyPageContent("Politician Rankings"); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldNavigatePoliticianViews() throws Exception { + + final String politicianId = "0980681611418"; + + pageVisit.visitDirectPage( + new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.OVERVIEW.toString(), politicianId)); + pageVisit.verifyPageContent("Politician"); + + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, + PoliticianPageMode.DOCUMENTACTIVITY.toString(), politicianId)); + pageVisit.verifyPageContent("Document Activity"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewPageTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewPageTest.java index 7307b92e0c9..31847ee684e 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewPageTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewPageTest.java @@ -1,7 +1,5 @@ package com.hack23.cia.systemintegrationtest.user; -import static com.hack23.cia.systemintegrationtest.suites.TestConstants.DEFAULT_MAX_RETRIES; - import org.junit.Test; import org.junit.experimental.categories.Category; @@ -11,38 +9,24 @@ @Category(IntegrationTest.class) public final class ViewPageTest extends AbstractUITest { - private static final ViewAction[] VIEW_ACTIONS = { - ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, - ViewAction.VISIT_ADMIN_DATA_SUMMARY_VIEW, - ViewAction.VISIT_POLITICIAN_RANKING_VIEW, - ViewAction.VISIT_PARTY_RANKING_VIEW, - ViewAction.VISIT_MINISTRY_RANKING_VIEW, - ViewAction.VISIT_COMMITTEE_RANKING_VIEW, - ViewAction.VISIT_COUNTRY_VIEW - }; - - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldViewMainPage() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitMainView(); - pageVisit.verifyViewActions(VIEW_ACTIONS); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, DEFAULT_MAX_RETRIES); - } - - @Test(timeout = DEFAULT_TIMEOUT) - public void shouldViewStartPage() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitStartPage(); - pageVisit.verifyPageContent("Citizen Intelligence Agency"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, DEFAULT_MAX_RETRIES); - } + private static final ViewAction[] VIEW_ACTIONS = { ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, + ViewAction.VISIT_ADMIN_DATA_SUMMARY_VIEW, ViewAction.VISIT_POLITICIAN_RANKING_VIEW, + ViewAction.VISIT_PARTY_RANKING_VIEW, ViewAction.VISIT_MINISTRY_RANKING_VIEW, + ViewAction.VISIT_COMMITTEE_RANKING_VIEW, ViewAction.VISIT_COUNTRY_VIEW }; + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldViewMainPage() throws Exception { + + pageVisit.visitMainView(); + pageVisit.verifyViewActions(VIEW_ACTIONS); + + } + + @Test(timeout = DEFAULT_TIMEOUT) + public void shouldViewStartPage() throws Exception { + + pageVisit.visitStartPage(); + pageVisit.verifyPageContent("Citizen Intelligence Agency"); + + } } diff --git a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewRankingTest.java b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewRankingTest.java index 12d962dd4c5..409fa0a5cd8 100644 --- a/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewRankingTest.java +++ b/citizen-intelligence-agency/src/test/java/com/hack23/cia/systemintegrationtest/user/ViewRankingTest.java @@ -10,18 +10,11 @@ @Category(IntegrationTest.class) public class ViewRankingTest extends AbstractUITest { - private static final int DEFAULT_MAX_RETRIES = 3; + @Test(timeout = DEFAULT_TIMEOUT) + public void testViewRanking() throws Exception { + pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_RANKING_VIEW_NAME, "")); + pageVisit.verifyPageContent("Ranking"); - @Test(timeout = DEFAULT_TIMEOUT) - public void testViewRanking() throws Exception { - retryOnFailure(() -> { - try { - pageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.GOVERNMENT_BODY_RANKING_VIEW_NAME, "")); - pageVisit.verifyPageContent("Ranking"); - } catch (Exception e) { - throw new RuntimeException(e); - } - }, DEFAULT_MAX_RETRIES); - } + } } diff --git a/citizen-intelligence-agency/src/test/resources/logback-test.xml b/citizen-intelligence-agency/src/test/resources/logback-test.xml index 2470de57857..2622aa2eabd 100644 --- a/citizen-intelligence-agency/src/test/resources/logback-test.xml +++ b/citizen-intelligence-agency/src/test/resources/logback-test.xml @@ -1,42 +1,45 @@ - - - - %date [%thread] %-5level %logger{5} - %msg%n - + + + %date [%thread] %-5level %logger{5} - %msg%n + + - - - - - - + - - - - + + - + + + + - - - + - - - + + + - + - - - + + + + + + + + + + \ No newline at end of file diff --git a/encrypt.properties/src/test/resources/logback-test.xml b/encrypt.properties/src/test/resources/logback-test.xml index b3e6b05c103..f312c51fbaf 100755 --- a/encrypt.properties/src/test/resources/logback-test.xml +++ b/encrypt.properties/src/test/resources/logback-test.xml @@ -1,7 +1,6 @@ - + + diff --git a/model.common.impl/src/test/resources/logback-test.xml b/model.common.impl/src/test/resources/logback-test.xml index b3e6b05c103..a0d35f2de6f 100755 --- a/model.common.impl/src/test/resources/logback-test.xml +++ b/model.common.impl/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ - + - + diff --git a/model.external.riksdagen.dokumentlista.impl/src/test/resources/logback-test.xml b/model.external.riksdagen.dokumentlista.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.riksdagen.dokumentlista.impl/src/test/resources/logback-test.xml +++ b/model.external.riksdagen.dokumentlista.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.riksdagen.dokumentstatus.impl/src/test/resources/logback-test.xml b/model.external.riksdagen.dokumentstatus.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.riksdagen.dokumentstatus.impl/src/test/resources/logback-test.xml +++ b/model.external.riksdagen.dokumentstatus.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.riksdagen.person.impl/src/test/resources/logback-test.xml b/model.external.riksdagen.person.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.riksdagen.person.impl/src/test/resources/logback-test.xml +++ b/model.external.riksdagen.person.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.riksdagen.personlista.impl/src/test/resources/logback-test.xml b/model.external.riksdagen.personlista.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.riksdagen.personlista.impl/src/test/resources/logback-test.xml +++ b/model.external.riksdagen.personlista.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.riksdagen.utskottsforslag.impl/src/test/resources/logback-test.xml b/model.external.riksdagen.utskottsforslag.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.riksdagen.utskottsforslag.impl/src/test/resources/logback-test.xml +++ b/model.external.riksdagen.utskottsforslag.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.riksdagen.votering.impl/src/test/resources/logback-test.xml b/model.external.riksdagen.votering.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.riksdagen.votering.impl/src/test/resources/logback-test.xml +++ b/model.external.riksdagen.votering.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.riksdagen.voteringlista.impl/src/test/resources/logback-test.xml b/model.external.riksdagen.voteringlista.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.riksdagen.voteringlista.impl/src/test/resources/logback-test.xml +++ b/model.external.riksdagen.voteringlista.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.val.kommunvalkrets.impl/src/test/resources/logback-test.xml b/model.external.val.kommunvalkrets.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.val.kommunvalkrets.impl/src/test/resources/logback-test.xml +++ b/model.external.val.kommunvalkrets.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.val.landstingvalkrets.impl/src/test/resources/logback-test.xml b/model.external.val.landstingvalkrets.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.val.landstingvalkrets.impl/src/test/resources/logback-test.xml +++ b/model.external.val.landstingvalkrets.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.val.partier.impl/src/test/resources/logback-test.xml b/model.external.val.partier.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.val.partier.impl/src/test/resources/logback-test.xml +++ b/model.external.val.partier.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.val.riksdagsvalkrets.impl/src/test/resources/logback-test.xml b/model.external.val.riksdagsvalkrets.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.val.riksdagsvalkrets.impl/src/test/resources/logback-test.xml +++ b/model.external.val.riksdagsvalkrets.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.worldbank.countries.impl/src/test/resources/logback-test.xml b/model.external.worldbank.countries.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.worldbank.countries.impl/src/test/resources/logback-test.xml +++ b/model.external.worldbank.countries.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.worldbank.data.impl/src/test/resources/logback-test.xml b/model.external.worldbank.data.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.worldbank.data.impl/src/test/resources/logback-test.xml +++ b/model.external.worldbank.data.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.worldbank.indicators.impl/src/test/resources/logback-test.xml b/model.external.worldbank.indicators.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.worldbank.indicators.impl/src/test/resources/logback-test.xml +++ b/model.external.worldbank.indicators.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.external.worldbank.topic.impl/src/test/resources/logback-test.xml b/model.external.worldbank.topic.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.external.worldbank.topic.impl/src/test/resources/logback-test.xml +++ b/model.external.worldbank.topic.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/model.internal.application.user.impl/src/test/resources/logback-test.xml b/model.internal.application.user.impl/src/test/resources/logback-test.xml index 6ee705e6670..74b79f17674 100755 --- a/model.internal.application.user.impl/src/test/resources/logback-test.xml +++ b/model.internal.application.user.impl/src/test/resources/logback-test.xml @@ -1,6 +1,6 @@ - + diff --git a/parent-pom/pom.xml b/parent-pom/pom.xml index 3673aa575c6..2caafc67192 100644 --- a/parent-pom/pom.xml +++ b/parent-pom/pom.xml @@ -87,7 +87,7 @@ 2.6 1.13.0 1.17.2 - 1.80 + 1.79 2.0.16 2.30.0 1.5.16 diff --git a/service.api/src/test/resources/logback-test.xml b/service.api/src/test/resources/logback-test.xml index b80841a7205..973de2c0e90 100644 --- a/service.api/src/test/resources/logback-test.xml +++ b/service.api/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ - + diff --git a/service.component.agent.impl/src/test/resources/logback-test.xml b/service.component.agent.impl/src/test/resources/logback-test.xml index 2d8d7262332..3c847ae09b8 100644 --- a/service.component.agent.impl/src/test/resources/logback-test.xml +++ b/service.component.agent.impl/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ - + diff --git a/service.data.impl/src/test/resources/logback-test.xml b/service.data.impl/src/test/resources/logback-test.xml index b80841a7205..973de2c0e90 100644 --- a/service.data.impl/src/test/resources/logback-test.xml +++ b/service.data.impl/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ - + diff --git a/service.external.common/src/test/resources/logback-test.xml b/service.external.common/src/test/resources/logback-test.xml index 17110d208f0..f362c509208 100755 --- a/service.external.common/src/test/resources/logback-test.xml +++ b/service.external.common/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ - + diff --git a/service.external.esv/src/test/resources/logback-test.xml b/service.external.esv/src/test/resources/logback-test.xml index b3e6b05c103..a0d35f2de6f 100755 --- a/service.external.esv/src/test/resources/logback-test.xml +++ b/service.external.esv/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ - + - + - + - + - + diff --git a/web-widgets/src/test/resources/logback-test.xml b/web-widgets/src/test/resources/logback-test.xml index b3e6b05c103..a0d35f2de6f 100755 --- a/web-widgets/src/test/resources/logback-test.xml +++ b/web-widgets/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ - +