You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2021/06/30 10:54:45 UTC

[GitHub] [submarine] kevin85421 commented on a change in pull request #625: SUBMARINE-881. Sidebar page component object for e2e-test

kevin85421 commented on a change in pull request #625:
URL: https://github.com/apache/submarine/pull/625#discussion_r661348025



##########
File path: submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/components/Sidebars.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.submarine.integration.components;
+
+import org.openqa.selenium.By;
+import org.apache.submarine.AbstractSubmarineIT;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.PageFactory;
+import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
+
+public class Sidebars extends AbstractSubmarineIT{
+
+    private String URL = getURL("http://127.0.0.1", 8080);
+
+    private By toNoteBook = By.xpath("//span[contains(text(), \"Notebook\")]");
+    private String noteBookURL = "/workbench/notebook";
+
+    private By toExperiment = By.xpath("//span[contains(text(), \"Experiment\")]");
+    private String experimentURL = "/workbench/experiment";
+
+    private By toTemplate = By.xpath("//span[contains(text(), \"Template\")]");
+    private String templateURL = "/workbench/template";
+
+    private By toEnvironment = By.xpath("//span[contains(text(), \"Environment\")]");
+    private String environmentURL = "/workbench/environment";
+
+    private By toManager = By.xpath("//span[contains(text(), \"Manager\")]");
+    private String managerURL = "/workbench/manager";
+
+    private By toDataDict = By.xpath("//a[@href='/workbench/manager/dataDict']");
+    private String dataDictURL = "/workbench/manager/dataDict";
+
+    private By toDepartment = By.xpath("//a[@href='/workbench/manager/department']");
+    private String departmentURL = "/workbench/manager/department";
+
+    private By toUser = By.xpath("//a[@href='/workbench/manager/user']");
+    private String userURL = "/workbench/manager/user";
+
+    private By toData = By.xpath("//span[contains(text(), \"Data\")]");
+    private String dataURL = "/workbench/data";
+
+    private By toWorkSpace = By.xpath("//span[contains(text(), \"Workspace\")]");
+    private String workSpaceURL = "/workbench/workspace";
+
+    private By toInterpreter = By.xpath("//span[contains(text(), \"Interpreter\")]");
+    private String interpreterURL = "/workbench/interpreter";
+
+    private Actions action;
+
+    public Sidebars(WebDriver driver) {
+        PageFactory.initElements(new AjaxElementLocatorFactory(driver, 10), this);

Review comment:
       What is this for?

##########
File path: submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/datadictIT.java
##########
@@ -46,7 +47,9 @@ public static void tearDown(){
   // @Test TODO(kevin85421): Due to the undeterministic behavior of travis, I decide to comment it.
   public void dataDictTest() throws Exception {
     String URL = getURL("http://127.0.0.1", 8080);
-    // Login
+    Sidebars sidebars = new Sidebars(driver);
+
+      // Login

Review comment:
       indentation

##########
File path: submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/components/Sidebars.java
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.submarine.integration.components;
+
+import org.openqa.selenium.By;
+import org.apache.submarine.AbstractSubmarineIT;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.PageFactory;
+import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
+
+public class Sidebars extends AbstractSubmarineIT{
+
+    private String URL = getURL("http://127.0.0.1", 8080);
+
+    private By toNoteBook = By.xpath("//span[contains(text(), \"Notebook\")]");
+    private String noteBookURL = "/workbench/notebook";
+
+    private By toExperiment = By.xpath("//span[contains(text(), \"Experiment\")]");
+    private String experimentURL = "/workbench/experiment";
+
+    private By toTemplate = By.xpath("//span[contains(text(), \"Template\")]");
+    private String templateURL = "/workbench/template";
+
+    private By toEnvironment = By.xpath("//span[contains(text(), \"Environment\")]");
+    private String environmentURL = "/workbench/environment";
+
+    private By toManager = By.xpath("//span[contains(text(), \"Manager\")]");
+    private String managerURL = "/workbench/manager";
+
+    private By toDataDict = By.xpath("//a[@href='/workbench/manager/dataDict']");
+    private String dataDictURL = "/workbench/manager/dataDict";
+
+    private By toDepartment = By.xpath("//a[@href='/workbench/manager/department']");
+    private String departmentURL = "/workbench/manager/department";
+
+    private By toUser = By.xpath("//a[@href='/workbench/manager/user']");
+    private String userURL = "/workbench/manager/user";
+
+    private By toData = By.xpath("//span[contains(text(), \"Data\")]");
+    private String dataURL = "/workbench/data";
+
+    private By toWorkSpace = By.xpath("//span[contains(text(), \"Workspace\")]");
+    private String workSpaceURL = "/workbench/workspace";
+
+    private By toInterpreter = By.xpath("//span[contains(text(), \"Interpreter\")]");
+    private String interpreterURL = "/workbench/interpreter";
+
+    private Actions action;
+
+    public Sidebars(WebDriver driver) {
+        PageFactory.initElements(new AjaxElementLocatorFactory(driver, 10), this);
+        action = new Actions(driver);

Review comment:
       What is this for?

##########
File path: submarine-test/test-e2e/src/test/java/org/apache/submarine/integration/workspaceIT.java
##########
@@ -48,17 +49,18 @@ public static void tearDown(){
 
   @Test
   public void workspaceNavigation() throws Exception {
-    String URL = getURL("http://127.0.0.1", 8080);
-    // Login
+
+    Sidebars sidebars = new Sidebars(driver);
+
+      // Login

Review comment:
       indentation




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org