manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1788044 - /manifoldcf/branches/CONNECTORS-1196-2/connectors/ldap/connector/src/test/java/org/apache/manifoldcf/authorities/authorities/ldap/tests/NavigationHSQLDBUI.java
Date Wed, 22 Mar 2017 00:18:47 GMT
Author: kwright
Date: Wed Mar 22 00:18:47 2017
New Revision: 1788044

URL: http://svn.apache.org/viewvc?rev=1788044&view=rev
Log:
Convert LDAP authority test

Modified:
    manifoldcf/branches/CONNECTORS-1196-2/connectors/ldap/connector/src/test/java/org/apache/manifoldcf/authorities/authorities/ldap/tests/NavigationHSQLDBUI.java

Modified: manifoldcf/branches/CONNECTORS-1196-2/connectors/ldap/connector/src/test/java/org/apache/manifoldcf/authorities/authorities/ldap/tests/NavigationHSQLDBUI.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196-2/connectors/ldap/connector/src/test/java/org/apache/manifoldcf/authorities/authorities/ldap/tests/NavigationHSQLDBUI.java?rev=1788044&r1=1788043&r2=1788044&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196-2/connectors/ldap/connector/src/test/java/org/apache/manifoldcf/authorities/authorities/ldap/tests/NavigationHSQLDBUI.java
(original)
+++ manifoldcf/branches/CONNECTORS-1196-2/connectors/ldap/connector/src/test/java/org/apache/manifoldcf/authorities/authorities/ldap/tests/NavigationHSQLDBUI.java
Wed Mar 22 00:18:47 2017
@@ -27,7 +27,7 @@ import java.io.*;
 import java.util.*;
 import org.junit.*;
 
-import org.apache.manifoldcf.core.tests.HTMLTester;
+import org.apache.manifoldcf.core.tests.SeleniumTester;
 
 /** Basic UI navigation tests */
 public class NavigationHSQLDBUI extends BaseUIHSQLDB
@@ -37,94 +37,64 @@ public class NavigationHSQLDBUI extends
   public void createConnectionsAndJob()
     throws Exception
   {
-/*
-    testerInstance.newTest(Locale.US);
-    
-    HTMLTester.Window window;
-    HTMLTester.Link link;
-    HTMLTester.Form form;
-    HTMLTester.Textarea textarea;
-    HTMLTester.Selectbox selectbox;
-    HTMLTester.Button button;
-    HTMLTester.Radiobutton radiobutton;
-    HTMLTester.Loop loop;
-    
-    window = testerInstance.openMainWindow("http://localhost:8346/mcf-crawler-ui/index.jsp");
+    testerInstance.start(SeleniumTester.BrowserType.CHROME, "en-US", "http://localhost:8346/mcf-crawler-ui/index.jsp");
+
+    //Login
+    testerInstance.waitForElementWithName("loginform");
+    testerInstance.setValue("userID","admin");
+    testerInstance.setValue("password","admin");
+    testerInstance.clickButton("Login");
+    testerInstance.verifyHeader("Welcome to Apache ManifoldCF™");
+
+    // Add an authority group
+    testerInstance.navigateTo("List authority groups");
+    testerInstance.clickButton("Add a new authority group");
+
+    // Fill in a name
+    testerInstance.waitForElementWithName("groupname");
+    testerInstance.setValue("groupname","MyAuthorityGroup");
+
+    // Save the authority group
+    testerInstance.clickButton("Save");
+    testerInstance.verifyThereIsNoError();
+
+    // Add an authority
+    testerInstance.navigateTo("List authorities");
+    testerInstance.clickButton("Add a new connection");
 
-    // Login
-    form = window.findForm(testerInstance.createStringDescription("loginform"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("userID"));
-    textarea.setValue(testerInstance.createStringDescription("admin"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("password"));
-    textarea.setValue(testerInstance.createStringDescription("admin"));
-    button = window.findButton(testerInstance.createStringDescription("Login"));
-    button.click();
-    window = testerInstance.findWindow(null);
-
-    // Define an authority connection via the UI
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("List authority groups"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Add new authority group"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editgroup"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("groupname"));
-    textarea.setValue(testerInstance.createStringDescription("MyAuthorityConnection"));
-    button = window.findButton(testerInstance.createStringDescription("Save this authority
group"));
-    button.click();
-
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("List authorities"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Add a new connection"));
-    link.click();
     // Fill in a name
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editconnection"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("connname"));
-    textarea.setValue(testerInstance.createStringDescription("MyAuthorityConnection"));
-    link = window.findLink(testerInstance.createStringDescription("Type tab"));
-    link.click();
+    testerInstance.waitForElementWithName("connname");
+    testerInstance.setValue("connname","MyAuthorityConnection");
+
     // Select a type
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editconnection"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("classname"));
-    selectbox.selectValue(testerInstance.createStringDescription("org.apache.manifoldcf.authorities.authorities.ldap.LDAPAuthority"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("authoritygroup"));
-    selectbox.selectValue(testerInstance.createStringDescription("MyAuthorityConnection"));
-    button = window.findButton(testerInstance.createStringDescription("Continue to next page"));
-    button.click();
-    // Server tab
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("LDAP tab"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editconnection"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("ldapServerName"));
-    textarea.setValue(testerInstance.createStringDescription("localhost"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("ldapServerBase"));
-    textarea.setValue(testerInstance.createStringDescription("dc=localhost"));
-    // Go back to the Name tab
-    link = window.findLink(testerInstance.createStringDescription("Name tab"));
-    link.click();
-    // Now save the connection.
-    window = testerInstance.findWindow(null);
-    button = window.findButton(testerInstance.createStringDescription("Save this authority
connection"));
-    button.click();
+    testerInstance.clickTab("Type");
+    testerInstance.selectValue("classname","org.apache.manifoldcf.authorities.authorities.ldap.LDAPAuthority");
+    testerInstance.selectValue("authoritygroup", "MyAuthorityGroup");
+    testerInstance.clickButton("Continue");
+    
+    // Visit LDAP tab
+    testerInstance.clickTab("LDAP");
+    testerInstance.setValue("ldapServerName", "localhost");
+    testerInstance.setValue("ldapServerBase", "dc=localhost");
+    
+    // Back to the name tab
+    testerInstance.clickTab("Name");
+    
+    // Now, save
+    testerInstance.clickButton("Save");
+    testerInstance.verifyThereIsNoError();
 
     // Delete the authority connection
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("List authorities"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Delete MyAuthorityConnection"));
-    link.click();
+    testerInstance.navigateTo("List authorities");
+    testerInstance.clickButtonByTitle("Delete MyAuthorityConnection");
+    testerInstance.acceptAlert();
+
+    // Delete the authority group
+    testerInstance.navigateTo("List authority groups");
+    testerInstance.clickButtonByTitle("Delete MyAuthorityGroup");
+    testerInstance.acceptAlert();
+    
 
-    testerInstance.executeTest();
-*/
   }
   
 }



Mime
View raw message