mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
few more changes trying to fix randomly failing tests
This commit is contained in:
@@ -27,6 +27,7 @@ describe('Create folder', () => {
|
||||
const username = 'jane.doe';
|
||||
const password = 'jane.doe';
|
||||
|
||||
const parent = 'parent-folder';
|
||||
const folderName1 = 'my-folder1';
|
||||
const folderName2 = 'my-folder2';
|
||||
const folderDescription = 'description of my folder';
|
||||
@@ -60,7 +61,7 @@ describe('Create folder', () => {
|
||||
.then(() => apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE))
|
||||
.then(() => apis.admin.nodes.createFolders([ folderName1 ], `Sites/${siteName}/documentLibrary`))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
||||
.then(() => apis.user.nodes.createFolders([ duplicateFolderName ]))
|
||||
.then(() => apis.user.nodes.createFolders([ duplicateFolderName ], parent))
|
||||
.then(() => loginPage.load())
|
||||
.then(() => loginPage.loginWith(username, password))
|
||||
.then(done);
|
||||
@@ -79,12 +80,7 @@ describe('Create folder', () => {
|
||||
afterAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
apis.user.nodes.deleteNodes([
|
||||
folderName1,
|
||||
folderName2,
|
||||
duplicateFolderName,
|
||||
nameWithSpaces.trim()
|
||||
]),
|
||||
apis.user.nodes.deleteNodes([ parent ]),
|
||||
logoutPage.load()
|
||||
.then(() => Utils.clearLocalStorage())
|
||||
])
|
||||
@@ -92,59 +88,67 @@ describe('Create folder', () => {
|
||||
});
|
||||
|
||||
it('option is enabled when having enough permissions', () => {
|
||||
personalFilesPage.sidenav.openNewMenu()
|
||||
.then((menu) => {
|
||||
const isEnabled = menu.getItemByLabel('Create folder').getWebElement().isEnabled();
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => personalFilesPage.sidenav.openNewMenu()
|
||||
.then((menu) => {
|
||||
const isEnabled = menu.getItemByLabel('Create folder').getWebElement().isEnabled();
|
||||
|
||||
expect(isEnabled).toBe(true, 'Create folder is not enabled');
|
||||
});
|
||||
expect(isEnabled).toBe(true, 'Create folder is not enabled');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('creates new folder with name', () => {
|
||||
openCreateDialog()
|
||||
.then(() => createDialog.enterName(folderName1).clickCreate())
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByContainingText(folderName1).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => createDialog.enterName(folderName1).clickCreate())
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByContainingText(folderName1).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('creates new folder with name and description', () => {
|
||||
openCreateDialog()
|
||||
.then(() => {
|
||||
createDialog
|
||||
.enterName(folderName2)
|
||||
.enterDescription(folderDescription)
|
||||
.clickCreate();
|
||||
})
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByContainingText(folderName2).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
})
|
||||
.then(() => {
|
||||
apis.user.nodes.getNodeDescription(folderName2)
|
||||
.then((description) => {
|
||||
expect(description).toEqual(folderDescription, 'Description is not correct');
|
||||
});
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => {
|
||||
createDialog
|
||||
.enterName(folderName2)
|
||||
.enterDescription(folderDescription)
|
||||
.clickCreate();
|
||||
})
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByContainingText(folderName2).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
})
|
||||
.then(() => {
|
||||
apis.user.nodes.getNodeDescription(folderName2)
|
||||
.then((description) => {
|
||||
expect(description).toEqual(folderDescription, 'Description is not correct');
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('enabled option tooltip', () => {
|
||||
personalFilesPage.sidenav.openNewMenu()
|
||||
.then(menu => {
|
||||
const action = browser.actions().mouseMove(menu.getItemByLabel('Create folder'));
|
||||
action.perform();
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => personalFilesPage.sidenav.openNewMenu()
|
||||
.then(menu => {
|
||||
const action = browser.actions().mouseMove(menu.getItemByLabel('Create folder'));
|
||||
action.perform();
|
||||
|
||||
return menu;
|
||||
})
|
||||
.then((menu) => {
|
||||
const tooltip = menu.getItemTooltip('Create folder');
|
||||
expect(tooltip).toContain('Create new folder');
|
||||
});
|
||||
return menu;
|
||||
})
|
||||
.then((menu) => {
|
||||
const tooltip = menu.getItemTooltip('Create folder');
|
||||
expect(tooltip).toContain('Create new folder');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('option is disabled when not enough permissions', () => {
|
||||
@@ -178,107 +182,123 @@ describe('Create folder', () => {
|
||||
});
|
||||
|
||||
it('dialog UI elements', () => {
|
||||
openCreateDialog().then(() => {
|
||||
const dialogTitle = createDialog.getTitle();
|
||||
const isFolderNameDisplayed = createDialog.nameInput.getWebElement().isDisplayed();
|
||||
const isDescriptionDisplayed = createDialog.descriptionTextArea.getWebElement().isDisplayed();
|
||||
const isCreateEnabled = createDialog.createButton.getWebElement().isEnabled();
|
||||
const isCancelEnabled = createDialog.cancelButton.getWebElement().isEnabled();
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog().then(() => {
|
||||
const dialogTitle = createDialog.getTitle();
|
||||
const isFolderNameDisplayed = createDialog.nameInput.getWebElement().isDisplayed();
|
||||
const isDescriptionDisplayed = createDialog.descriptionTextArea.getWebElement().isDisplayed();
|
||||
const isCreateEnabled = createDialog.createButton.getWebElement().isEnabled();
|
||||
const isCancelEnabled = createDialog.cancelButton.getWebElement().isEnabled();
|
||||
|
||||
expect(dialogTitle).toBe('Create new folder');
|
||||
expect(isFolderNameDisplayed).toBe(true, 'Name input is not displayed');
|
||||
expect(isDescriptionDisplayed).toBe(true, 'Description field is not displayed');
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(isCancelEnabled).toBe(true, 'Cancel button is not enabled');
|
||||
});
|
||||
expect(dialogTitle).toBe('Create new folder');
|
||||
expect(isFolderNameDisplayed).toBe(true, 'Name input is not displayed');
|
||||
expect(isDescriptionDisplayed).toBe(true, 'Description field is not displayed');
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(isCancelEnabled).toBe(true, 'Cancel button is not enabled');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('with empty folder name', () => {
|
||||
openCreateDialog()
|
||||
.then(() => {
|
||||
createDialog.deleteNameWithBackspace();
|
||||
})
|
||||
.then(() => {
|
||||
const isCreateEnabled = createDialog.createButton.getWebElement().isEnabled();
|
||||
const validationMessage = createDialog.getValidationMessage();
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => {
|
||||
createDialog.deleteNameWithBackspace();
|
||||
})
|
||||
.then(() => {
|
||||
const isCreateEnabled = createDialog.createButton.getWebElement().isEnabled();
|
||||
const validationMessage = createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is enabled');
|
||||
expect(validationMessage).toMatch('Folder name is required');
|
||||
});
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is enabled');
|
||||
expect(validationMessage).toMatch('Folder name is required');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('with folder name ending with a dot "."', () => {
|
||||
openCreateDialog()
|
||||
.then(() => createDialog.enterName('folder-name.'))
|
||||
.then((dialog) => {
|
||||
const isCreateEnabled = dialog.createButton.getWebElement().isEnabled();
|
||||
const validationMessage = dialog.getValidationMessage();
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => createDialog.enterName('folder-name.'))
|
||||
.then((dialog) => {
|
||||
const isCreateEnabled = dialog.createButton.getWebElement().isEnabled();
|
||||
const validationMessage = dialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toMatch(`Folder name can't end with a period .`);
|
||||
});
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toMatch(`Folder name can't end with a period .`);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('with folder name containing special characters', () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
|
||||
openCreateDialog()
|
||||
.then(() => {
|
||||
namesWithSpecialChars.forEach(name => {
|
||||
createDialog.enterName(name);
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => {
|
||||
namesWithSpecialChars.forEach(name => {
|
||||
createDialog.enterName(name);
|
||||
|
||||
const isCreateEnabled = createDialog.createButton.getWebElement().isEnabled();
|
||||
const validationMessage = createDialog.getValidationMessage();
|
||||
const isCreateEnabled = createDialog.createButton.getWebElement().isEnabled();
|
||||
const validationMessage = createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toContain(`Folder name can't contain these characters`);
|
||||
});
|
||||
});
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toContain(`Folder name can't contain these characters`);
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('with folder name containing only spaces', () => {
|
||||
openCreateDialog()
|
||||
.then(() => createDialog.enterName(' '))
|
||||
.then((dialog) => {
|
||||
const isCreateEnabled = dialog.createButton.getWebElement().isEnabled();
|
||||
const validationMessage = dialog.getValidationMessage();
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => createDialog.enterName(' '))
|
||||
.then((dialog) => {
|
||||
const isCreateEnabled = dialog.createButton.getWebElement().isEnabled();
|
||||
const validationMessage = dialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toMatch(`Folder name can't contain only spaces`);
|
||||
});
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toMatch(`Folder name can't contain only spaces`);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('cancel folder creation', () => {
|
||||
openCreateDialog()
|
||||
.then(() => {
|
||||
createDialog
|
||||
.enterName('test')
|
||||
.enterDescription('test description')
|
||||
.clickCancel();
|
||||
})
|
||||
.then(() => expect(createDialog.component.isPresent()).not.toBe(true, 'dialog is not closed'));
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => {
|
||||
createDialog
|
||||
.enterName('test')
|
||||
.enterDescription('test description')
|
||||
.clickCancel();
|
||||
})
|
||||
.then(() => expect(createDialog.component.isPresent()).not.toBe(true, 'dialog is not closed'))
|
||||
);
|
||||
});
|
||||
|
||||
it('duplicate folder name', () => {
|
||||
openCreateDialog()
|
||||
.then(() => createDialog.enterName(duplicateFolderName).clickCreate())
|
||||
.then(() => {
|
||||
personalFilesPage.getSnackBarMessage()
|
||||
.then(message => {
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(createDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => createDialog.enterName(duplicateFolderName).clickCreate())
|
||||
.then(() => {
|
||||
personalFilesPage.getSnackBarMessage()
|
||||
.then(message => {
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(createDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('trim ending spaces from folder name', () => {
|
||||
openCreateDialog()
|
||||
.then(() => createDialog.enterName(nameWithSpaces).clickCreate())
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByContainingText(nameWithSpaces.trim()).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => openCreateDialog()
|
||||
.then(() => createDialog.enterName(nameWithSpaces).clickCreate())
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByContainingText(nameWithSpaces.trim()).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@@ -23,9 +23,10 @@ import { CreateOrEditFolderDialog } from '../../components/dialog/create-edit-fo
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Edit folder', () => {
|
||||
const username = 'jane.doe';
|
||||
const password = 'jane.doe';
|
||||
const username = 'john.doe';
|
||||
const password = 'john.doe';
|
||||
|
||||
const parent = 'parent-folder';
|
||||
const folderName = 'my-folder';
|
||||
const folderDescription = 'my folder description';
|
||||
|
||||
@@ -58,11 +59,11 @@ describe('Edit folder', () => {
|
||||
])
|
||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
||||
.then(() => Promise.all([
|
||||
apis.user.nodes.createNodeWithProperties( folderName, '', folderDescription ),
|
||||
apis.user.nodes.createFolders([ folderNameToEdit, duplicateFolderName ]),
|
||||
apis.user.nodes.createNodeWithProperties( folderName, '', folderDescription, parent ),
|
||||
apis.user.nodes.createFolders([ folderNameToEdit, duplicateFolderName ], parent),
|
||||
loginPage.load()
|
||||
]))
|
||||
.then(() => { loginPage.loginWith(username, password); })
|
||||
.then(() => loginPage.loginWith(username, password))
|
||||
.then(done);
|
||||
});
|
||||
|
||||
@@ -80,7 +81,7 @@ describe('Edit folder', () => {
|
||||
Promise
|
||||
.all([
|
||||
apis.admin.sites.deleteSite(siteName, true),
|
||||
apis.user.nodes.deleteNodes([ folderName, folderNameEdited, duplicateFolderName ]),
|
||||
apis.user.nodes.deleteNodes([ parent ]),
|
||||
logoutPage.load()
|
||||
.then(() => Utils.clearLocalStorage())
|
||||
])
|
||||
@@ -88,45 +89,51 @@ describe('Edit folder', () => {
|
||||
});
|
||||
|
||||
it('button is enabled when having permissions', () => {
|
||||
dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => {
|
||||
expect(editButton.isEnabled()).toBe(true);
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => {
|
||||
expect(editButton.isEnabled()).toBe(true);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('dialog UI defaults', () => {
|
||||
dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
expect(editDialog.getTitle()).toBe('Edit folder');
|
||||
expect(editDialog.nameInput.getWebElement().getAttribute('value')).toBe(folderName);
|
||||
expect(editDialog.descriptionTextArea.getWebElement().getAttribute('value')).toBe(folderDescription);
|
||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(true, 'upload button is not enabled');
|
||||
expect(editDialog.cancelButton.getWebElement().isEnabled()).toBe(true, 'cancel button is not enabled');
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
expect(editDialog.getTitle()).toBe('Edit folder');
|
||||
expect(editDialog.nameInput.getWebElement().getAttribute('value')).toBe(folderName);
|
||||
expect(editDialog.descriptionTextArea.getWebElement().getAttribute('value')).toBe(folderDescription);
|
||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(true, 'upload button is not enabled');
|
||||
expect(editDialog.cancelButton.getWebElement().isEnabled()).toBe(true, 'cancel button is not enabled');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('folder properties are modified when pressing OK', () => {
|
||||
dataTable.clickOnRowByContainingText(folderNameToEdit)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
editDialog
|
||||
.enterName(folderNameEdited)
|
||||
.enterDescription(folderDescriptionEdited)
|
||||
.clickUpdate();
|
||||
})
|
||||
.then(() => editDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByContainingText(folderNameEdited).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
})
|
||||
.then(() => {
|
||||
apis.user.nodes.getNodeDescription(folderNameEdited)
|
||||
.then((description) => {
|
||||
expect(description).toEqual(folderDescriptionEdited);
|
||||
});
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderNameToEdit)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
editDialog
|
||||
.enterName(folderNameEdited)
|
||||
.enterDescription(folderDescriptionEdited)
|
||||
.clickUpdate();
|
||||
})
|
||||
.then(() => editDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByContainingText(folderNameEdited).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
})
|
||||
.then(() => {
|
||||
apis.user.nodes.getNodeDescription(folderNameEdited)
|
||||
.then((description) => {
|
||||
expect(description).toEqual(folderDescriptionEdited);
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('button is not displayed when not enough permissions', () => {
|
||||
@@ -141,71 +148,85 @@ describe('Edit folder', () => {
|
||||
});
|
||||
|
||||
it('with empty folder name', () => {
|
||||
dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
editDialog.deleteNameWithBackspace();
|
||||
})
|
||||
.then(() => {
|
||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not enabled');
|
||||
expect(editDialog.getValidationMessage()).toMatch('Folder name is required');
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
editDialog.deleteNameWithBackspace();
|
||||
})
|
||||
.then(() => {
|
||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not enabled');
|
||||
expect(editDialog.getValidationMessage()).toMatch('Folder name is required');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('with name with special characters', () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
|
||||
dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
namesWithSpecialChars.forEach(name => {
|
||||
editDialog.enterName(name);
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
namesWithSpecialChars.forEach(name => {
|
||||
editDialog.enterName(name);
|
||||
|
||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not disabled');
|
||||
expect(editDialog.getValidationMessage()).toContain(`Folder name can't contain these characters`);
|
||||
});
|
||||
});
|
||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not disabled');
|
||||
expect(editDialog.getValidationMessage()).toContain(`Folder name can't contain these characters`);
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('with name ending with a dot', () => {
|
||||
dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.nameInput.sendKeys('.'))
|
||||
.then(() => {
|
||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not enabled');
|
||||
expect(editDialog.getValidationMessage()).toMatch(`Folder name can't end with a period .`);
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.nameInput.sendKeys('.'))
|
||||
.then(() => {
|
||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not enabled');
|
||||
expect(editDialog.getValidationMessage()).toMatch(`Folder name can't end with a period .`);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('Cancel button', () => {
|
||||
dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.clickCancel())
|
||||
.then(() => { expect(editDialog.component.isPresent()).not.toBe(true, 'dialog is not closed'); });
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.clickCancel())
|
||||
.then(() => {
|
||||
expect(editDialog.component.isPresent()).not.toBe(true, 'dialog is not closed');
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('with duplicate folder name', () => {
|
||||
dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.enterName(duplicateFolderName).clickUpdate())
|
||||
.then(() => {
|
||||
personalFilesPage.getSnackBarMessage()
|
||||
.then(message => {
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(editDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.enterName(duplicateFolderName).clickUpdate())
|
||||
.then(() => {
|
||||
personalFilesPage.getSnackBarMessage()
|
||||
.then(message => {
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(editDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('trim ending spaces', () => {
|
||||
dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.nameInput.sendKeys(' '))
|
||||
.then(() => editDialog.clickUpdate())
|
||||
.then(() => editDialog.waitForDialogToClose())
|
||||
.then(() => {
|
||||
expect(personalFilesPage.snackBar.isPresent()).not.toBe(true, 'notification appears');
|
||||
expect(dataTable.getRowByContainingText(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.nameInput.sendKeys(' '))
|
||||
.then(() => editDialog.clickUpdate())
|
||||
.then(() => editDialog.waitForDialogToClose())
|
||||
.then(() => {
|
||||
expect(personalFilesPage.snackBar.isPresent()).not.toBe(true, 'notification appears');
|
||||
expect(dataTable.getRowByContainingText(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user