eights 5 years ago
parent
commit
a64c2b383e
  1. 36
      e2e/src/test/java/org/apache/dolphinscheduler/data/security/AlertManageData.java
  2. 35
      e2e/src/test/java/org/apache/dolphinscheduler/locator/security/AlertManageLocator.java
  3. 77
      e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
  4. 4
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/TestLogin.java
  5. 42
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteAlert.java
  6. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteProject.java
  7. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteTenant.java
  8. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteUser.java
  9. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java
  10. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateProject.java
  11. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java
  12. 36
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestAlertManage.java
  13. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestTenantManage.java
  14. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java
  15. 25
      e2e/testng.xml

36
e2e/src/test/java/org/apache/dolphinscheduler/data/security/AlertManageData.java

@ -0,0 +1,36 @@
/*
* 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.data.security;
public class AlertManageData {
/**
* Alert Name
*/
public static final String ALERT_NAME = "selenium_alert_Name";
/**
* Alert Type
*/
public static final String ALERT_TYPE = "邮件";
/**
* Alert Description
*/
public static final String DESCRIPTION = "create alert test";
public static final String ALERT_MANAGE = "告警组管理 - DolphinScheduler";
}

35
e2e/src/test/java/org/apache/dolphinscheduler/locator/security/AlertManageLocator.java

@ -0,0 +1,35 @@
/*
* 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.locator.security;
import org.openqa.selenium.By;
public class AlertManageLocator {
//create alert locator
public static final By CLICK_ALERT_MANAGE = By.xpath("//div[4]/div/a/div/a/span");
public static final By CLICK_CREATE_ALERT = By.xpath("//div[1]/div[2]/div/div[2]/div[2]/div/div[1]/button/span");
public static final By INPUT_ALERT_NAME = By.xpath("//div[2]/div/div[1]/div[2]/div/input");
public static final By CLICK_ALERT_TYPE = By.xpath("//div[2]/div/div[2]/div/div[2]/div[2]/div/div[1]/div/input");
public static final By SELECT_ALERT_EMAIL = By.xpath("//div[2]/div/div[2]/div/div[2]/div[2]/div/div[2]/div/div/div/ul/li[1]/span");
public static final By INPUT_ALERT_DESCRIPTION = By.xpath("//textarea");
public static final By SUBMIT_ALERT = By.xpath("//div[3]/button[2]/span");
//delete alert locator
public static final By DELETE_ALERT_BUTTON = By.xpath("//span/button");
public static final By CONFIRM_DELETE_ALERT_BUTTON = By.xpath("//div[2]/div/button[2]/span");
}

77
e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java

@ -0,0 +1,77 @@
/*
* 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.page.security;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.data.security.AlertManageData;
import org.apache.dolphinscheduler.locator.security.AlertManageLocator;
import org.openqa.selenium.WebDriver;
public class AlertManagePage extends PageCommon {
/**
* Unique constructor
* @param driver driver
*/
public AlertManagePage(WebDriver driver) {
super(driver);
}
/**
* createTenant
*
* @return Whether to enter the specified page after create tenant
*/
public boolean createAlert() throws InterruptedException {
// click alert manage
clickElement(AlertManageLocator.CLICK_ALERT_MANAGE);
Thread.sleep(2000);
// click create alert button
clickElement(AlertManageLocator.CLICK_CREATE_ALERT);
Thread.sleep(2000);
// input alert data
sendInput(AlertManageLocator.INPUT_ALERT_NAME, AlertManageData.ALERT_NAME);
clickElement(AlertManageLocator.CLICK_ALERT_TYPE);
clickElement(AlertManageLocator.SELECT_ALERT_EMAIL);
sendInput(AlertManageLocator.INPUT_ALERT_DESCRIPTION, AlertManageData.DESCRIPTION);
// click button
clickButton(AlertManageLocator.SUBMIT_ALERT);
// Whether to enter the specified page after submit
return ifTitleContains(AlertManageData.ALERT_MANAGE);
}
public boolean deleteAlert() throws InterruptedException {
// click user manage
clickElement(AlertManageLocator.CLICK_ALERT_MANAGE);
// click delete user button
clickButton(AlertManageLocator.DELETE_ALERT_BUTTON);
// click confirm delete button
clickButton(AlertManageLocator.CONFIRM_DELETE_ALERT_BUTTON);
// Whether to enter the specified page after submit
return ifTitleContains(AlertManageData.ALERT_MANAGE);
}
}

