[ADF-3959] Fixing trashcan-pagination tests (#4222)

This commit is contained in:
Marouan Bentaleb 2019-02-01 13:20:17 +00:00 committed by Eugenio Romano
parent 2036e026f3
commit c00e230983
6 changed files with 56 additions and 38 deletions

View File

@ -84,15 +84,19 @@ describe('Trashcan - Pagination', () => {
});
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
done();
});
it('[C272811] Should be able to set Items per page to 20', () => {
navigationBarPage.clickTrashcanButton();
afterEach((done) => {
browser.refresh();
trashcanPage.waitForTableBody();
done();
});
it('[C272811] Should be able to set Items per page to 20', () => {
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
trashcanPage.waitForTableBody();
@ -107,8 +111,6 @@ describe('Trashcan - Pagination', () => {
});
it('[C276742] Should be able to set Items per page to 15', () => {
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
@ -120,8 +122,6 @@ describe('Trashcan - Pagination', () => {
});
it('[C276743] Should be able to set Items per page to 10', () => {
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.ten);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
@ -133,8 +133,6 @@ describe('Trashcan - Pagination', () => {
});
it('[C276744] Should be able to set Items per page to 5', () => {
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.five);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();

View File

@ -83,6 +83,11 @@ describe('Upload component - Excluded Files', () => {
done();
});
afterEach(async (done) => {
await browser.refresh();
done();
});
it('[C279914] Should not allow upload default excluded files using D&D', () => {
contentServicesPage.checkDragAndDropDIsDisplayed();
@ -108,30 +113,31 @@ describe('Upload component - Excluded Files', () => {
it('[C260125] Should not upload excluded file when they are in a Folder', () => {
uploadToggles.enableFolderUpload();
contentServicesPage.uploadFolder(folderWithExcludedFile.location).checkContentIsDisplayed(folderWithExcludedFile.name);
contentServicesPage.uploadFolder(folderWithExcludedFile.location);
contentServicesPage.doubleClickRow(folderWithExcludedFile.name).checkContentIsNotDisplayed(iniExcludedFile.name).checkContentIsDisplayed('a_file.txt');
uploadDialog.checkUploadCompleted().then(() => {
contentServicesPage.doubleClickRow(folderWithExcludedFile.name)
.checkContentIsNotDisplayed(iniExcludedFile.name)
.checkContentIsDisplayed('a_file.txt');
});
});
it('[C212862] Should not allow upload file excluded in the files extension of app.config.json', () => {
browser.refresh();
navigationBarPage.clickConfigEditorButton();
configEditorPage.clickFileConfiguration();
configEditorPage.clickClearButton();
configEditorPage.enterConfiguration('{' +
' "excluded": [' +
' ".DS_Store",' +
' "desktop.ini",' +
' "*.txt"' +
' ],' +
' "match-options": {' +
' "nocase": true' +
' }' +
'}');
'"excluded": [' +
'".DS_Store",' +
'"desktop.ini",' +
'"*.txt"' +
'],' +
'"match-options": {' +
'"nocase": true' +
'}}');
configEditorPage.clickSaveButton();
@ -153,15 +159,14 @@ describe('Upload component - Excluded Files', () => {
configEditorPage.clickClearButton();
configEditorPage.enterConfiguration('{' +
' "excluded": [' +
' ".DS_Store",' +
' "desktop.ini",' +
' "*.png"' +
' ],' +
' "match-options": {' +
' "nocase": true' +
' }' +
'}');
'"excluded": [' +
'".DS_Store",' +
'"desktop.ini",' +
'"*.png"' +
'],' +
'"match-options": {' +
'"nocase": true' +
'}}');
configEditorPage.clickSaveButton();

View File

@ -142,8 +142,9 @@ describe('Upload component', () => {
it('[C260173] Should be able to upload folder when enabled', () => {
uploadToggles.enableFolderUpload();
contentServicesPage.uploadFolder(folderOne.location);
contentServicesPage.checkContentIsDisplayed(folderOne.name);
uploadDialog.checkUploadCompleted().then(() => {
contentServicesPage.checkContentIsDisplayed(folderOne.name);
});
expect(contentServicesPage.getFolderButtonTooltip()).toEqual('Custom tooltip');
uploadDialog.fileIsUploaded(uploadedFileInFolder.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
@ -422,7 +423,10 @@ describe('Upload component', () => {
it('[C279882] Should be possible Upload a folder in a folder', () => {
uploadToggles.enableFolderUpload();
browser.driver.sleep(1000);
contentServicesPage.uploadFolder(folderOne.location).checkContentIsDisplayed(folderOne.name);
contentServicesPage.uploadFolder(folderOne.location);
uploadDialog.checkUploadCompleted().then(() => {
contentServicesPage.checkContentIsDisplayed(folderOne.name);
});
uploadDialog.fileIsUploaded(uploadedFileInFolder.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
@ -430,7 +434,10 @@ describe('Upload component', () => {
uploadToggles.enableFolderUpload();
browser.driver.sleep(1000);
contentServicesPage.uploadFolder(folderTwo.location).checkContentIsDisplayed(folderTwo.name);
contentServicesPage.uploadFolder(folderTwo.location);
uploadDialog.checkUploadCompleted().then(() => {
contentServicesPage.checkContentIsDisplayed(folderTwo.name);
});
uploadDialog.fileIsUploaded(uploadedFileInFolderTwo.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();

View File

@ -175,7 +175,8 @@ describe('Upload - User permission', () => {
it('[C279916] Should not be allowed to upload a folder in folder with consumer permissions', () => {
uploadToggles.enableFolderUpload();
contentServicesPage.uploadFolder(folder.location).checkContentIsDisplayed(folder.name);
contentServicesPage.uploadFolder(folder.location)
.checkContentIsDisplayed(folder.name);
let fileInTheUploadedFolder = 'share_profile_pic.png';
@ -227,6 +228,9 @@ describe('Upload - User permission', () => {
uploadToggles.enableFolderUpload();
contentServicesPage.uploadFolder(folder.location);
uploadDialog.checkUploadCompleted().then(() => {
contentServicesPage.checkContentIsDisplayed(folder.name);
});
let fileInTheUploadedFolder = 'share_profile_pic.png';

View File

@ -159,6 +159,10 @@ export class UploadDialog {
return this;
}
async checkUploadCompleted() {
return (await this.numberOfCurrentFilesUploaded()) === (await this.numberOfInitialFilesUploaded());
}
numberOfCurrentFilesUploaded() {
let deferred = protractor.promise.defer();
this.getTitleText().then((text) => {

View File

@ -34,8 +34,8 @@ export class FormControllersPage {
Util.waitUntilElementIsVisible(toggle);
toggle.getAttribute('class').then((check) => {
if (check.indexOf('mat-checked') >= 0) {
Util.waitUntilElementIsClickable(toggle.element(by.css('div')));
toggle.element(by.css('div')).click();
Util.waitUntilElementIsClickable(toggle.all(by.css('div')).first());
toggle.all(by.css('div')).first().click();
}
});
}