manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kish...@apache.org
Subject svn commit: r1788162 - in /manifoldcf/branches/CONNECTORS-1196-2: connectors/kafka/connector/src/test/java/org/apache/manifoldcf/agents/output/kafka/NavigationHSQLDBUI.java framework/core/src/test/java/org/apache/manifoldcf/core/tests/SeleniumTester.java
Date Wed, 22 Mar 2017 21:11:32 GMT
Author: kishore
Date: Wed Mar 22 21:11:31 2017
New Revision: 1788162

URL: http://svn.apache.org/viewvc?rev=1788162&view=rev
Log:
Update SeleniumTester to clear inputs and update kafka tests.

Modified:
    manifoldcf/branches/CONNECTORS-1196-2/connectors/kafka/connector/src/test/java/org/apache/manifoldcf/agents/output/kafka/NavigationHSQLDBUI.java
    manifoldcf/branches/CONNECTORS-1196-2/framework/core/src/test/java/org/apache/manifoldcf/core/tests/SeleniumTester.java

Modified: manifoldcf/branches/CONNECTORS-1196-2/connectors/kafka/connector/src/test/java/org/apache/manifoldcf/agents/output/kafka/NavigationHSQLDBUI.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196-2/connectors/kafka/connector/src/test/java/org/apache/manifoldcf/agents/output/kafka/NavigationHSQLDBUI.java?rev=1788162&r1=1788161&r2=1788162&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196-2/connectors/kafka/connector/src/test/java/org/apache/manifoldcf/agents/output/kafka/NavigationHSQLDBUI.java
(original)
+++ manifoldcf/branches/CONNECTORS-1196-2/connectors/kafka/connector/src/test/java/org/apache/manifoldcf/agents/output/kafka/NavigationHSQLDBUI.java
Wed Mar 22 21:11:31 2017
@@ -64,7 +64,7 @@ public class NavigationHSQLDBUI extends
     testerInstance.clickTab("Name");
 
     // Now save the connection.
-    testerInstance.clickButton("Save");
+    testerInstance.clickButton("Save",60);
     testerInstance.verifyThereIsNoError();
 
     // Define a repository connection via the UI
@@ -148,203 +148,7 @@ public class NavigationHSQLDBUI extends
     testerInstance.navigateTo("List output connections");
     testerInstance.clickButtonByTitle("Delete MyOutputConnection");
     testerInstance.acceptAlert();
