Browse Source
* 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 * Update worker_group_id to worker_group in init.sql * Update worker_group_id to worker_group in init.sql * Update worker_group_id to worker_group * Increase dataX environment variable, sslTrust default value * modify dataX environment variable * update e2e chrome version * add alert manage testcase and Optimize test case execution order * add e2e to create and to edit queue * update e2e chrome version * add e2e token testcase * add e2e token testcase Co-authored-by: chenxingchun <438044805@qq.com>pull/2/head
xingchun-chen
5 years ago
committed by
GitHub
12 changed files with 474 additions and 11 deletions
@ -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.data.security; |
||||
|
||||
public class QueueManageData { |
||||
/** |
||||
* Create Queue Name |
||||
*/ |
||||
public static final String QUEUE_NAME = "selenium_queue_name"; |
||||
|
||||
/** |
||||
* Create Queue Value |
||||
*/ |
||||
public static final String QUEUE_VALUE = "selenium_queue_value"; |
||||
|
||||
/** |
||||
* Edit Queue Name |
||||
*/ |
||||
public static final String EDIT_QUEUE_NAME = "_edit"; |
||||
|
||||
/** |
||||
* Edit Queue Value |
||||
*/ |
||||
public static final String EDIT_QUEUE_VALUE = "_edit"; |
||||
|
||||
public static final String QUEUE_MANAGE = "队列管理 - DolphinScheduler"; |
||||
|
||||
} |
@ -0,0 +1,24 @@
|
||||
/* |
||||
* 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 TokenManageData { |
||||
public static final String TOKEN_MANAGE = "令牌管理 - DolphinScheduler"; |
||||
public static final String DATE = "2038-06-10 00:00:00"; |
||||
|
||||
|
||||
} |
@ -0,0 +1,31 @@
|
||||
/* |
||||
* 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 QueueManageLocator { |
||||
//create queue locator
|
||||
public static final By CLICK_QUEUE_MANAGE = By.xpath("//div[6]/div/a/div/a/span"); |
||||
public static final By CLICK_CREATE_QUEUE = By.xpath("//button/span"); |
||||
public static final By INPUT_QUEUE_NAME = By.xpath("//div[2]/div/div/div[2]/div/input"); |
||||
public static final By INPUT_QUEUE_VALUE = By.xpath("//div[2]/div[2]/div/input"); |
||||
public static final By SUBMIT_QUEUE = By.xpath("//button[2]/span"); |
||||
|
||||
//edit queue locator
|
||||
public static final By CLICK_EDIT_QUEUE = By.xpath("//td[6]/button/i"); |
||||
} |
@ -0,0 +1,41 @@
|
||||
/* |
||||
* 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 TokenManageLocator { |
||||
//create token
|
||||
public static final By CLICK_TOKEN_MANAGE = By.xpath("//div[7]/div/a/div/a/span"); |
||||
|
||||
public static final By CLICK_CREATE_TOKEN = By.xpath("//div[2]/div/div[2]/div[2]/div/div[1]/button/span"); |
||||
|
||||
public static final By SELECT_USER = By.xpath("//div[2]/div[2]/div/div/div/span/i"); |
||||
|
||||
public static final By CLICK_GENERATE_TOKEN_BUTTON = By.xpath("//div[3]/div[2]/button/span"); |
||||
|
||||
public static final By CLICK_SUBMIT_BUTTON = By.xpath("//div[3]/button[2]/span"); |
||||
|
||||
//edit token
|
||||
public static final By CLICK_EDIT_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[7]/button/i"); |
||||
|
||||
//delete token
|
||||
public static final By CLICK_DELETE_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[7]/span/button"); |
||||
|
||||
public static final By CLICK_CONFIRM_DELETE_BUTTON = By.xpath("//div[2]/div/button[2]/span"); |
||||
|
||||
} |
@ -0,0 +1,85 @@
|
||||
/* |
||||
* 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.QueueManageData; |
||||
import org.apache.dolphinscheduler.locator.security.QueueManageLocator; |
||||
import org.openqa.selenium.WebDriver; |
||||
|
||||
public class QueueManagePage extends PageCommon { |
||||
/** |
||||
* Unique constructor |
||||
* @param driver driver |
||||
*/ |
||||
public QueueManagePage(WebDriver driver) { |
||||
super(driver); |
||||
} |
||||
|
||||
/** |
||||
* create queue |
||||
* |
||||
* @return Whether to enter the specified page after create queue |
||||
*/ |
||||
public boolean createQueue() throws InterruptedException { |
||||
// click queue manage
|
||||
clickElement(QueueManageLocator.CLICK_QUEUE_MANAGE); |
||||
Thread.sleep(1000); |
||||
|
||||
// click create queue button
|
||||
clickElement(QueueManageLocator.CLICK_CREATE_QUEUE); |
||||
Thread.sleep(1000); |
||||
|
||||
// input queue data
|
||||
sendInput(QueueManageLocator.INPUT_QUEUE_NAME, QueueManageData.QUEUE_NAME); |
||||
|
||||
sendInput(QueueManageLocator.INPUT_QUEUE_VALUE, QueueManageData.QUEUE_VALUE); |
||||
|
||||
// click button
|
||||
clickButton(QueueManageLocator.SUBMIT_QUEUE); |
||||
|
||||
// Whether to enter the specified page after submit
|
||||
return ifTitleContains(QueueManageData.QUEUE_MANAGE); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* edit queue |
||||
* |
||||
* @return Whether to enter the specified page after create queue |
||||
*/ |
||||
public boolean editQueue() throws InterruptedException { |
||||
// click queue manage
|
||||
Thread.sleep(1000); |
||||
clickElement(QueueManageLocator.CLICK_QUEUE_MANAGE); |
||||
Thread.sleep(1000); |
||||
|
||||
// click edit queue button
|
||||
clickElement(QueueManageLocator.CLICK_EDIT_QUEUE); |
||||
Thread.sleep(1000); |
||||
|
||||
// input queue data
|
||||
sendInput(QueueManageLocator.INPUT_QUEUE_NAME, QueueManageData.EDIT_QUEUE_NAME); |
||||
sendInput(QueueManageLocator.INPUT_QUEUE_VALUE, QueueManageData.EDIT_QUEUE_VALUE); |
||||
|
||||
// click button
|
||||
clickButton(QueueManageLocator.SUBMIT_QUEUE); |
||||
|
||||
// Whether to enter the specified page after submit
|
||||
return ifTitleContains(QueueManageData.QUEUE_MANAGE); |
||||
} |
||||
} |
@ -0,0 +1,94 @@
|
||||
/* |
||||
* 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.TokenManageData; |
||||
import org.apache.dolphinscheduler.locator.security.TokenManageLocator; |
||||
import org.openqa.selenium.WebDriver; |
||||
|
||||
public class TokenManagePage extends PageCommon { |
||||
public TokenManagePage(WebDriver driver) { |
||||
super(driver); |
||||
} |
||||
|
||||
/** |
||||
* createTenant |
||||
* |
||||
* @return Whether to enter the specified page after creat tenant |
||||
*/ |
||||
public boolean createToken() throws InterruptedException { |
||||
//create token
|
||||
Thread.sleep(1000); |
||||
clickElement(TokenManageLocator.CLICK_TOKEN_MANAGE); |
||||
Thread.sleep(1000); |
||||
|
||||
// click create token button
|
||||
clickButton(TokenManageLocator.CLICK_CREATE_TOKEN); |
||||
Thread.sleep(1000); |
||||
|
||||
//selectDate(TokenManageLocator.js, TokenManageLocator.CLICK_TIME, TokenManageData.DATE);
|
||||
|
||||
clickButton(TokenManageLocator.SELECT_USER); |
||||
|
||||
clickButton(TokenManageLocator.CLICK_GENERATE_TOKEN_BUTTON); |
||||
Thread.sleep(2500); |
||||
|
||||
// click button
|
||||
clickButton(TokenManageLocator.CLICK_SUBMIT_BUTTON); |
||||
|
||||
// Whether to enter the specified page after submit
|
||||
return ifTitleContains(TokenManageData.TOKEN_MANAGE); |
||||
} |
||||
|
||||
|
||||
//edit token
|
||||
public boolean editToken() throws InterruptedException { |
||||
// click token manage
|
||||
clickElement(TokenManageLocator.CLICK_TOKEN_MANAGE); |
||||
Thread.sleep(1000); |
||||
|
||||
// click create token button
|
||||
clickButton(TokenManageLocator.CLICK_EDIT_BUTTON); |
||||
Thread.sleep(1000); |
||||
|
||||
clickButton(TokenManageLocator.SELECT_USER); |
||||
|
||||
clickButton(TokenManageLocator.CLICK_GENERATE_TOKEN_BUTTON); |
||||
Thread.sleep(2500); |
||||
|
||||
// click button
|
||||
clickButton(TokenManageLocator.CLICK_SUBMIT_BUTTON); |
||||
|
||||
// Whether to enter the specified page after submit
|
||||
return ifTitleContains(TokenManageData.TOKEN_MANAGE); |
||||
} |
||||
|
||||
|
||||
//delete token
|
||||
public boolean deleteToken() throws InterruptedException { |
||||
// click token manage
|
||||
clickElement(TokenManageLocator.CLICK_TOKEN_MANAGE); |
||||
Thread.sleep(1000); |
||||
|
||||
clickButton(TokenManageLocator.CLICK_DELETE_BUTTON); |
||||
clickButton(TokenManageLocator.CLICK_CONFIRM_DELETE_BUTTON); |
||||
|
||||
return ifTitleContains(TokenManageData.TOKEN_MANAGE); |
||||
} |
||||
|
||||
} |
@ -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.TenantManagePage; |
||||
import org.apache.dolphinscheduler.page.security.TokenManagePage; |
||||
import org.testng.annotations.Test; |
||||
|
||||
public class TestDeleteToken extends BaseTest { |
||||
private TokenManagePage tokenManagePage; |
||||
private TenantManagePage tenantManagePage; |
||||
|
||||
|
||||
@Test(groups = {"functionTests"}, dependsOnGroups = {"login", "token"}, description = "TestDeleteToken") |
||||
public void testUserManage() throws InterruptedException { |
||||
tenantManagePage = new TenantManagePage(driver); |
||||
System.out.println("jump to security to delete token"); |
||||
tenantManagePage.jumpSecurity(); |
||||
|
||||
tokenManagePage = new TokenManagePage(driver); |
||||
//delete token
|
||||
System.out.println("start delete token"); |
||||
assert tokenManagePage.deleteToken(); |
||||
System.out.println("end delete token"); |
||||
System.out.println("==================================="); |
||||
} |
||||
} |
@ -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.testSecurity; |
||||
|
||||
import org.apache.dolphinscheduler.base.BaseTest; |
||||
import org.apache.dolphinscheduler.page.security.QueueManagePage; |
||||
import org.testng.annotations.Test; |
||||
|
||||
|
||||
public class TestQueueManage extends BaseTest { |
||||
private QueueManagePage queueManagePage; |
||||
|
||||
@Test(groups={"functionTests","queue"},dependsOnGroups = { "login" },description = "TestQueueManage") |
||||
public void testTenantManage() throws InterruptedException { |
||||
queueManagePage = new QueueManagePage(driver); |
||||
//create queue
|
||||
System.out.println("start create queue"); |
||||
assert queueManagePage.createQueue(); |
||||
System.out.println("end create queue"); |
||||
System.out.println("==================================="); |
||||
|
||||
//edit queue
|
||||
System.out.println("start edit queue"); |
||||
assert queueManagePage.editQueue(); |
||||
System.out.println("end edit queue"); |
||||
System.out.println("==================================="); |
||||
} |
||||
} |
@ -0,0 +1,43 @@
|
||||
/* |
||||
* 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.TokenManagePage; |
||||
import org.testng.annotations.Test; |
||||
|
||||
public class TestTokenManage extends BaseTest { |
||||
private TokenManagePage tokenManagePage; |
||||
|
||||
@Test(groups={"functionTests","token"},dependsOnGroups = { "login" },description = "TestTokenManage") |
||||
public void testUserManage() throws InterruptedException { |
||||
tokenManagePage = new TokenManagePage(driver); |
||||
//generate token
|
||||
System.out.println("start create token"); |
||||
assert tokenManagePage.createToken(); |
||||
System.out.println("end create token"); |
||||
System.out.println("==================================="); |
||||
|
||||
|
||||
//edit token
|
||||
System.out.println("start edit token"); |
||||
assert tokenManagePage.editToken(); |
||||
System.out.println("end edit token"); |
||||
System.out.println("==================================="); |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue