未验证 提交 5edc2af3 编写于 作者: X xingchun-chen 提交者: GitHub

e2e add project and workflow case (#2309)

* add LoginTest license

* Delete useless packages

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case
Co-authored-by: weixin_41213428's avatarchenxingchun <438044805@qq.com>
上级 0d70e065
......@@ -20,18 +20,16 @@ public class TestConstant {
/**
* 1000
*/
public static final int ONE_THOUSANG = 1000;
public static final int ONE_THOUSAND = 1000;
/**
* 3000
*/
public static final int THREE_THOUSANG = 3000;
public static final int THREE_THOUSAND = 3000;
/**
* 10000
*/
public static final int TEN_THOUSANG = 10000;
public static final int TEN_THOUSAND = 10000;
}
......@@ -115,9 +115,9 @@ public class RedisUtil {
try {
System.out.println("redis init");
if (redisPwd.isEmpty())
jedisPool = new JedisPool(jedisPoolConfig, redisIp, redisPort, TestConstant.THREE_THOUSANG);
jedisPool = new JedisPool(jedisPoolConfig, redisIp, redisPort, TestConstant.THREE_THOUSAND);
else {
jedisPool = new JedisPool(jedisPoolConfig, redisIp, redisPort, TestConstant.TEN_THOUSANG, redisPwd);
jedisPool = new JedisPool(jedisPoolConfig, redisIp, redisPort, TestConstant.TEN_THOUSAND, redisPwd);
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -19,14 +19,14 @@ package org.apache.dolphinscheduler.base;
import org.apache.dolphinscheduler.constant.TestConstant;
import org.apache.dolphinscheduler.util.PropertiesReader;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.PageLoadStrategy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.CapabilityType;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.PageLoadStrategy;
/**
......@@ -83,6 +83,7 @@ public class BaseDriver {
* start chrome browser
*/
public void startBrowser() throws Exception {
System.out.println("===================test start===================");
// set chrome driver
System.setProperty("webdriver.chrome.driver", chromeDriverPath);
ChromeOptions chromeOptions = new ChromeOptions();
......@@ -104,9 +105,6 @@ public class BaseDriver {
// page load timeout
driver.manage().timeouts().pageLoadTimeout(pageLoadTimeout, TimeUnit.SECONDS);
// page load timeout
driver.manage().timeouts().pageLoadTimeout(pageLoadTimeout, TimeUnit.SECONDS);
// script timeout
driver.manage().timeouts().setScriptTimeout(setScriptTimeout, TimeUnit.SECONDS);
......@@ -141,12 +139,10 @@ public class BaseDriver {
* close browser
*/
public void closeBrowser() throws InterruptedException {
// JS Show a pop-up box to indicate the end of the test
Thread.sleep(TestConstant.ONE_THOUSANG);
// ((JavascriptExecutor) driver).executeScript("alert('Test completed, browser closes after 3s')");
Thread.sleep(TestConstant.THREE_THOUSANG);
Thread.sleep(TestConstant.THREE_THOUSAND);
if (driver != null) {
driver.quit();
System.out.println("===================test end===================");
}
}
}
......@@ -126,6 +126,18 @@ public class BrowserCommon {
return buttonElement;
}
/**
* Click Navigation Bar element
* @param locator By
* @return clickButton
*/
public void clickTopElement(By locator) {
WebElement element = driver.findElement(locator);
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", element);
}
/**
* Click element
*
......@@ -138,6 +150,7 @@ public class BrowserCommon {
return clickElement;
}
/**
* input element
*
......@@ -236,12 +249,16 @@ public class BrowserCommon {
return driver;
}
/**
* Multi-window switch handle, according to the handle number passed in
*
* @param num Number starts from 1
* @return driver
*/
/**
* Multi-window switch handle, according to the handle number passed in
*
* @param num Number starts from 1
* @return driver
*/
public WebDriver switchHandle(int num) {
// current handle
String currentHandle = driver.getWindowHandle();
......@@ -314,9 +331,8 @@ public class BrowserCommon {
executeScript("window.scrollTo(0, document.body.scrollHeight)");
}
public void scrollToElementBottom() {
WebElement webElement = driver.findElement(By.xpath("/html/body/div[4]/div/div[2]/div/div[2]/div/div[7]/div[3]"));
public void scrollToElementBottom(By locator) {
WebElement webElement = locateElement(locator);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", webElement);
}
......
......@@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.data.project;
public class CreateProjectData {
// create project name
public static final String PROJECT_NAME = "selenium_project_3";
public static final String PROJECT_NAME = "selenium_project_1";
// create project description
public static final String DESCRIPTION = "test create project description";
// project page title
......
......@@ -21,7 +21,7 @@ public class CreateWorkflowData {
* create workflow data
*/
//input shell task name
public static final String SHELL_TASK_NAME = "shell_task_selenium_5";
public static final String SHELL_TASK_NAME = "shell_task_selenium_1";
//input shell task description
public static final String SHELL_TASK_DESCRIPTION = "shell task description test";
......@@ -44,8 +44,12 @@ public class CreateWorkflowData {
//input add custom parameters value
public static final String INPUT_ADD_CUSTOM_PARAMETERS_VALUE = "selenium_parameter_delete_456";
//workflow define title
public static final String WORKFLOW_TITLE = "工作流定义 - DolphinScheduler";
//create workflow title
public static final String WORKFLOW_TITLE = "创建流程定义 - DolphinScheduler";
public static final String CREATE_WORKFLOW_TITLE = "创建流程定义 - DolphinScheduler";
/**
* save workflow data
......
......@@ -25,12 +25,12 @@ public class TenantManageData {
/**
* Tenant Code
*/
public static final String TENANAT_CODE = "dolphinscheduler_tenant_code15";
public static final String TENANT_CODE = "selenium_tenant_code_1";
/**
* Tenant Name
*/
public static final String TENANAT_NAME = "dolphinscheduler_tenant_Name";
public static final String TENANT_NAME = "selenium_tenant_Name";
/**
* Queue
......@@ -40,9 +40,9 @@ public class TenantManageData {
/**
* Description
*/
public static final String DESCRIPTION = "creat tenant test";
public static final String DESCRIPTION = "create tenant test";
public static final String TENANAT_MANAGE = "租户管理 - DolphinScheduler";
public static final String TENANT_MANAGE = "租户管理 - DolphinScheduler";
......
......@@ -18,7 +18,7 @@ package org.apache.dolphinscheduler.data.security;
public class UserManageData {
public static final String USERNAME = "selenium_5";
public static final String USERNAME = "selenium_user_1";
public static final String PASSWORD = "123456qwe";
......
......@@ -20,10 +20,15 @@ import org.openqa.selenium.By;
public class CreateProjectLocator {
//click project manage
public static final By PROJECT_MANAGE = By.xpath("//div[2]/div/a/span");
// public static final By PROJECT_MANAGE = By.xpath("//div[@class='clearfix list'][2]");
public static final By PROJECT_MANAGE = By.xpath("//div[2]/div[2]/div/a/span");
// public static final By SECURITY_MANAGE = By.xpath("//div[@class='m-top']/div/div[2]/dev[@class='clearfix list'][6]");
public static final By SECURITY_MANAGE = By.xpath("//div[2]/div[6]/div/a/span");
//click create project button
public static final By CREATE_PROJECT_BUTTON = By.xpath("//button/span");
public static final By CREATE_PROJECT_BUTTON = By.xpath("//div[2]/div/div[1]/button/span");
//input project name
public static final By PROJECT_NAME = By.xpath("//div[2]/div/div/div[2]/div/input");
......@@ -33,4 +38,10 @@ public class CreateProjectLocator {
//submit button
public static final By SUBMIT_BUTTON = By.xpath("//div[3]/button[2]/span");
//delete project button
public static final By DELETE_PROJECT_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[9]/span/button");
//confirm delete project button
public static final By CONFIRM_DELETE_PROJECT_BUTTON = By.xpath("//div[2]/div/button[2]/span");
}
......@@ -169,4 +169,15 @@ public class CreateWorkflowLocator {
//click add button
public static final By CLICK_ADD_BUTTON = By.xpath("//button[2]/span");
//scroll to element bottom
public static final By SCROLL_BOTTOM = By.xpath("//span/a/em");
/**
* delete workflow
*/
//click delete workflow button
public static final By DELETE_WORKFLOW_BOTTOM = By.xpath("//span/button/i");
//click confirm delete workflow button
public static final By CONFIRM_DELETE_WORKFLOW_BOTTOM = By.xpath("//div[2]/div/button[2]/span");
}
......@@ -19,6 +19,8 @@ package org.apache.dolphinscheduler.locator.security;
import org.openqa.selenium.By;
public class TenantManageLocator{
public static final By SECURITY_CENTER = By.xpath("//div[2]/div[6]/div/a/span/em");
public static final By TENANT_MANAGE = By.xpath("//div[2]/div/a/div/a/span");
public static final By CREATE_TENANT_BUTTON = By.xpath("//button/span");
......
......@@ -17,10 +17,8 @@
package org.apache.dolphinscheduler.page;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.constant.TestConstant;
import org.apache.dolphinscheduler.data.LoginData;
import org.apache.dolphinscheduler.locator.LoginLocator;
import org.apache.dolphinscheduler.util.RedisUtil;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.WebDriver;
......@@ -49,7 +47,6 @@ public class LoginPage extends PageCommon {
public void jumpPageChinese() {
super.jumpPage(LoginData.URL);
Cookie cookie = new Cookie("language", "zh_CN", "/", null);
driver.manage().addCookie(cookie);
}
/**
......
......@@ -28,23 +28,22 @@ public class CreateProjectPage extends PageCommon {
}
/**
* jump page
* jump to ProjectManagePage
*/
public void jumpProjectManagePage() throws InterruptedException {
Thread.sleep(TestConstant.ONE_THOUSANG);
clickElement(CreateProjectLocator.PROJECT_MANAGE);
Thread.sleep(TestConstant.ONE_THOUSANG);
public boolean jumpProjectManagePage() throws InterruptedException {
Thread.sleep(TestConstant.THREE_THOUSAND);
clickTopElement(CreateProjectLocator.PROJECT_MANAGE);
Thread.sleep(TestConstant.ONE_THOUSAND);
return ifTitleContains(CreateProjectData.PROJECT_TITLE);
}
/**
* createTenant
* create project
*
* @return Whether to enter the specified page after creat tenant
* @return Whether to enter the specified page after create project
*/
public boolean createProject() throws InterruptedException {
//click create project
clickElement(CreateProjectLocator.CREATE_PROJECT_BUTTON);
Thread.sleep(TestConstant.ONE_THOUSANG);
// input create project data
sendInput(CreateProjectLocator.PROJECT_NAME, CreateProjectData.PROJECT_NAME);
......@@ -56,4 +55,20 @@ public class CreateProjectPage extends PageCommon {
// Whether to enter the specified page after submit
return ifTitleContains(CreateProjectData.PROJECT_TITLE);
}
/**
* delete project
*
* @return Whether to enter the specified page after delete project
*/
public boolean deleteProject() throws InterruptedException {
//click delete project
clickElement(CreateProjectLocator.DELETE_PROJECT_BUTTON);
//click confirm delete project
clickElement(CreateProjectLocator.CONFIRM_DELETE_PROJECT_BUTTON);
// Whether to enter the specified page after submit
return ifTitleContains(CreateProjectData.PROJECT_TITLE);
}
}
......@@ -30,22 +30,23 @@ public class CreateWorkflowPage extends PageCommon {
/**
* jump create workflow page
*/
public boolean createWorkflow() throws InterruptedException {
System.out.println("Click on the project name to jump to the project homepage");
public boolean jumpWorkflowPage() throws InterruptedException {
// click project name
clickElement(CreateWorkflowLocator.CLICK_PROJECT_NAME);
Thread.sleep(TestConstant.ONE_THOUSANG);
Thread.sleep(TestConstant.ONE_THOUSAND);
System.out.println("Click on workflow define");
System.out.println("Click on workflow define to jump to workflow define page");
// click workflow define
clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE);
Thread.sleep(TestConstant.ONE_THOUSANG);
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
}
public boolean createWorkflow() throws InterruptedException {
System.out.println("Click create workflow button");
// click create workflow button
clickElement(CreateWorkflowLocator.CLICK_CREATE_WORKFLOW_BUTTON);
Thread.sleep(TestConstant.ONE_THOUSANG);
System.out.println("drag shell task");
//drag shell_task
......@@ -98,8 +99,7 @@ public class CreateWorkflowPage extends PageCommon {
//click codeMirror and input script
inputCodeMirror(CreateWorkflowLocator.CLICK_CODE_MIRROR, CreateWorkflowLocator.INPUT_SCRIPT, CreateWorkflowData.SHELL_SCRIPT);
scrollToElementBottom();
Thread.sleep(TestConstant.ONE_THOUSANG);
scrollToElementBottom(CreateWorkflowLocator.SCROLL_BOTTOM);
//click custom parameters
clickElement(CreateWorkflowLocator.CLICK_CUSTOM_PARAMETERS);
......@@ -113,8 +113,7 @@ public class CreateWorkflowPage extends PageCommon {
//click add custom parameters
clickElement(CreateWorkflowLocator.CLICK_ADD_CUSTOM_PARAMETERS);
scrollToElementBottom();
Thread.sleep(TestConstant.ONE_THOUSANG);
scrollToElementBottom(CreateWorkflowLocator.SCROLL_BOTTOM);
//input add custom parameters
sendInput(CreateWorkflowLocator.INPUT_ADD_CUSTOM_PARAMETERS, CreateWorkflowData.INPUT_ADD_CUSTOM_PARAMETERS);
......@@ -124,16 +123,15 @@ public class CreateWorkflowPage extends PageCommon {
//click delete custom parameters
clickElement(CreateWorkflowLocator.CLICK_DELETE_CUSTOM_PARAMETERS);
Thread.sleep(TestConstant.ONE_THOUSANG);
//click submit button
clickElement(CreateWorkflowLocator.CLICK_SUBMIT_BUTTON);
Thread.sleep(TestConstant.ONE_THOUSANG);
Thread.sleep(TestConstant.ONE_THOUSAND);
System.out.println("Task node set up successfully");
System.out.println("move to Dag Element ");
moveToDragElement(CreateWorkflowLocator.MOUSE_MOVE_SHELL_AT_DAG,-300,-100);
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
return ifTitleContains(CreateWorkflowData.CREATE_WORKFLOW_TITLE);
}
/**
......@@ -182,11 +180,22 @@ public class CreateWorkflowPage extends PageCommon {
//delete workflow global parameters value
clickElement(CreateWorkflowLocator.CLICK_DELETE_WORKFLOW_GLOBAL_PARAMETERS);
Thread.sleep(TestConstant.ONE_THOUSANG);
Thread.sleep(TestConstant.ONE_THOUSAND);
//click add button
clickElement(CreateWorkflowLocator.CLICK_ADD_BUTTON);
clickButton(CreateWorkflowLocator.CLICK_ADD_BUTTON);
System.out.println("submit workflow");
return ifTitleContains(CreateWorkflowData.CREATE_WORKFLOW_TITLE);
}
public boolean deleteWorkflow() throws InterruptedException {
//click delete project
clickButton(CreateWorkflowLocator.DELETE_WORKFLOW_BOTTOM);
//click confirm delete project
clickButton(CreateWorkflowLocator.CONFIRM_DELETE_WORKFLOW_BOTTOM);
// Whether to enter the specified page after submit
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
}
}
......@@ -17,12 +17,8 @@
package org.apache.dolphinscheduler.page.security;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.constant.TestConstant;
import org.apache.dolphinscheduler.data.LoginData;
import org.apache.dolphinscheduler.data.security.TenantManageData;
import org.apache.dolphinscheduler.locator.LoginLocator;
import org.apache.dolphinscheduler.locator.security.TenantManageLocator;
import org.apache.dolphinscheduler.util.RedisUtil;
import org.openqa.selenium.WebDriver;
public class TenantManagePage extends PageCommon {
......@@ -34,21 +30,30 @@ public class TenantManagePage extends PageCommon {
super(driver);
}
/**
* jump security page
*
* @return Whether to enter the specified page after create tenant
*/
public boolean jumpSecurity() throws InterruptedException {
clickTopElement(TenantManageLocator.SECURITY_CENTER);
return ifTitleContains(TenantManageData.TENANT_MANAGE);
}
/**
* createTenant
*
* @return Whether to enter the specified page after creat tenant
* @return Whether to enter the specified page after create tenant
*/
public boolean createTenant() throws InterruptedException {
Thread.sleep(TestConstant.ONE_THOUSANG);
clickButton(TenantManageLocator.TENANT_MANAGE);
//create tenant
clickButton(TenantManageLocator.CREATE_TENANT_BUTTON);
// tenant data
sendInput(TenantManageLocator.TENANT_INPUT_CODE, TenantManageData.TENANAT_CODE);
sendInput(TenantManageLocator.TENANT_INPUT_NAME, TenantManageData.TENANAT_NAME);
sendInput(TenantManageLocator.TENANT_INPUT_CODE, TenantManageData.TENANT_CODE);
sendInput(TenantManageLocator.TENANT_INPUT_NAME, TenantManageData.TENANT_NAME);
sendInput(TenantManageLocator.QUEUE, TenantManageData.QUEUE);
sendInput(TenantManageLocator.DESCRIPTION, TenantManageData.DESCRIPTION);
......@@ -56,22 +61,19 @@ public class TenantManagePage extends PageCommon {
clickButton(TenantManageLocator.SUBMIT_BUTTON);
// Whether to enter the specified page after submit
return ifTitleContains(TenantManageData.TENANAT_MANAGE);
return ifTitleContains(TenantManageData.TENANT_MANAGE);
}
public boolean deleteTenant() throws InterruptedException {
Thread.sleep(TestConstant.ONE_THOUSANG);
clickButton(TenantManageLocator.TENANT_MANAGE);
Thread.sleep(TestConstant.ONE_THOUSANG);
// click delete button
clickButton(TenantManageLocator.DELETE_TENANT_BUTTON);
Thread.sleep(TestConstant.ONE_THOUSANG);
//click confirm delete button
clickButton(TenantManageLocator.CONFIRM_DELETE_TENANT_BUTTON);
// Whether to enter the specified page after submit
return ifTitleContains(TenantManageData.TENANAT_MANAGE);
return ifTitleContains(TenantManageData.TENANT_MANAGE);
}
}
......@@ -17,7 +17,6 @@
package org.apache.dolphinscheduler.page.security;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.constant.TestConstant;
import org.apache.dolphinscheduler.data.security.UserManageData;
import org.apache.dolphinscheduler.locator.security.UserManageLocator;
import org.openqa.selenium.WebDriver;
......@@ -33,10 +32,8 @@ public class UserManagePage extends PageCommon {
* @return Whether to enter the specified page after creat tenant
*/
public boolean createUser() throws InterruptedException {
Thread.sleep(TestConstant.ONE_THOUSANG);
// click user manage
clickElement(UserManageLocator.CLICK_USER_MANAGE);
Thread.sleep(TestConstant.ONE_THOUSANG);
// click create user button
clickButton(UserManageLocator.CLICK_CREATE_USER_BUTTON);
......@@ -59,10 +56,9 @@ public class UserManagePage extends PageCommon {
}
public boolean deleteUser() throws InterruptedException {
Thread.sleep(TestConstant.ONE_THOUSANG);
// click user manage
clickElement(UserManageLocator.CLICK_USER_MANAGE);
Thread.sleep(TestConstant.ONE_THOUSANG);
// click delete user button
clickButton(UserManageLocator.DELETE_USER_BUTTON );
......
......@@ -17,7 +17,6 @@
package org.apache.dolphinscheduler.testcase;
import org.apache.dolphinscheduler.page.LoginPage;
import org.testng.Assert;
import org.testng.annotations.Test;
import static org.apache.dolphinscheduler.base.BaseTest.driver;
......
......@@ -14,33 +14,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.data.project;
public class CreatWorkflowData {
//input shell task name
public static final String SHELL_TASK_NAME = "shell task description test1";
//input shell task description
public static final String SHELL_TASK_DESCRIPTION = "shell task description test";
//input timeout
public static final String INPUT_TIMEOUT = "60";
//input shell script
public static final String SHELL_SCRIPT = "echo 1111111";
//input custom parameters
public static final String INPUT_CUSTOM_PARAMETERS = "selenium_parameter";
//input custom parameters value
public static final String INPUT_CUSTOM_PARAMETERS_VALUE = "selenium_parameter_123";
//input add custom parameters
public static final String INPUT_ADD_CUSTOM_PARAMETERS = "selenium_parameter_delete";
//input add custom parameters value
public static final String INPUT_ADD_CUSTOM_PARAMETERS_VALUE = "selenium_parameter_delete_456";
//create workflow title
public static final String WORKFLOW_TITLE = "创建流程定义 - DolphinScheduler";
package org.apache.dolphinscheduler.testcase.deleteData;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.testng.annotations.Test;
public class DeleteProjectTest extends BaseTest {
private CreateProjectPage createProjectPage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","project"},description = "DeleteProjectTest",priority=7)
public void testDeleteProject() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver);
//jump to project manage page
System.out.println("jump to the project manage page to delete project");
createProjectPage.jumpProjectManagePage();
//assert tenant manage page
System.out.println("start delete project");
assert createProjectPage.deleteProject();
System.out.println("end delete project");
System.out.println("===================================");
}
}
......@@ -23,15 +23,16 @@ import org.testng.annotations.Test;
public class DeleteTenantTest extends BaseTest {
private TenantManagePage tenantManagePage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","createTenant"},description = "DeleteTenantTest")
@Test(groups={"functionTests"},dependsOnGroups = { "login","createTenant"},description = "DeleteTenantTest",priority=9)
public void testDeleteTenant() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
//assert tenant manage page
System.out.println("jump to security to delete tenant");
tenantManagePage.jumpSecurity();
System.out.println("start delete tenant");
assert tenantManagePage.deleteTenant();
System.out.println("end delete tenant");
System.out.println("===================================");
}
}
......@@ -17,14 +17,20 @@
package org.apache.dolphinscheduler.testcase.deleteData;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.apache.dolphinscheduler.page.security.UserManagePage;
import org.testng.annotations.Test;
public class DeleteUserTest extends BaseTest {
private UserManagePage userManagePage;
private TenantManagePage tenantManagePage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","user" },description = "DeleteUserTest")
@Test(groups={"functionTests"},dependsOnGroups = { "login","user" },description = "DeleteUserTest",priority=8)
public void testDeleteUser() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
System.out.println("jump to security to delete user");
tenantManagePage.jumpSecurity();
userManagePage = new UserManagePage(driver);
//assert user manage page
System.out.println("start delete user");
......
/*
* 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.dolphinscheduler.testcase.deleteData;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.apache.dolphinscheduler.page.project.CreateWorkflowPage;
import org.testng.annotations.Test;
public class DeleteWorkflowTest extends BaseTest {
private CreateWorkflowPage createWorkflowPage;
private CreateProjectPage createProjectPage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","workflow"},description = "DeleteWorkflowTest",priority=6)
public void testDeleteWorkflow() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver);
//jump to project manage page
System.out.println("jump to the project manage page to delete workflow");
createProjectPage.jumpProjectManagePage();
createWorkflowPage = new CreateWorkflowPage(driver);
createWorkflowPage.jumpWorkflowPage();
//assert tenant manage page
System.out.println("start delete workflow");
assert createWorkflowPage.deleteWorkflow();
System.out.println("end delete workflow");
System.out.println("===================================");
}
}
......@@ -23,10 +23,11 @@ import org.testng.annotations.Test;
public class CreateProjectTest extends BaseTest {
private CreateProjectPage createProjectPage;
@Test(groups={"functionTests"},dependsOnGroups = { "login" },description = "CreateProjectTest",priority=4)
@Test(groups={"functionTests","project"},dependsOnGroups = { "login" },description = "CreateProjectTest",priority=4)
public void testCreateProject() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver);
// enter user manage page
System.out.println("jump to the projectManage page to create project ");
createProjectPage.jumpProjectManagePage();
//assert user manage page
System.out.println("start create project");
......
......@@ -26,12 +26,16 @@ public class CreateWorkflowTest extends BaseTest {
private CreateProjectPage createProjectPage;
@Test(groups={"functionTests"},dependsOnGroups = { "login" },description = "CreateWorkflowTest",priority=5)
@Test(groups={"functionTests","workflow"},dependsOnGroups = { "login" },description = "CreateWorkflowTest",priority=5)
public void testCreateWorkflow() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver);
System.out.println("jump to the projectManage page to create workflow");
createProjectPage.jumpProjectManagePage();
createWorkflowPage = new CreateWorkflowPage(driver);
System.out.println("Click on the project name to jump to the project homepage");
createWorkflowPage.jumpWorkflowPage();
System.out.println("start create workflow");
assert createWorkflowPage.createWorkflow();
assert createWorkflowPage.saveWorkflow();
......
......@@ -24,7 +24,7 @@ import org.testng.annotations.Test;
public class TenantManageTest extends BaseTest {
private TenantManagePage tenantManagePage;
@Test(groups={"functionTests","createTenant"},dependsOnGroups = { "login" },description = "TenantManageTest")
@Test(groups={"functionTests","createTenant"},dependsOnGroups = { "login" },description = "TenantManageTest",priority=2)
public void testTenantManage() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
//assert tenant manage page
......@@ -32,8 +32,5 @@ public class TenantManageTest extends BaseTest {
assert tenantManagePage.createTenant();
System.out.println("end create tenant");
System.out.println("===================================");
}
}
......@@ -23,7 +23,7 @@ import org.testng.annotations.Test;
public class UserManageTest extends BaseTest {
private UserManagePage userManagePage;
@Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "UserManageTest")
@Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "UserManageTest",priority=3)
public void testUserManage() throws InterruptedException {
userManagePage = new UserManagePage(driver);
//assert user manage page
......
......@@ -20,7 +20,7 @@
<test name="dolphinscheduler_test" preserve-order="true">
<groups>
<run>
<include name="functionTests" />
<include name="functionTests"/>
</run>
</groups>
......@@ -28,10 +28,12 @@
<class name="org.apache.dolphinscheduler.testcase.LoginTest"></class>
<class name="org.apache.dolphinscheduler.testcase.security.TenantManageTest"></class>
<class name="org.apache.dolphinscheduler.testcase.security.UserManageTest"></class>
<!--<class name="org.apache.dolphinscheduler.testcase.project.CreateProjectTest"></class>-->
<!--&lt;!&ndash;<class name="org.apache.dolphinscheduler.testcase.project.CreateWorkflowTest"></class>&ndash;&gt;-->
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteTenantTest"></class>
<class name="org.apache.dolphinscheduler.testcase.project.CreateProjectTest"></class>
<class name="org.apache.dolphinscheduler.testcase.project.CreateWorkflowTest"></class>
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteWorkflowTest"></class>
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteProjectTest"></class>
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteUserTest"></class>
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteTenantTest"></class>
</classes>
</test>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册