001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.tests.browser;
034:
035: import static org.testng.Assert.assertTrue;
036: import org.testng.annotations.Test;
037:
038: /**
039: * <p>
040: * Basic backend test cases.
041: * </p>
042: *
043: * @author Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
044: * @version $Rev: 229 $
045: */
046: public class AdmBasicBrowserTest extends AbstractBackendBrowserTest {
047: /**
048: * All admin pages.
049: *
050: * To get the list of admin pages, execute
051: * <pre>grep -o "\"\/.*jsf\"" src/ui/jsf/web/adm/main/navigation.xhtml</pre>
052: */
053: private static final String[] ADMIN_PAGES = {
054: "/adm/main/account/overview.jsf",
055: "/adm/main/account/create.jsf",
056: "/adm/main/userGroup/overview.jsf",
057: "/adm/main/userGroup/new.jsf",
058: "/adm/main/mandator/overview.jsf",
059: "/adm/main/mandator/create.jsf",
060: "/adm/main/acl/aclOverview.jsf",
061: "/adm/main/acl/aclCreate.jsf",
062: "/adm/main/workflow/overview.jsf",
063: "/adm/main/workflow/create.jsf",
064: "/adm/main/workflow/stepDefinition/overview.jsf",
065: "/adm/main/workflow/stepDefinition/edit.jsf",
066: "/adm/main/template/contentTemplateOverview.jsf",
067: "/adm/main/template/masterTemplateOverview.jsf",
068: "/adm/main/template/tagOverview.jsf",
069: "/adm/main/sqlsearch/search.jsf", "/adm/search/query.jsf",
070: "/adm/content/contentEditor.jsf",
071: "/adm/content/createTestData.jsf",
072: "/adm/main/scripting/overview.jsf",
073: "/adm/main/scripting/create.jsf",
074: "/adm/main/scripting/scriptConsole.jsf",
075: "/adm/main/system/systemInfo.jsf",
076: "/adm/main/system/languages.jsf",
077: "/adm/main/selectList/overview.jsf",
078: "/adm/main/selectList/create.jsf" };
079:
080: /**
081: * Logs in into the backend, then logs out again.
082: */
083: @Test(groups="browser")
084: public void loginLogout() {
085: loginSupervisor();
086: try {
087: Thread.sleep(2000);
088: } catch (InterruptedException e) {
089: // ignore
090: }
091: logout();
092: }
093:
094: /**
095: * Clicks on all navigation tabs.
096: */
097: @Test(groups="browser")
098: public void basicNavigation() {
099: try {
100: loginSupervisor();
101:
102: // search/briefcase tab
103: navigateTo(NavigationTab.Search);
104: assertTrue(selenium.isTextPresent("Search queries"));
105: assertTrue(selenium.isTextPresent("Create new Briefcase"));
106:
107: // admin tab
108: navigateTo(NavigationTab.Administration);
109: assertTrue(selenium.isTextPresent("Accounts"));
110: assertTrue(selenium.isTextPresent("Groups"));
111:
112: // structure tab
113: navigateTo(NavigationTab.Structure);
114: assertTrue(selenium.isTextPresent("ROOT"));
115: assertTrue(selenium.isTextPresent("ACL"));
116: assertTrue(selenium.isTextPresent("Workflow Step"));
117:
118: // content tab
119: navigateTo(NavigationTab.Content);
120: assertTrue(selenium.isTextPresent("Root ["));
121: } finally {
122: logout();
123: }
124: }
125:
126: /**
127: * Load all admin pages.
128: */
129: @Test(groups="browser")
130: public void loadAdminPages() {
131: try {
132: loginSupervisor();
133: navigateTo(NavigationTab.Administration);
134: for (String page : ADMIN_PAGES) {
135: loadContentPage(page);
136: }
137: } finally {
138: logout();
139: }
140: }
141: }
|