|
|
@ -19,7 +19,6 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.apache.dolphinscheduler.e2e.cases; |
|
|
|
package org.apache.dolphinscheduler.e2e.cases; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.e2e.core.Constants; |
|
|
|
import org.apache.dolphinscheduler.e2e.core.Constants; |
|
|
@ -37,10 +36,10 @@ import java.io.IOException; |
|
|
|
import java.io.RandomAccessFile; |
|
|
|
import java.io.RandomAccessFile; |
|
|
|
import java.nio.file.Files; |
|
|
|
import java.nio.file.Files; |
|
|
|
import java.nio.file.Path; |
|
|
|
import java.nio.file.Path; |
|
|
|
import java.time.Duration; |
|
|
|
|
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.Comparator; |
|
|
|
|
|
|
|
|
|
|
|
import org.testcontainers.shaded.org.awaitility.Awaitility; |
|
|
|
import lombok.SneakyThrows; |
|
|
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.AfterAll; |
|
|
|
import org.junit.jupiter.api.AfterAll; |
|
|
|
import org.junit.jupiter.api.BeforeAll; |
|
|
|
import org.junit.jupiter.api.BeforeAll; |
|
|
|
import org.junit.jupiter.api.Order; |
|
|
|
import org.junit.jupiter.api.Order; |
|
|
@ -49,12 +48,11 @@ import org.openqa.selenium.By; |
|
|
|
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.ui.ExpectedConditions; |
|
|
|
import org.openqa.selenium.support.ui.ExpectedConditions; |
|
|
|
import org.openqa.selenium.support.ui.WebDriverWait; |
|
|
|
import org.testcontainers.shaded.org.awaitility.Awaitility; |
|
|
|
|
|
|
|
|
|
|
|
import lombok.SneakyThrows; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@DolphinScheduler(composeFiles = "docker/file-manage/docker-compose.yaml") |
|
|
|
@DolphinScheduler(composeFiles = "docker/file-manage/docker-compose.yaml") |
|
|
|
public class FileManageE2ETest { |
|
|
|
public class FileManageE2ETest { |
|
|
|
|
|
|
|
|
|
|
|
private static RemoteWebDriver browser; |
|
|
|
private static RemoteWebDriver browser; |
|
|
|
|
|
|
|
|
|
|
|
private static final String tenant = System.getProperty("user.name"); |
|
|
|
private static final String tenant = System.getProperty("user.name"); |
|
|
@ -92,19 +90,19 @@ public class FileManageE2ETest { |
|
|
|
.create(tenant); |
|
|
|
.create(tenant); |
|
|
|
|
|
|
|
|
|
|
|
Awaitility.await().untilAsserted(() -> assertThat(tenantPage.tenantList()) |
|
|
|
Awaitility.await().untilAsserted(() -> assertThat(tenantPage.tenantList()) |
|
|
|
.as("Tenant list should contain newly-created tenant") |
|
|
|
.as("Tenant list should contain newly-created tenant") |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.anyMatch(it -> it.contains(tenant))); |
|
|
|
.anyMatch(it -> it.contains(tenant))); |
|
|
|
|
|
|
|
|
|
|
|
UserPage userPage = tenantPage.goToNav(SecurityPage.class) |
|
|
|
UserPage userPage = tenantPage.goToNav(SecurityPage.class) |
|
|
|
.goToTab(UserPage.class); |
|
|
|
.goToTab(UserPage.class); |
|
|
|
|
|
|
|
|
|
|
|
WebDriverWaitFactory.createWebDriverWait(userPage.driver()).until(ExpectedConditions.visibilityOfElementLocated( |
|
|
|
WebDriverWaitFactory.createWebDriverWait(userPage.driver()).until(ExpectedConditions.visibilityOfElementLocated( |
|
|
|
new By.ByClassName("name"))); |
|
|
|
new By.ByClassName("name"))); |
|
|
|
|
|
|
|
|
|
|
|
userPage.update(user, user, email, phone, tenant) |
|
|
|
userPage.update(user, user, email, phone, tenant) |
|
|
|
.goToNav(ResourcePage.class) |
|
|
|
.goToNav(ResourcePage.class) |
|
|
|
.goToTab(FileManagePage.class); |
|
|
|
.goToTab(FileManagePage.class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@AfterAll |
|
|
|
@AfterAll |
|
|
@ -113,9 +111,9 @@ public class FileManageE2ETest { |
|
|
|
Files.deleteIfExists(testUnder1GBFilePath); |
|
|
|
Files.deleteIfExists(testUnder1GBFilePath); |
|
|
|
Files.deleteIfExists(testOver1GBFilePath); |
|
|
|
Files.deleteIfExists(testOver1GBFilePath); |
|
|
|
Files.walk(Constants.HOST_CHROME_DOWNLOAD_PATH) |
|
|
|
Files.walk(Constants.HOST_CHROME_DOWNLOAD_PATH) |
|
|
|
.sorted(Comparator.reverseOrder()) |
|
|
|
.sorted(Comparator.reverseOrder()) |
|
|
|
.map(Path::toFile) |
|
|
|
.map(Path::toFile) |
|
|
|
.forEach(File::delete); |
|
|
|
.forEach(File::delete); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
@ -139,57 +137,57 @@ public class FileManageE2ETest { |
|
|
|
page.cancelCreateDirectory(testDirectoryName); |
|
|
|
page.cancelCreateDirectory(testDirectoryName); |
|
|
|
|
|
|
|
|
|
|
|
Awaitility.await().untilAsserted(() -> assertThat(page.fileList()) |
|
|
|
Awaitility.await().untilAsserted(() -> assertThat(page.fileList()) |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.anyMatch(it -> it.contains(testDirectoryName))); |
|
|
|
.anyMatch(it -> it.contains(testDirectoryName))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
// @Test
|
|
|
|
// @Order(20)
|
|
|
|
// @Order(20)
|
|
|
|
// void testCreateDuplicateDirectory() {
|
|
|
|
// void testCreateDuplicateDirectory() {
|
|
|
|
// final FileManagePage page = new FileManagePage(browser);
|
|
|
|
// final FileManagePage page = new FileManagePage(browser);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// page.createDirectory(testDirectoryName, "test_desc");
|
|
|
|
// page.createDirectory(testDirectoryName, "test_desc");
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// await().untilAsserted(() -> assertThat(browser.findElement(By.tagName("body")).getText())
|
|
|
|
// await().untilAsserted(() -> assertThat(browser.findElement(By.tagName("body")).getText())
|
|
|
|
// .contains("resource already exists")
|
|
|
|
// .contains("resource already exists")
|
|
|
|
// );
|
|
|
|
// );
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// page.createDirectoryBox().buttonCancel().click();
|
|
|
|
// page.createDirectoryBox().buttonCancel().click();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
// @Test
|
|
|
|
// @Order(21)
|
|
|
|
// @Order(21)
|
|
|
|
// void testCreateSubDirectory() {
|
|
|
|
// void testCreateSubDirectory() {
|
|
|
|
// final FileManagePage page = new FileManagePage(browser);
|
|
|
|
// final FileManagePage page = new FileManagePage(browser);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// page.createSubDirectory(testDirectoryName, testSubDirectoryName, "test_desc");
|
|
|
|
// page.createSubDirectory(testDirectoryName, testSubDirectoryName, "test_desc");
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// await().untilAsserted(() -> assertThat(page.fileList())
|
|
|
|
// await().untilAsserted(() -> assertThat(page.fileList())
|
|
|
|
// .as("File list should contain newly-created file")
|
|
|
|
// .as("File list should contain newly-created file")
|
|
|
|
// .extracting(WebElement::getText)
|
|
|
|
// .extracting(WebElement::getText)
|
|
|
|
// .anyMatch(it -> it.contains(testSubDirectoryName)));
|
|
|
|
// .anyMatch(it -> it.contains(testSubDirectoryName)));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|
* when the storage is s3,the directory cannot be renamed |
|
|
|
* when the storage is s3,the directory cannot be renamed |
|
|
|
* */ |
|
|
|
*/ |
|
|
|
// @Test
|
|
|
|
// @Test
|
|
|
|
// @Order(22)
|
|
|
|
// @Order(22)
|
|
|
|
// void testRenameDirectory() {
|
|
|
|
// void testRenameDirectory() {
|
|
|
|
// final FileManagePage page = new FileManagePage(browser);
|
|
|
|
// final FileManagePage page = new FileManagePage(browser);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// page.rename(testDirectoryName, testRenameDirectoryName);
|
|
|
|
// page.rename(testDirectoryName, testRenameDirectoryName);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// await().untilAsserted(() -> {
|
|
|
|
// await().untilAsserted(() -> {
|
|
|
|
// browser.navigate().refresh();
|
|
|
|
// browser.navigate().refresh();
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// assertThat(page.fileList())
|
|
|
|
// assertThat(page.fileList())
|
|
|
|
// .as("File list should contain newly-created file")
|
|
|
|
// .as("File list should contain newly-created file")
|
|
|
|
// .extracting(WebElement::getText)
|
|
|
|
// .extracting(WebElement::getText)
|
|
|
|
// .anyMatch(it -> it.contains(testRenameDirectoryName));
|
|
|
|
// .anyMatch(it -> it.contains(testRenameDirectoryName));
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@Order(30) |
|
|
|
@Order(30) |
|
|
@ -197,17 +195,15 @@ public class FileManageE2ETest { |
|
|
|
final FileManagePage page = new FileManagePage(browser); |
|
|
|
final FileManagePage page = new FileManagePage(browser); |
|
|
|
|
|
|
|
|
|
|
|
page.goToNav(ResourcePage.class) |
|
|
|
page.goToNav(ResourcePage.class) |
|
|
|
.goToTab(FileManagePage.class) |
|
|
|
.goToTab(FileManagePage.class) |
|
|
|
.delete(testDirectoryName); |
|
|
|
.delete(testDirectoryName); |
|
|
|
|
|
|
|
|
|
|
|
Awaitility.await().untilAsserted(() -> { |
|
|
|
Awaitility.await().untilAsserted(() -> { |
|
|
|
browser.navigate().refresh(); |
|
|
|
browser.navigate().refresh(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat( |
|
|
|
assertThat( |
|
|
|
page.fileList() |
|
|
|
page.fileList()).noneMatch( |
|
|
|
).noneMatch( |
|
|
|
it -> it.getText().contains(testDirectoryName)); |
|
|
|
it -> it.getText().contains(testDirectoryName) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -220,9 +216,9 @@ public class FileManageE2ETest { |
|
|
|
page.createFile(testFileName, scripts); |
|
|
|
page.createFile(testFileName, scripts); |
|
|
|
|
|
|
|
|
|
|
|
Awaitility.await().untilAsserted(() -> assertThat(page.fileList()) |
|
|
|
Awaitility.await().untilAsserted(() -> assertThat(page.fileList()) |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.anyMatch(it -> it.contains(testFileName))); |
|
|
|
.anyMatch(it -> it.contains(testFileName))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
@ -236,9 +232,9 @@ public class FileManageE2ETest { |
|
|
|
browser.navigate().refresh(); |
|
|
|
browser.navigate().refresh(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(page.fileList()) |
|
|
|
assertThat(page.fileList()) |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.anyMatch(it -> it.contains(testRenameFileName)); |
|
|
|
.anyMatch(it -> it.contains(testRenameFileName)); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -251,9 +247,9 @@ public class FileManageE2ETest { |
|
|
|
page.editFile(testRenameFileName, scripts); |
|
|
|
page.editFile(testRenameFileName, scripts); |
|
|
|
|
|
|
|
|
|
|
|
Awaitility.await().untilAsserted(() -> assertThat(page.fileList()) |
|
|
|
Awaitility.await().untilAsserted(() -> assertThat(page.fileList()) |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.anyMatch(it -> it.contains(testRenameFileName))); |
|
|
|
.anyMatch(it -> it.contains(testRenameFileName))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
@ -267,10 +263,8 @@ public class FileManageE2ETest { |
|
|
|
browser.navigate().refresh(); |
|
|
|
browser.navigate().refresh(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat( |
|
|
|
assertThat( |
|
|
|
page.fileList() |
|
|
|
page.fileList()).noneMatch( |
|
|
|
).noneMatch( |
|
|
|
it -> it.getText().contains(testRenameFileName)); |
|
|
|
it -> it.getText().contains(testRenameFileName) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -286,13 +280,14 @@ public class FileManageE2ETest { |
|
|
|
|
|
|
|
|
|
|
|
page.uploadFile(testUnder1GBFilePath.toFile().getAbsolutePath()); |
|
|
|
page.uploadFile(testUnder1GBFilePath.toFile().getAbsolutePath()); |
|
|
|
|
|
|
|
|
|
|
|
WebDriverWaitFactory.createWebDriverWait(browser).until(ExpectedConditions.invisibilityOfElementLocated(By.id("fileUpdateDialog"))); |
|
|
|
WebDriverWaitFactory.createWebDriverWait(browser) |
|
|
|
|
|
|
|
.until(ExpectedConditions.invisibilityOfElementLocated(By.id("fileUpdateDialog"))); |
|
|
|
|
|
|
|
|
|
|
|
Awaitility.await().untilAsserted(() -> { |
|
|
|
Awaitility.await().untilAsserted(() -> { |
|
|
|
assertThat(page.fileList()) |
|
|
|
assertThat(page.fileList()) |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.as("File list should contain newly-created file") |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.extracting(WebElement::getText) |
|
|
|
.anyMatch(it -> it.contains(testUnder1GBFileName)); |
|
|
|
.anyMatch(it -> it.contains(testUnder1GBFileName)); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|