mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +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 username = 'jane.doe';
|
||||||
const password = 'jane.doe';
|
const password = 'jane.doe';
|
||||||
|
|
||||||
|
const parent = 'parent-folder';
|
||||||
const folderName1 = 'my-folder1';
|
const folderName1 = 'my-folder1';
|
||||||
const folderName2 = 'my-folder2';
|
const folderName2 = 'my-folder2';
|
||||||
const folderDescription = 'description of my folder';
|
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.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE))
|
||||||
.then(() => apis.admin.nodes.createFolders([ folderName1 ], `Sites/${siteName}/documentLibrary`))
|
.then(() => apis.admin.nodes.createFolders([ folderName1 ], `Sites/${siteName}/documentLibrary`))
|
||||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
.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.load())
|
||||||
.then(() => loginPage.loginWith(username, password))
|
.then(() => loginPage.loginWith(username, password))
|
||||||
.then(done);
|
.then(done);
|
||||||
@@ -79,12 +80,7 @@ describe('Create folder', () => {
|
|||||||
afterAll(done => {
|
afterAll(done => {
|
||||||
Promise
|
Promise
|
||||||
.all([
|
.all([
|
||||||
apis.user.nodes.deleteNodes([
|
apis.user.nodes.deleteNodes([ parent ]),
|
||||||
folderName1,
|
|
||||||
folderName2,
|
|
||||||
duplicateFolderName,
|
|
||||||
nameWithSpaces.trim()
|
|
||||||
]),
|
|
||||||
logoutPage.load()
|
logoutPage.load()
|
||||||
.then(() => Utils.clearLocalStorage())
|
.then(() => Utils.clearLocalStorage())
|
||||||
])
|
])
|
||||||
@@ -92,27 +88,32 @@ describe('Create folder', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('option is enabled when having enough permissions', () => {
|
it('option is enabled when having enough permissions', () => {
|
||||||
personalFilesPage.sidenav.openNewMenu()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => personalFilesPage.sidenav.openNewMenu()
|
||||||
.then((menu) => {
|
.then((menu) => {
|
||||||
const isEnabled = menu.getItemByLabel('Create folder').getWebElement().isEnabled();
|
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', () => {
|
it('creates new folder with name', () => {
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => createDialog.enterName(folderName1).clickCreate())
|
.then(() => createDialog.enterName(folderName1).clickCreate())
|
||||||
.then(() => createDialog.waitForDialogToClose())
|
.then(() => createDialog.waitForDialogToClose())
|
||||||
.then(() => dataTable.waitForHeader())
|
.then(() => dataTable.waitForHeader())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const isPresent = dataTable.getRowByContainingText(folderName1).isPresent();
|
const isPresent = dataTable.getRowByContainingText(folderName1).isPresent();
|
||||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates new folder with name and description', () => {
|
it('creates new folder with name and description', () => {
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
createDialog
|
createDialog
|
||||||
.enterName(folderName2)
|
.enterName(folderName2)
|
||||||
@@ -130,11 +131,13 @@ describe('Create folder', () => {
|
|||||||
.then((description) => {
|
.then((description) => {
|
||||||
expect(description).toEqual(folderDescription, 'Description is not correct');
|
expect(description).toEqual(folderDescription, 'Description is not correct');
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('enabled option tooltip', () => {
|
it('enabled option tooltip', () => {
|
||||||
personalFilesPage.sidenav.openNewMenu()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => personalFilesPage.sidenav.openNewMenu()
|
||||||
.then(menu => {
|
.then(menu => {
|
||||||
const action = browser.actions().mouseMove(menu.getItemByLabel('Create folder'));
|
const action = browser.actions().mouseMove(menu.getItemByLabel('Create folder'));
|
||||||
action.perform();
|
action.perform();
|
||||||
@@ -144,7 +147,8 @@ describe('Create folder', () => {
|
|||||||
.then((menu) => {
|
.then((menu) => {
|
||||||
const tooltip = menu.getItemTooltip('Create folder');
|
const tooltip = menu.getItemTooltip('Create folder');
|
||||||
expect(tooltip).toContain('Create new folder');
|
expect(tooltip).toContain('Create new folder');
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('option is disabled when not enough permissions', () => {
|
it('option is disabled when not enough permissions', () => {
|
||||||
@@ -178,7 +182,8 @@ describe('Create folder', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('dialog UI elements', () => {
|
it('dialog UI elements', () => {
|
||||||
openCreateDialog().then(() => {
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog().then(() => {
|
||||||
const dialogTitle = createDialog.getTitle();
|
const dialogTitle = createDialog.getTitle();
|
||||||
const isFolderNameDisplayed = createDialog.nameInput.getWebElement().isDisplayed();
|
const isFolderNameDisplayed = createDialog.nameInput.getWebElement().isDisplayed();
|
||||||
const isDescriptionDisplayed = createDialog.descriptionTextArea.getWebElement().isDisplayed();
|
const isDescriptionDisplayed = createDialog.descriptionTextArea.getWebElement().isDisplayed();
|
||||||
@@ -190,11 +195,13 @@ describe('Create folder', () => {
|
|||||||
expect(isDescriptionDisplayed).toBe(true, 'Description field is not displayed');
|
expect(isDescriptionDisplayed).toBe(true, 'Description field is not displayed');
|
||||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||||
expect(isCancelEnabled).toBe(true, 'Cancel button is not enabled');
|
expect(isCancelEnabled).toBe(true, 'Cancel button is not enabled');
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with empty folder name', () => {
|
it('with empty folder name', () => {
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
createDialog.deleteNameWithBackspace();
|
createDialog.deleteNameWithBackspace();
|
||||||
})
|
})
|
||||||
@@ -204,11 +211,13 @@ describe('Create folder', () => {
|
|||||||
|
|
||||||
expect(isCreateEnabled).toBe(false, 'Create button is enabled');
|
expect(isCreateEnabled).toBe(false, 'Create button is enabled');
|
||||||
expect(validationMessage).toMatch('Folder name is required');
|
expect(validationMessage).toMatch('Folder name is required');
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with folder name ending with a dot "."', () => {
|
it('with folder name ending with a dot "."', () => {
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => createDialog.enterName('folder-name.'))
|
.then(() => createDialog.enterName('folder-name.'))
|
||||||
.then((dialog) => {
|
.then((dialog) => {
|
||||||
const isCreateEnabled = dialog.createButton.getWebElement().isEnabled();
|
const isCreateEnabled = dialog.createButton.getWebElement().isEnabled();
|
||||||
@@ -216,13 +225,15 @@ describe('Create folder', () => {
|
|||||||
|
|
||||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||||
expect(validationMessage).toMatch(`Folder name can't end with a period .`);
|
expect(validationMessage).toMatch(`Folder name can't end with a period .`);
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with folder name containing special characters', () => {
|
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' ];
|
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||||
|
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
namesWithSpecialChars.forEach(name => {
|
namesWithSpecialChars.forEach(name => {
|
||||||
createDialog.enterName(name);
|
createDialog.enterName(name);
|
||||||
@@ -233,11 +244,13 @@ describe('Create folder', () => {
|
|||||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||||
expect(validationMessage).toContain(`Folder name can't contain these characters`);
|
expect(validationMessage).toContain(`Folder name can't contain these characters`);
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with folder name containing only spaces', () => {
|
it('with folder name containing only spaces', () => {
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => createDialog.enterName(' '))
|
.then(() => createDialog.enterName(' '))
|
||||||
.then((dialog) => {
|
.then((dialog) => {
|
||||||
const isCreateEnabled = dialog.createButton.getWebElement().isEnabled();
|
const isCreateEnabled = dialog.createButton.getWebElement().isEnabled();
|
||||||
@@ -245,22 +258,26 @@ describe('Create folder', () => {
|
|||||||
|
|
||||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||||
expect(validationMessage).toMatch(`Folder name can't contain only spaces`);
|
expect(validationMessage).toMatch(`Folder name can't contain only spaces`);
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('cancel folder creation', () => {
|
it('cancel folder creation', () => {
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
createDialog
|
createDialog
|
||||||
.enterName('test')
|
.enterName('test')
|
||||||
.enterDescription('test description')
|
.enterDescription('test description')
|
||||||
.clickCancel();
|
.clickCancel();
|
||||||
})
|
})
|
||||||
.then(() => expect(createDialog.component.isPresent()).not.toBe(true, 'dialog is not closed'));
|
.then(() => expect(createDialog.component.isPresent()).not.toBe(true, 'dialog is not closed'))
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('duplicate folder name', () => {
|
it('duplicate folder name', () => {
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => createDialog.enterName(duplicateFolderName).clickCreate())
|
.then(() => createDialog.enterName(duplicateFolderName).clickCreate())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
personalFilesPage.getSnackBarMessage()
|
personalFilesPage.getSnackBarMessage()
|
||||||
@@ -268,17 +285,20 @@ describe('Create folder', () => {
|
|||||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
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');
|
expect(createDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('trim ending spaces from folder name', () => {
|
it('trim ending spaces from folder name', () => {
|
||||||
openCreateDialog()
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => openCreateDialog()
|
||||||
.then(() => createDialog.enterName(nameWithSpaces).clickCreate())
|
.then(() => createDialog.enterName(nameWithSpaces).clickCreate())
|
||||||
.then(() => createDialog.waitForDialogToClose())
|
.then(() => createDialog.waitForDialogToClose())
|
||||||
.then(() => dataTable.waitForHeader())
|
.then(() => dataTable.waitForHeader())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const isPresent = dataTable.getRowByContainingText(nameWithSpaces.trim()).isPresent();
|
const isPresent = dataTable.getRowByContainingText(nameWithSpaces.trim()).isPresent();
|
||||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
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';
|
import { Utils } from '../../utilities/utils';
|
||||||
|
|
||||||
describe('Edit folder', () => {
|
describe('Edit folder', () => {
|
||||||
const username = 'jane.doe';
|
const username = 'john.doe';
|
||||||
const password = 'jane.doe';
|
const password = 'john.doe';
|
||||||
|
|
||||||
|
const parent = 'parent-folder';
|
||||||
const folderName = 'my-folder';
|
const folderName = 'my-folder';
|
||||||
const folderDescription = 'my folder description';
|
const folderDescription = 'my folder description';
|
||||||
|
|
||||||
@@ -58,11 +59,11 @@ describe('Edit folder', () => {
|
|||||||
])
|
])
|
||||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
||||||
.then(() => Promise.all([
|
.then(() => Promise.all([
|
||||||
apis.user.nodes.createNodeWithProperties( folderName, '', folderDescription ),
|
apis.user.nodes.createNodeWithProperties( folderName, '', folderDescription, parent ),
|
||||||
apis.user.nodes.createFolders([ folderNameToEdit, duplicateFolderName ]),
|
apis.user.nodes.createFolders([ folderNameToEdit, duplicateFolderName ], parent),
|
||||||
loginPage.load()
|
loginPage.load()
|
||||||
]))
|
]))
|
||||||
.then(() => { loginPage.loginWith(username, password); })
|
.then(() => loginPage.loginWith(username, password))
|
||||||
.then(done);
|
.then(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -80,7 +81,7 @@ describe('Edit folder', () => {
|
|||||||
Promise
|
Promise
|
||||||
.all([
|
.all([
|
||||||
apis.admin.sites.deleteSite(siteName, true),
|
apis.admin.sites.deleteSite(siteName, true),
|
||||||
apis.user.nodes.deleteNodes([ folderName, folderNameEdited, duplicateFolderName ]),
|
apis.user.nodes.deleteNodes([ parent ]),
|
||||||
logoutPage.load()
|
logoutPage.load()
|
||||||
.then(() => Utils.clearLocalStorage())
|
.then(() => Utils.clearLocalStorage())
|
||||||
])
|
])
|
||||||
@@ -88,14 +89,17 @@ describe('Edit folder', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('button is enabled when having permissions', () => {
|
it('button is enabled when having permissions', () => {
|
||||||
dataTable.clickOnRowByContainingText(folderName)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(editButton.isEnabled()).toBe(true);
|
expect(editButton.isEnabled()).toBe(true);
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('dialog UI defaults', () => {
|
it('dialog UI defaults', () => {
|
||||||
dataTable.clickOnRowByContainingText(folderName)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||||
.then(() => editButton.click())
|
.then(() => editButton.click())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(editDialog.getTitle()).toBe('Edit folder');
|
expect(editDialog.getTitle()).toBe('Edit folder');
|
||||||
@@ -103,11 +107,13 @@ describe('Edit folder', () => {
|
|||||||
expect(editDialog.descriptionTextArea.getWebElement().getAttribute('value')).toBe(folderDescription);
|
expect(editDialog.descriptionTextArea.getWebElement().getAttribute('value')).toBe(folderDescription);
|
||||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(true, 'upload button is not enabled');
|
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(true, 'upload button is not enabled');
|
||||||
expect(editDialog.cancelButton.getWebElement().isEnabled()).toBe(true, 'cancel button is not enabled');
|
expect(editDialog.cancelButton.getWebElement().isEnabled()).toBe(true, 'cancel button is not enabled');
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('folder properties are modified when pressing OK', () => {
|
it('folder properties are modified when pressing OK', () => {
|
||||||
dataTable.clickOnRowByContainingText(folderNameToEdit)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderNameToEdit)
|
||||||
.then(() => editButton.click())
|
.then(() => editButton.click())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
editDialog
|
editDialog
|
||||||
@@ -126,7 +132,8 @@ describe('Edit folder', () => {
|
|||||||
.then((description) => {
|
.then((description) => {
|
||||||
expect(description).toEqual(folderDescriptionEdited);
|
expect(description).toEqual(folderDescriptionEdited);
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('button is not displayed when not enough permissions', () => {
|
it('button is not displayed when not enough permissions', () => {
|
||||||
@@ -141,7 +148,8 @@ describe('Edit folder', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('with empty folder name', () => {
|
it('with empty folder name', () => {
|
||||||
dataTable.clickOnRowByContainingText(folderName)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||||
.then(() => editButton.click())
|
.then(() => editButton.click())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
editDialog.deleteNameWithBackspace();
|
editDialog.deleteNameWithBackspace();
|
||||||
@@ -149,13 +157,15 @@ describe('Edit folder', () => {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not enabled');
|
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not enabled');
|
||||||
expect(editDialog.getValidationMessage()).toMatch('Folder name is required');
|
expect(editDialog.getValidationMessage()).toMatch('Folder name is required');
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with name with special characters', () => {
|
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' ];
|
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||||
|
|
||||||
dataTable.clickOnRowByContainingText(folderName)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||||
.then(() => editButton.click())
|
.then(() => editButton.click())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
namesWithSpecialChars.forEach(name => {
|
namesWithSpecialChars.forEach(name => {
|
||||||
@@ -164,28 +174,36 @@ describe('Edit folder', () => {
|
|||||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not disabled');
|
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.getValidationMessage()).toContain(`Folder name can't contain these characters`);
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with name ending with a dot', () => {
|
it('with name ending with a dot', () => {
|
||||||
dataTable.clickOnRowByContainingText(folderName)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||||
.then(() => editButton.click())
|
.then(() => editButton.click())
|
||||||
.then(() => editDialog.nameInput.sendKeys('.'))
|
.then(() => editDialog.nameInput.sendKeys('.'))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not enabled');
|
expect(editDialog.updateButton.getWebElement().isEnabled()).toBe(false, 'upload button is not enabled');
|
||||||
expect(editDialog.getValidationMessage()).toMatch(`Folder name can't end with a period .`);
|
expect(editDialog.getValidationMessage()).toMatch(`Folder name can't end with a period .`);
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Cancel button', () => {
|
it('Cancel button', () => {
|
||||||
dataTable.clickOnRowByContainingText(folderName)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||||
.then(() => editButton.click())
|
.then(() => editButton.click())
|
||||||
.then(() => editDialog.clickCancel())
|
.then(() => editDialog.clickCancel())
|
||||||
.then(() => { expect(editDialog.component.isPresent()).not.toBe(true, 'dialog is not closed'); });
|
.then(() => {
|
||||||
|
expect(editDialog.component.isPresent()).not.toBe(true, 'dialog is not closed');
|
||||||
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with duplicate folder name', () => {
|
it('with duplicate folder name', () => {
|
||||||
dataTable.clickOnRowByContainingText(folderName)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||||
.then(() => editButton.click())
|
.then(() => editButton.click())
|
||||||
.then(() => editDialog.enterName(duplicateFolderName).clickUpdate())
|
.then(() => editDialog.enterName(duplicateFolderName).clickUpdate())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -194,11 +212,13 @@ describe('Edit folder', () => {
|
|||||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
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');
|
expect(editDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('trim ending spaces', () => {
|
it('trim ending spaces', () => {
|
||||||
dataTable.clickOnRowByContainingText(folderName)
|
personalFilesPage.dataTable.doubleClickOnRowByContainingText(parent)
|
||||||
|
.then(() => dataTable.clickOnRowByContainingText(folderName)
|
||||||
.then(() => editButton.click())
|
.then(() => editButton.click())
|
||||||
.then(() => editDialog.nameInput.sendKeys(' '))
|
.then(() => editDialog.nameInput.sendKeys(' '))
|
||||||
.then(() => editDialog.clickUpdate())
|
.then(() => editDialog.clickUpdate())
|
||||||
@@ -206,6 +226,7 @@ describe('Edit folder', () => {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
expect(personalFilesPage.snackBar.isPresent()).not.toBe(true, 'notification appears');
|
expect(personalFilesPage.snackBar.isPresent()).not.toBe(true, 'notification appears');
|
||||||
expect(dataTable.getRowByContainingText(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
|
expect(dataTable.getRowByContainingText(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
|
||||||
});
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user