Skip to content

Commit

Permalink
add feature 3862
Browse files Browse the repository at this point in the history
  • Loading branch information
SbloodyS committed Jul 16, 2024
1 parent c7328ae commit 5278573
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ jobs:
class: org.apache.streampark.e2e.cases.TeamManagementTest
- name: MemberManagementTest
class: org.apache.streampark.e2e.cases.MemberManagementTest
- name: Flink116OnYarnClustersTest
class: org.apache.streampark.e2e.cases.Flink116OnYarnClustersTest
- name: Flink117OnYarnClustersTest
class: org.apache.streampark.e2e.cases.Flink117OnYarnClustersTest
- name: Flink118OnYarnClustersTest
class: org.apache.streampark.e2e.cases.Flink118OnYarnClustersTest
- name: FlinkSQL116OnYarnTest
class: org.apache.streampark.e2e.cases.FlinkSQL116OnYarnTest
- name: FlinkSQL117OnYarnTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.streampark.e2e.pages.flink.clusters.ClusterDetailForm;
import org.apache.streampark.e2e.pages.flink.clusters.FlinkClustersPage;
import org.apache.streampark.e2e.pages.flink.clusters.YarnSessionForm;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.streampark.e2e.pages.flink.clusters.ClusterDetailForm;
import org.apache.streampark.e2e.pages.flink.clusters.FlinkClustersPage;
import org.apache.streampark.e2e.pages.flink.clusters.YarnSessionForm;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public <T> T addCluster(ExecutionMode executionMode) {
.click();
return (T) new YarnSessionForm(this);
default:
throw new UnsupportedOperationException(String.format("Unknown execution mode: %s", executionMode.desc()));
throw new UnsupportedOperationException(
String.format("Unknown execution mode: %s", executionMode.desc()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public <T extends SystemPage.Tab> T goToTab(Class<T> tab) {
return tab.cast(new RoleManagementPage(driver));
}
if (tab == TokenManagementPage.class) {
new WebDriverWait(driver, Duration.ofSeconds(10))
new WebDriverWait(driver, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION)
.until(ExpectedConditions.elementToBeClickable(menuTokenManagement));
menuTokenManagement.click();
return tab.cast(new TokenManagementPage(driver));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.streampark.e2e.pages.system;

import org.apache.streampark.e2e.pages.common.Constants;
import org.apache.streampark.e2e.pages.common.NavBarPage;

import lombok.Getter;
Expand All @@ -29,7 +30,6 @@
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.time.Duration;
import java.util.List;

@Getter
Expand All @@ -56,11 +56,11 @@ public TokenManagementPage(RemoteWebDriver driver) {
public TokenManagementPage createToken(String existUserName, String description) {
waitForPageLoading();

new WebDriverWait(driver, Duration.ofSeconds(10))
new WebDriverWait(driver, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION)
.until(ExpectedConditions.elementToBeClickable(buttonCreateToken));
buttonCreateToken.click();

new WebDriverWait(driver, Duration.ofSeconds(10))
new WebDriverWait(driver, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION)
.until(ExpectedConditions.elementToBeClickable(createTokenForm.inputUserName()));
createTokenForm.inputUserName().sendKeys(existUserName);
createTokenForm.inputUserName().sendKeys(Keys.RETURN);
Expand Down Expand Up @@ -97,15 +97,15 @@ public TokenManagementPage deleteToken(String existUserName) {
.orElseThrow(() -> new RuntimeException("No delete button in token list"))
.click();

new WebDriverWait(driver, Duration.ofSeconds(10))
new WebDriverWait(driver, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION)
.until(ExpectedConditions.elementToBeClickable(deleteConfirmButton));
deleteConfirmButton.click();

return this;
}

private void waitForPageLoading() {
new WebDriverWait(driver, Duration.ofSeconds(10))
new WebDriverWait(driver, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION)
.until(ExpectedConditions.urlContains("/system/token"));
}

Expand Down

0 comments on commit 5278573

Please sign in to comment.