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.Engagements;
22  import org.apache.wicket.markup.html.form.TextField;
23  import org.apache.wicket.util.tester.FormTester;
24  import org.junit.jupiter.api.BeforeEach;
25  import org.junit.jupiter.api.Test;
26  
27  public class EngagementsITCase extends AbstractConsoleITCase {
28  
29      private static final String SCHED_TASK_FORM =
30              "body:content:tabbedPanel:panel:firstLevelContainer:first:outerObjectsRepeater:0:outer:form:content:form";
31  
32      @BeforeEach
33      public void login() {
34          doLogin(ADMIN_UNAME, ADMIN_PWD);
35          TESTER.clickLink("body:engagementsLI:engagements", false);
36          TESTER.assertRenderedPage(Engagements.class);
37      }
38  
39      @Test
40      public void createSchedTask() {
41          TESTER.clickLink("body:content:tabbedPanel:panel:firstLevelContainer:first:container:content:add");
42  
43          FormTester formTester = TESTER.newFormTester(SCHED_TASK_FORM);
44          formTester.setValue("view:name:textField", "test");
45          formTester.select("view:jobDelegate:dropDownChoiceField", 0);
46  
47          formTester.submit("buttons:next");
48          TESTER.cleanupFeedbackMessages();
49  
50          formTester = TESTER.newFormTester(SCHED_TASK_FORM);
51  
52          TESTER.assertComponent(SCHED_TASK_FORM + ":view:schedule:seconds:textField", TextField.class);
53  
54          formTester.submit("buttons:finish");
55          TESTER.cleanupFeedbackMessages();
56      }
57  }