-
-
-/*
-    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");
-
-    // 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 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();
-    // Fill in a name
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editconnection"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("connname"));
-    textarea.setValue(testerInstance.createStringDescription("MyOutputConnection"));
-    link = window.findLink(testerInstance.createStringDescription("Type tab"));
-    link.click();
-    // 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.agents.output.kafka.KafkaOutputConnector"));
-    button = window.findButton(testerInstance.createStringDescription("Continue to next page"));
-    button.click();
-    // Visit the Throttling tab
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Throttling tab"));
-    link.click();
-    // Go back to the Name tab
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Name tab"));
-    link.click();
-    // Parameters tab
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Parameters tab"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editconnection"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("ip"));
-    textarea.setValue(testerInstance.createStringDescription("localhost"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("port"));
-    textarea.setValue(testerInstance.createStringDescription("9092"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("topic"));
-    textarea.setValue(testerInstance.createStringDescription("topic"));
-
-    // 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 output connection"));
-    button.click();
-
-    // Define a repository connection via the UI
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("List repository connections"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Add a 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("MyRepositoryConnection"));
-    link = window.findLink(testerInstance.createStringDescription("Type tab"));
-    link.click();
-    // 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.crawler.tests.TestingRepositoryConnector"));
-    button = window.findButton(testerInstance.createStringDescription("Continue to next page"));
-    button.click();
-    // Visit the Throttling tab
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Throttling tab"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    // Now save the connection.
-    button = window.findButton(testerInstance.createStringDescription("Save this connection"));
-    button.click();
-
-    // Create a job
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("List jobs"));
-    link.click();
-    // Add a job
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Add a job"));
-    link.click();
-    // Fill in a name
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editjob"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("description"));
-    textarea.setValue(testerInstance.createStringDescription("MyJob"));
-    link = window.findLink(testerInstance.createStringDescription("Connection tab"));
-    link.click();
-    // Select the connections
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editjob"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("output_connectionname"));
-    selectbox.selectValue(testerInstance.createStringDescription("MyOutputConnection"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("output_precedent"));
-    selectbox.selectValue(testerInstance.createStringDescription("-1"));
-    button = window.findButton(testerInstance.createStringDescription("Add an output"));
-    button.click();
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editjob"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("connectionname"));
-    selectbox.selectValue(testerInstance.createStringDescription("MyRepositoryConnection"));
-    button = window.findButton(testerInstance.createStringDescription("Continue to next screen"));
-    button.click();
-    // Visit all the tabs.  Scheduling tab first
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Scheduling tab"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    form = window.findForm(testerInstance.createStringDescription("editjob"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("dayofweek"));
-    selectbox.selectValue(testerInstance.createStringDescription("0"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("hourofday"));
-    selectbox.selectValue(testerInstance.createStringDescription("1"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("minutesofhour"));
-    selectbox.selectValue(testerInstance.createStringDescription("30"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("monthofyear"));
-    selectbox.selectValue(testerInstance.createStringDescription("11"));
-    selectbox = form.findSelectbox(testerInstance.createStringDescription("dayofmonth"));
-    selectbox.selectValue(testerInstance.createStringDescription("none"));
-    textarea = form.findTextarea(testerInstance.createStringDescription("duration"));
-    textarea.setValue(testerInstance.createStringDescription("120"));
-    button = window.findButton(testerInstance.createStringDescription("Add new schedule record"));
-    button.click();
-    window = testerInstance.findWindow(null);
-    // MHL
-    // Save the job
-    button = window.findButton(testerInstance.createStringDescription("Save this job"));
-    button.click();
-
-    // Delete the job
-    window = testerInstance.findWindow(null);
-    HTMLTester.StringDescription jobID = window.findMatch(testerInstance.createStringDescription("<!--jobid=(.*?)-->"),
0);
-    testerInstance.printValue(jobID);
-    link = window.findLink(testerInstance.createStringDescription("Delete this job"));
-    link.click();
-
-    // Wait for the job to go away
-    loop = testerInstance.beginLoop(120);
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Manage jobs"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    HTMLTester.StringDescription isJobNotPresent = window.isNotPresent(jobID);
-    testerInstance.printValue(isJobNotPresent);
-    loop.breakWhenTrue(isJobNotPresent);
-    loop.endLoop();
-
-    // Delete the repository connection
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("List repository connections"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Delete MyRepositoryConnection"));
-    link.click();
-
-    // Delete the output connection
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("List output connections"));
-    link.click();
-    window = testerInstance.findWindow(null);
-    link = window.findLink(testerInstance.createStringDescription("Delete MyOutputConnection"));
-    link.click();
-
-    testerInstance.executeTest();
-*/
+    
+    testerInstance.verifyThereIsNoError();
   }
-
 }

Modified: manifoldcf/branches/CONNECTORS-1196-2/framework/core/src/test/java/org/apache/manifoldcf/core/tests/SeleniumTester.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1196-2/framework/core/src/test/java/org/apache/manifoldcf/core/tests/SeleniumTester.java?rev=1788162&r1=1788161&r2=1788162&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1196-2/framework/core/src/test/java/org/apache/manifoldcf/core/tests/SeleniumTester.java
(original)
+++ manifoldcf/branches/CONNECTORS-1196-2/framework/core/src/test/java/org/apache/manifoldcf/core/tests/SeleniumTester.java
Wed Mar 22 21:11:31 2017
@@ -394,7 +394,10 @@ public class SeleniumTester
 
   public void setValue(SearchContext context, By selector, String value)
   {
-    context.findElement(selector).sendKeys(value);
+    WebElement element = context.findElement(selector);
+    //Make sure, there is no default text in the input.
+    element.clear();
+    element.sendKeys(value);
   }
 
   /**



Mime
View raw message