/* $Id$ */

/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.manifoldcf.filesystem_tests;

import org.apache.manifoldcf.core.interfaces.*;
import org.apache.manifoldcf.agents.interfaces.*;
import org.apache.manifoldcf.crawler.interfaces.*;
import org.apache.manifoldcf.crawler.system.ManifoldCF;

import java.io.*;
import java.util.*;
import org.junit.*;

import org.apache.manifoldcf.core.tests.HTMLTester;

/** Basic UI navigation tests */
public class NavigationUI extends BaseUIDerby
{

  @Test
  public void createConnectionsAndJob()
    throws Exception
  {
    testerInstance.newTest();
    HTMLTester.Window window;
    HTMLTester.Link link;
    window = testerInstance.openMainWindow("http://localhost:8346/mcf-crawler-ui/index.jsp",Locale.US);
    // Define an output connection via the UI
    link = window.findLink(testerInstance.createStringDescription("List output connections"));
    link.click();
    window = testerInstance.findWindow(null);
    link = window.findLink(testerInstance.createStringDescription("Add an output connection"));
    link.click();
    window = testerInstance.findWindow(null);
    
    testerInstance.executeTest();
  }
  
}

@@ -1335,24 +1335,29 @@
 .newTest();%0A
+    %0A
     HTMLTest
@@ -1400,16 +1400,147 @@
 k link;%0A
+    HTMLTester.Form form;%0A    HTMLTester.Textarea textarea;%0A    HTMLTester.Selectbox selectbox;%0A    HTMLTester.Button button;%0A    %0A
     wind
@@ -1635,16 +1635,21 @@
 le.US);%0A
+    %0A
     // D
@@ -1951,32 +1951,54 @@
   link.click();%0A
+    // Fill in a name%0A
     window = tes
@@ -2023,24 +2023,1812 @@
 ndow(null);%0A
+    form = window.findForm(testerInstance.createStringDescription(%22editconnection%22));%0A    textarea = form.findTextarea(testerInstance.createStringDescription(%22connname%22));%0A    textarea.setValue(testerInstance.createStringDescription(%22MyOutputConnection%22));%0A    link = window.findLink(testerInstance.createStringDescription(%22Type tab%22));%0A    link.click();%0A    // Select a type%0A    window = testerInstance.findWindow(null);%0A    form = window.findForm(testerInstance.createStringDescription(%22editconnection%22));%0A    selectbox = form.findSelectbox(testerInstance.createStringDescription(%22classname%22));%0A    selectbox.selectValue(testerInstance.createStringDescription(%22org.apache.manifoldcf.agents.output.nullconnector.NullConnector%22));%0A    button = window.findButton(testerInstance.createStringDescription(%22Continue to next page%22));%0A    button.click();%0A    // Visit the Throttling tab%0A    window = testerInstance.findWindow(null);%0A    link = window.findLink(testerInstance.createStringDescription(%22Throttling tab%22));%0A    link.click();%0A    // Go back to the Name tab%0A    window = testerInstance.findWindow(null);%0A    link = window.findLink(testerInstance.createStringDescription(%22Name tab%22));%0A    link.click();%0A    // Now save the connection.%0A    window = testerInstance.findWindow(null);%0A    button = window.findButton(testerInstance.createStringDescription(%22Save this output connection%22));%0A    button.click();%0A    %0A    %0A    // MHL%0A    %0A    // Delete the output connection%0A    window = testerInstance.findWindow(null);%0A    link = window.findLink(testerInstance.createStringDescription(%22List output connections%22));%0A    link.click();%0A    window = testerInstance.findWindow(null);%0A    link = window.findLink(testerInstance.createStringDescription(%22Delete MyOutputConnection%22));%0A    link.click();%0A
     %0A    tes

Complete output connection part of UI navigation test. Part of CONNECTORS-339.