[ADF-5235] Facet fix and improve search test (#6122)

* improve search test

* fix

* fix

* fix

* changes

* modify

* logout public URL

* improve stability some e2e

* fx lint

* fix

* fix

* improve

* fix

* improve

* fix

* fix

* fix

* fix [skip ci]

* fix

* some fix [skip ci]

* fix

* fix lint

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* convert C291893 in manual test case in testrail

* fix

* fix
This commit is contained in:
Eugenio Romano
2020-09-21 09:35:01 +01:00
committed by GitHub
parent 9c427b3142
commit 46ccda68b3
111 changed files with 987 additions and 604 deletions

View File

@@ -51,23 +51,20 @@ describe('Modify applications', () => {
appVersionToBeDeleted = await applicationService.importPublishDeployApp(appToBeDeleted.file_path);
await loginPage.login(user.email, user.password);
});
});
beforeEach(async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
});
it('[C260198] Should the app be displayed on dashboard when is deployed on APS', async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
});
it('[C260213] Should a new version of the app be displayed on dashboard when is replaced by importing another app in APS', async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
@@ -85,10 +82,6 @@ describe('Modify applications', () => {
});
it('[C260220] Should the app not be displayed on dashboard after it was deleted in APS', async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsDisplayed(app.title);
await modelActions.deleteEntireModel(firstApp.id);
@@ -100,10 +93,6 @@ describe('Modify applications', () => {
});
it('[C260215] Should the penultimate version of an app be displayed on dashboard when the last version is deleted in APS', async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
@@ -131,9 +120,6 @@ describe('Modify applications', () => {
it('[C260207] Should the app be updated when is edited in APS', async () => {
const newDescription = 'new description';
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await expect(await processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
await expect(await processServicesPage.getDescription(appToBeDeleted.title)).toEqual(appToBeDeleted.description);

View File

@@ -96,6 +96,8 @@ describe('Attach File - Content service', () => {
await apiService.getInstance().login(user.email, user.password);
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
await applicationService.importPublishDeployApp(app.file_path);
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
});
afterAll(async () => {
@@ -124,14 +126,14 @@ describe('Attach File - Content service', () => {
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
await contentNodeSelector.contentList.dataTablePage().waitTillContentLoaded();
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
await contentNodeSelector.clickMoveCopyButton();
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
});
it('[C246522] Attach file - Local file', async () => {
it('[C246522] Attach file - Local file', async () => {
const name = 'Attach local file';
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
@@ -154,9 +156,11 @@ describe('Attach File - Content service', () => {
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
await widget.attachFileWidget().selectUploadSource(csIntegrations[1]);
await externalNodeSelector.waitForLogInDialog();
await expect(await externalNodeSelector.getTitle()).toEqual(`Sign into '${browser.params.testConfig.adf_external_acs.host}'`);
await externalNodeSelector.login(user.email, user.password);
await externalNodeSelector.checkDialogIsDisplayed();
await externalNodeSelector.searchAndSelectResult(externalFile, externalFile);
await externalNodeSelector.clickMoveCopyButton();
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
@@ -171,6 +175,7 @@ describe('Attach File - Content service', () => {
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
await contentNodeSelector.clickMoveCopyButton();
@@ -184,6 +189,9 @@ describe('Attach File - Content service', () => {
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
await widget.attachFileWidget().selectUploadSource(csIntegrations[1]);
await externalNodeSelector.waitForLogInDialog();
await externalNodeSelector.login(user.email, user.password);
await externalNodeSelector.searchAndSelectResult(externalFile, externalFile);
await externalNodeSelector.clickMoveCopyButton();
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);

View File

@@ -359,6 +359,6 @@ describe('Info Drawer', () => {
await expect(await taskPage.taskDetails().getCategory()).toEqual(category);
await expect(await taskPage.taskDetails().getParentName()).toEqual(parentName);
await expect(await taskPage.taskDetails().getCreated()).toEqual(moment(Date.now()).format(dateFormat));
await expect(await taskPage.taskDetails().getFormName()).toEqual(formName);
await taskPage.taskDetails().waitFormNameEqual(formName);
}
});

View File

@@ -33,6 +33,7 @@ export class AttachmentListPage {
}
async clickAttachFileButton(fileLocation: string): Promise<void> {
await browser.sleep(500);
await BrowserVisibility.waitUntilElementIsPresent(this.attachFileButton);
await this.attachFileButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
}

View File

@@ -31,6 +31,7 @@ export class FiltersPage {
await BrowserActions.closeMenuAndDialogs();
const filter = element(by.css(`button[data-automation-id="${filterName}_filter"]`));
await BrowserActions.click(filter);
await this.dataTable.waitTillContentLoaded();
}
async sortByName(sortOrder: string): Promise<void> {

View File

@@ -93,7 +93,7 @@ export class ProcessFiltersPage {
}
async waitForTableBody(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.tableBody);
await this.dataTable.waitForTableBody();
}
/**

View File

@@ -143,6 +143,10 @@ export class TaskDetailsPage {
return BrowserActions.getInputValue(this.formNameField);
}
async waitFormNameEqual(formName: string): Promise<void> {
await BrowserVisibility.waitUntilElementHasValue(this.formNameField, formName);
}
async clickForm(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.formNameButton);

View File

@@ -75,8 +75,8 @@ describe('Process List - Pagination when adding processes', () => {
let page = 1;
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await processFiltersPage.dataTable.waitTillContentLoaded();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);

View File

@@ -74,6 +74,8 @@ describe('Items per page set to 15 and adding of tasks', () => {
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
@@ -87,6 +89,8 @@ describe('Items per page set to 15 and adding of tasks', () => {
currentPage++;
await paginationPage.clickOnNextPage();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);

View File

@@ -94,10 +94,11 @@ describe('Attachment list action menu for processes', () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickProcessButton();
await processFiltersPage.selectFromProcessList(processName.active);
await processDetailsPage.checkProcessTitleIsDisplayed();
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
await attachmentListPage.viewFile(pngFile.name);
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
@@ -105,6 +106,7 @@ describe('Attachment list action menu for processes', () => {
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.active);
await processDetailsPage.checkProcessTitleIsDisplayed();
await attachmentListPage.doubleClickFile(pngFile.name);
@@ -113,6 +115,7 @@ describe('Attachment list action menu for processes', () => {
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.active);
await processDetailsPage.checkProcessTitleIsDisplayed();
await attachmentListPage.downloadFile(pngFile.name);
@@ -127,12 +130,11 @@ describe('Attachment list action menu for processes', () => {
it('[C279886] Should be able to access options of a file attached to a completed process', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.completed);
await processDetailsPage.checkProcessTitleIsDisplayed();
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
@@ -140,6 +142,7 @@ describe('Attachment list action menu for processes', () => {
await processDetailsPage.checkProcessTitleIsDisplayed();
await attachmentListPage.checkAttachFileButtonIsNotDisplayed();
await attachmentListPage.checkFileIsAttached(pngFile.name);
await attachmentListPage.viewFile(pngFile.name);
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
@@ -162,7 +165,6 @@ describe('Attachment list action menu for processes', () => {
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.taskApp);
await processDetailsPage.checkProcessTitleIsDisplayed();
await attachmentListPage.clickAttachFileButton(pngFile.location);
@@ -174,6 +176,7 @@ describe('Attachment list action menu for processes', () => {
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.emptyList);
await processDetailsPage.checkProcessTitleIsDisplayed();
await attachmentListPage.checkEmptyAttachmentList();
await attachmentListPage.clickAttachFileButton(pngFile.location);

View File

@@ -73,7 +73,7 @@ describe('Start Task - Task App', () => {
await taskDetails.checkCompleteTaskButtonIsEnabled();
await taskPage.taskDetails().checkAttachFormButtonIsDisplayed();
await taskPage.taskDetails().checkAttachFormButtonIsEnabled();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage);
});
@@ -90,7 +90,7 @@ describe('Start Task - Task App', () => {
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + tasks[1] + ' completed');
await taskPage.formFields().noFormIsDisplayed();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
});
it('[C268911] Should allow adding a form to a standalone task when clicking on Add form button', async () => {
@@ -108,7 +108,7 @@ describe('Start Task - Task App', () => {
await taskPage.formFields().checkFormIsDisplayed();
await taskPage.taskDetails().checkCompleteFormButtonIsDisplayed();
await expect(await taskPage.taskDetails().getFormName()).toEqual(app.formName);
await taskPage.taskDetails().waitFormNameEqual(app.formName);
});
it('[C268912] Should a standalone task be displayed when removing the form from APS', async () => {
@@ -119,7 +119,7 @@ describe('Start Task - Task App', () => {
await task.clickStartButton();
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
await expect(await taskPage.taskDetails().getFormName()).toEqual(app.formName);
await taskPage.taskDetails().waitFormNameEqual(app.formName);
const listOfTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
await apiService.getInstance().activiti.taskApi.removeForm(listOfTasks.data[0].id);
@@ -129,7 +129,7 @@ describe('Start Task - Task App', () => {
await taskPage.checkTaskTitle(tasks[3]);
await taskPage.formFields().noFormIsDisplayed();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage);
});
});

View File

@@ -508,7 +508,6 @@ describe('Start Process Component', () => {
await loginPage.login(processUserModel.email, processUserModel.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await contentServicesPage.uploadFile(imageUploaded.location);
await contentServicesPage.checkContentIsDisplayed(imageUploaded.name);
await uploadDialog.clickOnCloseButton();

View File

@@ -118,7 +118,7 @@ describe('Start Task - Custom App', () => {
await taskPage.formFields().noFormIsDisplayed();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
});
it('[C263948] Should be possible to cancel a task', async () => {

View File

@@ -140,7 +140,7 @@ describe('Task Details - Form', () => {
await taskDetailsPage.checkFormIsAttached('No form');
await expect(await taskDetailsPage.getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await taskDetailsPage.waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
});
it('[C280557] Should display task details when selecting another task while the Attach Form dialog is displayed', async () => {

View File

@@ -62,7 +62,7 @@ describe('Task Details - No form', () => {
await taskPage.taskDetails().checkCompleteTaskButtonIsDisplayed();
await taskPage.taskDetails().checkCompleteTaskButtonIsEnabled();
await taskPage.taskDetails().checkAttachFormButtonIsNotDisplayed();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
});
});

View File

@@ -104,7 +104,7 @@ describe('Task Details component', () => {
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
formModel = new FormModel(taskForm);
await expect(await taskPage.taskDetails().getFormName()).toEqual(formModel.getName());
await taskPage.taskDetails().waitFormNameEqual(formModel.getName());
});
it('[C263946] Should display task details for standalone task - Custom App', async () => {
@@ -136,7 +136,7 @@ describe('Task Details component', () => {
formModel = new FormModel(taskForm);
await expect(await taskPage.taskDetails().getFormName()).toEqual(formModel.getName());
await taskPage.taskDetails().waitFormNameEqual(formModel.getName());
});
it('[C286706] Should display task details for task - Task App', async () => {
@@ -169,8 +169,7 @@ describe('Task Details component', () => {
formModel = new FormModel(taskForm);
await expect(await taskPage.taskDetails().getFormName())
.toEqual(formModel.getName() === null ? CONSTANTS.TASK_DETAILS.NO_FORM : formModel.getName());
await taskPage.taskDetails().waitFormNameEqual(formModel.getName());
});
it('[C286705] Should display task details for task - Custom App', async () => {
@@ -201,8 +200,7 @@ describe('Task Details component', () => {
formModel = new FormModel(taskForm);
await expect(await taskPage.taskDetails().getFormName())
.toEqual(formModel.getName() === null ? CONSTANTS.TASK_DETAILS.NO_FORM : formModel.getName());
await taskPage.taskDetails().waitFormNameEqual(formModel.getName());
});
it('[C286708] Should display task details for subtask - Task App', async () => {