mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fix e2e (#6087)
* fix protractor conf * remove update env * fix cli error script cs * change screenshot plugin * remove unused param * fix * fix * fix * moment comment nvm * fix * fix * fix * fix * remove adf redirect * fix * fix * save remote report * report fix * improve save result * fix folder save * fix folder save * fix placeholder pointer , they needs refactor later * fix * fix lint * fix * remove test already covered by unit fix the test in core needed exclude the one impossible to make it works without APS basic support * lint * fix some logout missing * fix * Fix the custom-tasks-filters.e2e * fix lint * fix * fix * fix * Fix wait on start process and on process definition options * Fix logout before login again * fix uplaod test * fix * Fix infodrawer with check detail and sleep * lint * increase list of excluded test * fix * fix lint * change wait method datatable * fix * fix * revert check value * fix * fix * change tag test Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com>
This commit is contained in:
@@ -142,6 +142,8 @@ describe('Restore content directive', () => {
|
||||
await trashcanPage.clickRestore();
|
||||
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(testFile.entry.name);
|
||||
|
||||
await notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored');
|
||||
|
||||
await navigationBarPage.clickContentServicesButton();
|
||||
await contentServicesPage.waitForTableBody();
|
||||
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
|
||||
@@ -150,7 +152,6 @@ describe('Restore content directive', () => {
|
||||
await navigationBarPage.clickTrashcanButton();
|
||||
await trashcanPage.waitForTableBody();
|
||||
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFile.entry.name);
|
||||
await notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored');
|
||||
});
|
||||
|
||||
it('[C260239] Should restore folder with content', async () => {
|
||||
|
@@ -223,10 +223,17 @@ describe('Document List Component - Actions', () => {
|
||||
it('[C260060] Should be able to open a file/folder through double click action - folder', async () => {
|
||||
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
|
||||
const numberOfSubFolders = 3;
|
||||
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
|
||||
|
||||
await contentServicesPage.createNewFolder(folderTwoModel.name);
|
||||
const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id');
|
||||
await contentServicesPage.openFolder(folderTwoModel.name);
|
||||
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await contentServicesPage.createNewFolder('subFolder' + (i + 1));
|
||||
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo);
|
||||
}
|
||||
|
||||
await browser.refresh();
|
||||
|
||||
await contentServicesPage.checkContentsAreDisplayed(numberOfSubFolders);
|
||||
});
|
||||
|
||||
|
@@ -111,7 +111,7 @@ describe('Document List - Pagination', () => {
|
||||
it('[C260062] Should use default pagination settings', async () => {
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
const list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames)).toEqual(true);
|
||||
@@ -125,7 +125,7 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
const list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames)).toEqual(true);
|
||||
@@ -155,7 +155,7 @@ describe('Document List - Pagination', () => {
|
||||
currentPage++;
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 6-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${itemsPerPage.fiveValue * currentPage} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
|
||||
@@ -228,7 +228,7 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 16-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 16-${nrOfFiles} of ${nrOfFiles}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
|
||||
@@ -309,7 +309,7 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 21-${secondSetNumber} of ${secondSetNumber}`);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 21-${secondSetNumber} of ${secondSetNumber}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
|
||||
@@ -319,7 +319,7 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']);
|
||||
|
||||
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 21]));
|
||||
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 21]));
|
||||
await contentServicesPage.goToDocumentList();
|
||||
await browser.refresh();
|
||||
|
||||
@@ -328,19 +328,19 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual([ '5', '10', '15', '21' ]);
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '21']);
|
||||
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.twentyOne);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twentyOne);
|
||||
await browser.refresh();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual( `Showing 1-${itemsPerPage.twentyOneValue} of ${numberOfFilesAfterUpload}`);
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.twentyOneValue} of ${numberOfFilesAfterUpload}`);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyOneValue);
|
||||
|
||||
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20]));
|
||||
await LocalStorageUtil.setUserPreference('supportedPageSizes', JSON.stringify([5, 10, 15, 20]));
|
||||
await browser.refresh();
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await paginationPage.clickItemsPerPageDropdown();
|
||||
await expect(await paginationPage.getItemsPerPageDropdownOptions()).toEqual(['5', '10', '15', '20']);
|
||||
});
|
||||
|
||||
@@ -349,20 +349,28 @@ describe('Document List - Pagination', () => {
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
|
||||
|
||||
await apiService.getInstance().login(acsUser.email, acsUser.password);
|
||||
await contentServicesPage.createNewFolder(folderTwoModel.name);
|
||||
const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id');
|
||||
await contentServicesPage.openFolder(folderTwoModel.name);
|
||||
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
|
||||
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo);
|
||||
}
|
||||
await browser.refresh();
|
||||
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
|
||||
|
||||
await paginationPage.clickOnNextPage();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 6-${numberOfSubFolders} of ${numberOfSubFolders}`);
|
||||
await contentServicesPage.openFolder('subfolder6');
|
||||
const nodeIdSubFolder6 = await contentServicesPage.getAttributeValueForElement('subfolder6', 'Node id');
|
||||
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
|
||||
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolder6);
|
||||
}
|
||||
await browser.refresh();
|
||||
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
|
||||
await expect(await paginationPage.getTotalPages()).toEqual('of 2');
|
||||
@@ -374,10 +382,17 @@ describe('Document List - Pagination', () => {
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
await contentServicesPage.openFolder(newFolderModel.name);
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name);
|
||||
|
||||
await apiService.getInstance().login(acsUser.email, acsUser.password);
|
||||
await contentServicesPage.createNewFolder(folderTwoModel.name);
|
||||
const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id');
|
||||
await contentServicesPage.openFolder(folderTwoModel.name);
|
||||
|
||||
for (let i = 0; i < numberOfSubFolders; i++) {
|
||||
await contentServicesPage.createNewFolder('subfolder' + (i + 1));
|
||||
await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo);
|
||||
}
|
||||
|
||||
await browser.refresh();
|
||||
await expect(await paginationPage.getPaginationRange()).toEqual(`Showing 1-${itemsPerPage.fiveValue} of ${numberOfSubFolders}`);
|
||||
|
||||
await contentServicesPage.chooseSelectionMode('Single');
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
import { Locator, element, by, protractor, browser } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class TagPage {
|
||||
@@ -26,9 +26,9 @@ export class TagPage {
|
||||
tagListRow = element(by.css('adf-tag-node-actions-list mat-list-item'));
|
||||
tagListByNodeIdRow = element(by.css('adf-tag-node-list mat-chip'));
|
||||
errorMessage = element(by.css('mat-hint[data-automation-id="errorMessage"]'));
|
||||
tagListRowLocator = by.css('adf-tag-node-actions-list mat-list-item div');
|
||||
tagListByNodeIdRowLocator = by.css('adf-tag-node-list mat-chip span');
|
||||
tagListContentServicesRowLocator = by.css('div[class*="adf-list-tag"]');
|
||||
tagListRowLocator: Locator = by.css('adf-tag-node-actions-list mat-list-item div');
|
||||
tagListByNodeIdRowLocator: Locator = by.css('adf-tag-node-list mat-chip span');
|
||||
tagListContentServicesRowLocator: Locator = by.css('div[class*="adf-list-tag"]');
|
||||
showDeleteButton = element(by.id('adf-remove-button-tag'));
|
||||
showMoreButton = element(by.css('button[data-automation-id="show-more-tags"]'));
|
||||
showLessButton = element(by.css('button[data-automation-id="show-fewer-tags"]'));
|
||||
@@ -76,7 +76,7 @@ export class TagPage {
|
||||
|
||||
async getNewTagPlaceholder(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.newTagInput);
|
||||
return this.newTagInput.getAttribute('placeholder');
|
||||
return this.newTagInput.getAttribute('data-placeholder');
|
||||
}
|
||||
|
||||
async addTagButtonIsEnabled(): Promise<boolean> {
|
||||
|
@@ -21,7 +21,7 @@ import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
export class TreeViewPage {
|
||||
|
||||
treeViewTitle = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST'));
|
||||
nodeIdInput = element(by.css('input[placeholder="Node Id"]'));
|
||||
nodeIdInput = element(by.css('input[data-placeholder="Node Id"]'));
|
||||
noNodeMessage = element(by.id('adf-tree-view-missing-node'));
|
||||
nodesOnPage = element.all(by.css('mat-tree-node'));
|
||||
|
||||
|
@@ -73,8 +73,10 @@ describe('Tag component', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
|
||||
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
|
||||
await uploadActions.deleteFileOrFolder(pdfUploadedFile.entry.id);
|
||||
|
||||
await loginPage.login(acsUser.email, acsUser.password);
|
||||
});
|
||||
|
||||
it('[C260374] Should NOT be possible to add a new tag without Node ID', async () => {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
BrowserActions,
|
||||
BrowserActions, BrowserVisibility,
|
||||
LoginPage,
|
||||
UploadActions,
|
||||
UserModel,
|
||||
@@ -98,15 +98,15 @@ describe('Upload component', () => {
|
||||
await apiService.getInstance().login(acsUser.email, acsUser.password);
|
||||
await loginPage.login(acsUser.email, acsUser.password);
|
||||
await contentServicesPage.goToDocumentList();
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await contentServicesPage.goToDocumentList();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
const nbResults = await contentServicesPage.numberOfResultsDisplayed();
|
||||
if (nbResults > 1) {
|
||||
const nbResults = await contentServicesPage.emptyFolder.isPresent();
|
||||
if (!nbResults) {
|
||||
const nodeIds = await contentServicesPage.getElementsDisplayedId();
|
||||
for (const nodeId of nodeIds) {
|
||||
await uploadActions.deleteFileOrFolder(nodeId);
|
||||
@@ -173,7 +173,7 @@ describe('Upload component', () => {
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
await contentServicesPage.uploadFile(pdfFileModel.location);
|
||||
await contentServicesPage .checkContentIsDisplayed(pdfFileModel.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
|
||||
await uploadDialog.fileIsUploaded(pdfFileModel.name);
|
||||
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModel.name);
|
||||
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModelTwo.name);
|
||||
@@ -202,6 +202,7 @@ describe('Upload component', () => {
|
||||
await BrowserActions.click(versionManagePage.showNewVersionButton);
|
||||
await versionManagePage.uploadNewVersionFile(pngFileModel.location);
|
||||
await versionManagePage.closeVersionDialog();
|
||||
|
||||
await uploadDialog.removeUploadedFile(pngFileModel.name);
|
||||
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
@@ -231,18 +232,23 @@ describe('Upload component', () => {
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
|
||||
await uploadToggles.enableFolderUpload();
|
||||
|
||||
await browser.executeScript(` setInterval(() => {
|
||||
if(document.querySelector('[data-automation-id="adf"]')){
|
||||
document.querySelector("#adf-upload-dialog-cancel-all").click();
|
||||
document.querySelector("#adf-upload-dialog-cancel").click();
|
||||
}
|
||||
}, 500)`);
|
||||
}, 2000)`);
|
||||
await contentServicesPage.uploadFolder(adfBigFolder.location);
|
||||
|
||||
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
await uploadDialog.fileIsUploaded('a_png_noBackground_file.PNG');
|
||||
await uploadDialog.fileIsCancelled('a_png_noBackground_file.PNG');
|
||||
|
||||
await BrowserVisibility.waitUntilElementHasText(uploadDialog.title, 'Upload canceled');
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
await contentServicesPage.openFolder(adfBigFolder.name);
|
||||
await browser.sleep(2000); // We need to wai when we upload too many files we have to wait the revert
|
||||
await expect(contentServicesPage.numberOfResultsDisplayed()).toBe(0);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user