4
e2e/src/test/java/org/apache/dolphinscheduler/testcase/LoginTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/TestLogin.java

@ -22,10 +22,10 @@ import org.testng.annotations.Test;
import static org.apache.dolphinscheduler.base.BaseTest.driver;
@Test(groups={"functionTests","login"})
public class LoginTest {
public class TestLogin {
private LoginPage loginPage;
@Test(description = "LoginTest", priority = 1)
@Test(description = "TestLogin")
public void testLogin() throws InterruptedException {
loginPage = new LoginPage(driver);
System.out.println("===================================");

42
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteAlert.java

@ -0,0 +1,42 @@
/*
* 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.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.AlertManagePage;
import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.testng.annotations.Test;
public class TestDeleteAlert extends BaseTest {
private AlertManagePage alertManagePage;
private TenantManagePage tenantManagePage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","alert" },description = "TestDeleteAlert",priority=8)
public void testDeleteAlert() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
System.out.println("jump to testSecurity to delete alert");
tenantManagePage.jumpSecurity();
alertManagePage = new AlertManagePage(driver);
//assert alert manage page
System.out.println("start delete alert");
assert alertManagePage.deleteAlert();
System.out.println("end delete alert");
System.out.println("===================================");
}
}

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/deleteData/DeleteProjectTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteProject.java

@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.testcase.deleteData;
package org.apache.dolphinscheduler.testcase.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.testng.annotations.Test;
public class DeleteProjectTest extends BaseTest {
public class TestDeleteProject extends BaseTest {
private CreateProjectPage createProjectPage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","project"},description = "DeleteProjectTest",priority=7)
@Test(groups={"functionTests"},dependsOnGroups = { "login","project"},description = "TestDeleteProject")
public void testDeleteProject() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver);
//jump to project manage page

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/deleteData/DeleteTenantTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteTenant.java

@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.testcase.deleteData;
package org.apache.dolphinscheduler.testcase.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.testng.annotations.Test;
public class DeleteTenantTest extends BaseTest {
public class TestDeleteTenant extends BaseTest {
private TenantManagePage tenantManagePage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","createTenant"},description = "DeleteTenantTest",priority=9)
@Test(groups={"functionTests"},dependsOnGroups = { "login","createTenant"},description = "TestDeleteTenant")
public void testDeleteTenant() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
//assert tenant manage page

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/deleteData/DeleteUserTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteUser.java

@ -14,18 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.testcase.deleteData;
package org.apache.dolphinscheduler.testcase.testDeleteData;
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 {
public class TestDeleteUser extends BaseTest {
private UserManagePage userManagePage;
private TenantManagePage tenantManagePage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","user" },description = "DeleteUserTest",priority=8)
@Test(groups={"functionTests"},dependsOnGroups = { "login","user" },description = "TestDeleteUser")
public void testDeleteUser() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
System.out.println("jump to security to delete user");

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/deleteData/DeleteWorkflowTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java

@ -14,18 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.testcase.deleteData;
package org.apache.dolphinscheduler.testcase.testDeleteData;
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 {
public class TestDeleteWorkflow extends BaseTest {
private CreateWorkflowPage createWorkflowPage;
private CreateProjectPage createProjectPage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","workflow"},description = "DeleteWorkflowTest",priority=6)
@Test(groups={"functionTests"},dependsOnGroups = { "login","workflow"},description = "TestDeleteWorkflow")
public void testDeleteWorkflow() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver);
//jump to project manage page

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/project/CreateProjectTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateProject.java

@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.testcase.project;
package org.apache.dolphinscheduler.testcase.testProject;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.testng.annotations.Test;
public class CreateProjectTest extends BaseTest {
public class TestCreateProject extends BaseTest {
private CreateProjectPage createProjectPage;
@Test(groups={"functionTests","project"},dependsOnGroups = { "login" },description = "CreateProjectTest",priority=4)
@Test(groups={"functionTests","project"},dependsOnGroups = { "login" },description = "CreateProjectTest")
public void testCreateProject() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver);
// enter user manage page

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/project/CreateWorkflowTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java

@ -14,19 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.testcase.project;
package org.apache.dolphinscheduler.testcase.testProject;
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 CreateWorkflowTest extends BaseTest {
public class TestCreateWorkflow extends BaseTest {
private CreateWorkflowPage createWorkflowPage;
private CreateProjectPage createProjectPage;
@Test(groups={"functionTests","workflow"},dependsOnGroups = { "login" },description = "CreateWorkflowTest",priority=5)
@Test(groups={"functionTests","workflow"},dependsOnGroups = { "login" },description = "TestCreateWorkflow")
public void testCreateWorkflow() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver);
System.out.println("jump to the projectManage page to create workflow");

36
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestAlertManage.java

@ -0,0 +1,36 @@
/*
* 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.testSecurity;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.AlertManagePage;
import org.testng.annotations.Test;
public class TestAlertManage extends BaseTest {
private AlertManagePage alertManagePage;
@Test(groups={"functionTests","alert"},dependsOnGroups = { "login" },description = "AlertManagePage")
public void testAlertManage() throws InterruptedException {
alertManagePage = new AlertManagePage(driver);
//assert alert manage page
System.out.println("start create alert");
assert alertManagePage.createAlert();
System.out.println("end create alert");
System.out.println("===================================");
}
}

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/security/TenantManageTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestTenantManage.java

@ -14,17 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.testcase.security;
package org.apache.dolphinscheduler.testcase.testSecurity;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.testng.annotations.Test;
public class TenantManageTest extends BaseTest {
public class TestTenantManage extends BaseTest {
private TenantManagePage tenantManagePage;
@Test(groups={"functionTests","createTenant"},dependsOnGroups = { "login" },description = "TenantManageTest",priority=2)
@Test(groups={"functionTests","createTenant"},dependsOnGroups = { "login" },description = "TestTenantManage")
public void testTenantManage() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
//assert tenant manage page

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/security/UserManageTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java

@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.testcase.security;
package org.apache.dolphinscheduler.testcase.testSecurity;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.UserManagePage;
import org.testng.annotations.Test;
public class UserManageTest extends BaseTest {
public class TestUserManage extends BaseTest {
private UserManagePage userManagePage;
@Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "UserManageTest",priority=3)
@Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "TestUserManage")
public void testUserManage() throws InterruptedException {
userManagePage = new UserManagePage(driver);
//assert user manage page

25
e2e/testng.xml

@ -16,24 +16,27 @@
~ limitations under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="dolphinscheduler_e2e" parallel="true">
<suite name="dolphinscheduler_e2e" verbose="1">
<test name="dolphinscheduler_test" preserve-order="true">
<groups>
<run>
<include name="functionTests"/>
</run>
</groups>
<classes>
<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>
<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>
<class name="org.apache.dolphinscheduler.testcase.TestLogin"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestTenantManage"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestUserManage"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestAlertManage"></class>
<class name="org.apache.dolphinscheduler.testcase.testProject.TestCreateProject"></class>
<class name="org.apache.dolphinscheduler.testcase.testProject.TestCreateWorkflow"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteWorkflow"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteProject"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteAlert"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteUser"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteTenant"></class>
</classes>
</test>

Loading…
Cancel
Save