|
|
@ -91,15 +91,18 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FileManagePage createDirectory(String name) { |
|
|
|
public FileManagePage createDirectory(String name) { |
|
|
|
|
|
|
|
waitForPageLoading(); |
|
|
|
buttonCreateDirectory().click(); |
|
|
|
buttonCreateDirectory().click(); |
|
|
|
|
|
|
|
|
|
|
|
createDirectoryBox().inputDirectoryName().sendKeys(name); |
|
|
|
createDirectoryBox().inputDirectoryName().sendKeys(name); |
|
|
|
|
|
|
|
WebDriverWaitFactory.createWebDriverWait(driver) |
|
|
|
|
|
|
|
.until(ExpectedConditions.elementToBeClickable(createDirectoryBox().buttonSubmit())); |
|
|
|
createDirectoryBox().buttonSubmit().click(); |
|
|
|
createDirectoryBox().buttonSubmit().click(); |
|
|
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FileManagePage cancelCreateDirectory(String name) { |
|
|
|
public FileManagePage cancelCreateDirectory(String name) { |
|
|
|
|
|
|
|
waitForPageLoading(); |
|
|
|
buttonCreateDirectory().click(); |
|
|
|
buttonCreateDirectory().click(); |
|
|
|
|
|
|
|
|
|
|
|
createDirectoryBox().inputDirectoryName().sendKeys(name); |
|
|
|
createDirectoryBox().inputDirectoryName().sendKeys(name); |
|
|
@ -109,6 +112,7 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FileManagePage rename(String currentName, String AfterName) { |
|
|
|
public FileManagePage rename(String currentName, String AfterName) { |
|
|
|
|
|
|
|
waitForPageLoading(); |
|
|
|
fileList() |
|
|
|
fileList() |
|
|
|
.stream() |
|
|
|
.stream() |
|
|
|
.filter(it -> it.getText().contains(currentName)) |
|
|
|
.filter(it -> it.getText().contains(currentName)) |
|
|
@ -138,12 +142,15 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { |
|
|
|
buttonCreateDirectory().click(); |
|
|
|
buttonCreateDirectory().click(); |
|
|
|
|
|
|
|
|
|
|
|
createDirectoryBox().inputDirectoryName().sendKeys(subDirectoryName); |
|
|
|
createDirectoryBox().inputDirectoryName().sendKeys(subDirectoryName); |
|
|
|
|
|
|
|
WebDriverWaitFactory.createWebDriverWait(driver) |
|
|
|
|
|
|
|
.until(ExpectedConditions.elementToBeClickable(createDirectoryBox().buttonSubmit())); |
|
|
|
createDirectoryBox().buttonSubmit().click(); |
|
|
|
createDirectoryBox().buttonSubmit().click(); |
|
|
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FileManagePage delete(String name) { |
|
|
|
public FileManagePage delete(String name) { |
|
|
|
|
|
|
|
waitForPageLoading(); |
|
|
|
fileList() |
|
|
|
fileList() |
|
|
|
.stream() |
|
|
|
.stream() |
|
|
|
.filter(it -> it.getText().contains(name)) |
|
|
|
.filter(it -> it.getText().contains(name)) |
|
|
@ -160,7 +167,7 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { |
|
|
|
|
|
|
|
|
|
|
|
// todo: add file type
|
|
|
|
// todo: add file type
|
|
|
|
public FileManagePage createFile(String fileName, String scripts) { |
|
|
|
public FileManagePage createFile(String fileName, String scripts) { |
|
|
|
|
|
|
|
waitForPageLoading(); |
|
|
|
WebDriverWaitFactory.createWebDriverWait(driver) |
|
|
|
WebDriverWaitFactory.createWebDriverWait(driver) |
|
|
|
.until(ExpectedConditions.elementToBeClickable(buttonCreateFile())); |
|
|
|
.until(ExpectedConditions.elementToBeClickable(buttonCreateFile())); |
|
|
|
|
|
|
|
|
|
|
@ -189,6 +196,7 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FileManagePage editFile(String fileName, String scripts) { |
|
|
|
public FileManagePage editFile(String fileName, String scripts) { |
|
|
|
|
|
|
|
waitForPageLoading(); |
|
|
|
fileList() |
|
|
|
fileList() |
|
|
|
.stream() |
|
|
|
.stream() |
|
|
|
.filter(it -> it.getText().contains(fileName)) |
|
|
|
.filter(it -> it.getText().contains(fileName)) |
|
|
@ -210,6 +218,7 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FileManagePage uploadFile(String filePath) { |
|
|
|
public FileManagePage uploadFile(String filePath) { |
|
|
|
|
|
|
|
waitForPageLoading(); |
|
|
|
buttonUploadFile().click(); |
|
|
|
buttonUploadFile().click(); |
|
|
|
|
|
|
|
|
|
|
|
driver.setFileDetector(new LocalFileDetector()); |
|
|
|
driver.setFileDetector(new LocalFileDetector()); |
|
|
@ -221,6 +230,7 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FileManagePage downloadFile(String fileName) { |
|
|
|
public FileManagePage downloadFile(String fileName) { |
|
|
|
|
|
|
|
waitForPageLoading(); |
|
|
|
fileList() |
|
|
|
fileList() |
|
|
|
.stream() |
|
|
|
.stream() |
|
|
|
.filter(it -> it.getText().contains(fileName)) |
|
|
|
.filter(it -> it.getText().contains(fileName)) |
|
|
@ -233,6 +243,10 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void waitForPageLoading() { |
|
|
|
|
|
|
|
WebDriverWaitFactory.createWebDriverWait(driver).until(ExpectedConditions.urlContains("/resource/file-manage")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Getter |
|
|
|
@Getter |
|
|
|
public class CreateDirectoryBox { |
|
|
|
public class CreateDirectoryBox { |
|
|
|
|
|
|
|
|
|
|
|