|
@@ -17,6 +17,7 @@
|
|
* under the License.
|
|
* under the License.
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
|
|
+
|
|
package org.apache.dolphinscheduler.e2e.pages.security;
|
|
package org.apache.dolphinscheduler.e2e.pages.security;
|
|
|
|
|
|
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
|
|
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
|
|
@@ -26,11 +27,11 @@ import org.openqa.selenium.JavascriptExecutor;
|
|
import org.openqa.selenium.WebElement;
|
|
import org.openqa.selenium.WebElement;
|
|
import org.openqa.selenium.remote.RemoteWebDriver;
|
|
import org.openqa.selenium.remote.RemoteWebDriver;
|
|
import org.openqa.selenium.support.FindBy;
|
|
import org.openqa.selenium.support.FindBy;
|
|
-
|
|
|
|
-import lombok.Getter;
|
|
|
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
|
|
|
|
|
|
|
+import lombok.Getter;
|
|
|
|
+
|
|
@Getter
|
|
@Getter
|
|
public class SecurityPage extends NavBarPage implements NavBarItem {
|
|
public class SecurityPage extends NavBarPage implements NavBarItem {
|
|
@FindBy(className = "tab-tenant-manage")
|
|
@FindBy(className = "tab-tenant-manage")
|
|
@@ -48,6 +49,9 @@ public class SecurityPage extends NavBarPage implements NavBarItem {
|
|
@FindBy(className = "tab-environment-manage")
|
|
@FindBy(className = "tab-environment-manage")
|
|
private WebElement menuEnvironmentManage;
|
|
private WebElement menuEnvironmentManage;
|
|
|
|
|
|
|
|
+ @FindBy(className = "tab-token-manage")
|
|
|
|
+ private WebElement menuTokenManage;
|
|
|
|
+
|
|
public SecurityPage(RemoteWebDriver driver) {
|
|
public SecurityPage(RemoteWebDriver driver) {
|
|
super(driver);
|
|
super(driver);
|
|
}
|
|
}
|
|
@@ -56,20 +60,20 @@ public class SecurityPage extends NavBarPage implements NavBarItem {
|
|
if (tab == TenantPage.class) {
|
|
if (tab == TenantPage.class) {
|
|
WebElement menuTenantManageElement = new WebDriverWait(driver, 60)
|
|
WebElement menuTenantManageElement = new WebDriverWait(driver, 60)
|
|
.until(ExpectedConditions.elementToBeClickable(menuTenantManage));
|
|
.until(ExpectedConditions.elementToBeClickable(menuTenantManage));
|
|
- ((JavascriptExecutor)driver).executeScript("arguments[0].click();", menuTenantManageElement);
|
|
|
|
|
|
+ ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuTenantManageElement);
|
|
return tab.cast(new TenantPage(driver));
|
|
return tab.cast(new TenantPage(driver));
|
|
}
|
|
}
|
|
if (tab == UserPage.class) {
|
|
if (tab == UserPage.class) {
|
|
WebElement menUserManageElement = new WebDriverWait(driver, 60)
|
|
WebElement menUserManageElement = new WebDriverWait(driver, 60)
|
|
.until(ExpectedConditions.elementToBeClickable(menUserManage));
|
|
.until(ExpectedConditions.elementToBeClickable(menUserManage));
|
|
- ((JavascriptExecutor)driver).executeScript("arguments[0].click();", menUserManageElement);
|
|
|
|
|
|
+ ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menUserManageElement);
|
|
new WebDriverWait(driver, 25).until(ExpectedConditions.urlContains("/#/security/users"));
|
|
new WebDriverWait(driver, 25).until(ExpectedConditions.urlContains("/#/security/users"));
|
|
return tab.cast(new UserPage(driver));
|
|
return tab.cast(new UserPage(driver));
|
|
}
|
|
}
|
|
if (tab == WorkerGroupPage.class) {
|
|
if (tab == WorkerGroupPage.class) {
|
|
WebElement menWorkerGroupManageElement = new WebDriverWait(driver, 60)
|
|
WebElement menWorkerGroupManageElement = new WebDriverWait(driver, 60)
|
|
.until(ExpectedConditions.elementToBeClickable(menWorkerGroupManage));
|
|
.until(ExpectedConditions.elementToBeClickable(menWorkerGroupManage));
|
|
- ((JavascriptExecutor)driver).executeScript("arguments[0].click();", menWorkerGroupManageElement);
|
|
|
|
|
|
+ ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menWorkerGroupManageElement);
|
|
return tab.cast(new WorkerGroupPage(driver));
|
|
return tab.cast(new WorkerGroupPage(driver));
|
|
}
|
|
}
|
|
if (tab == QueuePage.class) {
|
|
if (tab == QueuePage.class) {
|
|
@@ -80,6 +84,10 @@ public class SecurityPage extends NavBarPage implements NavBarItem {
|
|
menuEnvironmentManage().click();
|
|
menuEnvironmentManage().click();
|
|
return tab.cast(new EnvironmentPage(driver));
|
|
return tab.cast(new EnvironmentPage(driver));
|
|
}
|
|
}
|
|
|
|
+ if (tab == TokenPage.class) {
|
|
|
|
+ menuTokenManage().click();
|
|
|
|
+ return tab.cast(new TokenPage(driver));
|
|
|
|
+ }
|
|
throw new UnsupportedOperationException("Unknown tab: " + tab.getName());
|
|
throw new UnsupportedOperationException("Unknown tab: " + tab.getName());
|
|
}
|
|
}
|
|
|
|
|