View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.fit.console;
20  
21  import org.apache.syncope.client.console.pages.Dashboard;
22  import org.apache.syncope.client.console.pages.Engagements;
23  import org.apache.syncope.client.console.pages.Login;
24  import org.apache.syncope.client.console.pages.Logs;
25  import org.apache.syncope.client.console.pages.Notifications;
26  import org.apache.syncope.client.console.pages.Policies;
27  import org.apache.syncope.client.console.pages.Realms;
28  import org.apache.syncope.client.console.pages.Reports;
29  import org.apache.syncope.client.console.pages.Security;
30  import org.apache.syncope.client.console.pages.Types;
31  import org.apache.syncope.client.console.topology.Topology;
32  import org.junit.jupiter.api.Test;
33  
34  // Please, keep the class name as is in order to respect the execution order. It seems that from wicket 7.5.0 the 
35  // session created never expire and the unsuccessfulLogin test fail
36  public class AjaxBrowseITCase extends AbstractConsoleITCase {
37  
38      @Test
39      public void loginPage() {
40          TESTER.startPage(Login.class);
41          TESTER.assertRenderedPage(Login.class);
42      }
43  
44      @Test
45      public void successfulLogin() {
46          doLogin(ADMIN_UNAME, ADMIN_PWD);
47          TESTER.assertRenderedPage(Dashboard.class);
48      }
49  
50      @Test
51      public void unsuccessfulLogin() {
52          doLogin(ADMIN_UNAME, ADMIN_PWD + 1);
53          TESTER.assertRenderedPage(Login.class);
54      }
55  
56      @Test
57      public void browsingBookmarkablePageLink() {
58          doLogin(ADMIN_UNAME, ADMIN_PWD);
59  
60          TESTER.assertRenderedPage(Dashboard.class);
61  
62          TESTER.clickLink("body:realmsLI:realms", false);
63          TESTER.assertRenderedPage(Realms.class);
64  
65          TESTER.clickLink("body:idmPages:0:idmPageLI:idmPage", false);
66          TESTER.assertRenderedPage(Topology.class);
67  
68          TESTER.clickLink("body:engagementsLI:engagements", false);
69          TESTER.assertRenderedPage(Engagements.class);
70  
71          TESTER.clickLink("body:reportsLI:reports", false);
72          TESTER.assertRenderedPage(Reports.class);
73  
74          TESTER.clickLink("body:configurationLI:configurationUL:logsLI:logs", false);
75          TESTER.assertRenderedPage(Logs.class);
76  
77          TESTER.clickLink("body:configurationLI:configurationUL:typesLI:types", false);
78          TESTER.assertRenderedPage(Types.class);
79  
80          TESTER.clickLink("body:configurationLI:configurationUL:securityLI:security", false);
81          TESTER.assertRenderedPage(Security.class);
82  
83          TESTER.clickLink("body:configurationLI:configurationUL:policiesLI:policies", false);
84          TESTER.assertRenderedPage(Policies.class);
85  
86          TESTER.clickLink("body:configurationLI:configurationUL:notificationsLI:notifications", false);
87          TESTER.assertRenderedPage(Notifications.class);
88      }
89  }