Skip to content

Commit

Permalink
[ADF-4547] Fixing flaky tests in Content Services and Core (Alfresco#…
Browse files Browse the repository at this point in the history
  • Loading branch information
marouanbentaleb authored and DenysVuika committed May 22, 2019
1 parent 58cf10b commit 5e7aabf
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 59 deletions.
2 changes: 1 addition & 1 deletion demo-shell/src/app.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"contextRootBpm": "activiti-app",
"authType": "BASIC",
"locale": "en",
"notificationDefaultDuration": 10000,
"notificationDefaultDuration": 2000,
"auth": {
"withCredentials": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,14 @@ describe('Document List Component - Actions', () => {
folder5 = await uploadActions.createFolder(alfrescoJsApi, 'E' + folderModel5.name, '-my-');
folder6 = await uploadActions.createFolder(alfrescoJsApi, 'F' + folderModel6.name, '-my-');
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
done();
});

beforeEach(async (done) => {
await loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
contentServicesPage.goToDocumentList();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage('5');
contentServicesPage.checkAcsContainer();
contentListPage.waitForTableBody();

done();
});

Expand All @@ -93,7 +91,7 @@ describe('Document List Component - Actions', () => {
done();
});

xit('[C260132] Move action on folder with - Load more', () => {
it('[C260132] Move action on folder with - Load more', () => {

expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
Expand Down
18 changes: 8 additions & 10 deletions e2e/content-services/permissions/site-permissions.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ describe('Permissions Component', function () {
await alfrescoJsApi.core.peopleApi.addPerson(managerUser);
await alfrescoJsApi.login(folderOwnerUser.id, folderOwnerUser.password);

browser.sleep(15000);

const publicSiteName = `PUBLIC_TEST_SITE_${StringUtil.generateRandomString(5)}`;

const privateSiteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`;
Expand Down Expand Up @@ -168,11 +170,9 @@ describe('Permissions Component', function () {
done();
});

xit('[C277002] Should display the Role Site dropdown', async () => {
it('[C277002] Should display the Role Site dropdown', async () => {
contentServicesPage.checkContentIsDisplayed(folderName);

contentServicesPage.checkSelectedSiteIsDisplayed('My files');

contentList.rightClickOnRow(folderName);

contentServicesPage.pressContextMenuActionNamed('Permission');
Expand All @@ -183,8 +183,6 @@ describe('Permissions Component', function () {
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();

browser.sleep(10000);

permissionsPage.searchUserOrGroup(consumerUser.getId());
permissionsPage.clickUserOrGroup(consumerUser.getFirstName());
permissionsPage.checkUserOrGroupIsAdded(consumerUser.getId());
Expand All @@ -194,17 +192,17 @@ describe('Permissions Component', function () {
permissionsPage.clickRoleDropdownByUserOrGroupName(consumerUser.getId());

expect(permissionsPage.getRoleDropdownOptions().count()).toBe(4);
expect(permissionsPage.getRoleDropdownOptions().get(0).getText()).toBe('SiteCollaborator');
expect(permissionsPage.getRoleDropdownOptions().get(1).getText()).toBe('SiteConsumer');
expect(permissionsPage.getRoleDropdownOptions().get(2).getText()).toBe('SiteContributor');
expect(permissionsPage.getRoleDropdownOptions().get(3).getText()).toBe('SiteManager');
expect(permissionsPage.getRoleDropdownOptions().get(0).getText()).toBe(CONSTANTS.CS_USER_ROLES.COLLABORATOR);
expect(permissionsPage.getRoleDropdownOptions().get(1).getText()).toBe(CONSTANTS.CS_USER_ROLES.CONSUMER);
expect(permissionsPage.getRoleDropdownOptions().get(2).getText()).toBe(CONSTANTS.CS_USER_ROLES.CONTRIBUTOR);
expect(permissionsPage.getRoleDropdownOptions().get(3).getText()).toBe(CONSTANTS.CS_USER_ROLES.MANAGER);
});

});

describe('Roles: SiteConsumer, SiteCollaborator, SiteContributor, SiteManager', function () {

xit('[C276994] Role SiteConsumer', async () => {
it('[C276994] Role SiteConsumer', async () => {

await loginPage.loginToContentServicesUsingUserModel(siteConsumerUser);

Expand Down
2 changes: 1 addition & 1 deletion e2e/content-services/tag-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe('Tag component', () => {
tagPage.checkDeleteTagFromTagListByNodeIdIsNotDisplayed(tagList[3]);
});

xit('[C286472] Should be able to click Show more/less button on List Tags Content Services', () => {
it('[C286472] Should be able to click Show more/less button on List Tags Content Services', () => {
tagPage.insertNodeId(pdfFileModel.id);

tagPage.checkShowMoreButtonIsDisplayed();
Expand Down
17 changes: 4 additions & 13 deletions e2e/core/datatable/data-table-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,15 @@ describe('Datatable component', () => {
notificationPage.checkNotificationSnackBarIsNotDisplayed();
});

xit('[C307040] A column value with copyContent set to true is copied when clicking on it', () => {
it('[C307040] A column value with copyContent set to true is copied when clicking on it', () => {
dataTablePage.mouseOverIdColumn('1');
expect(dataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
dataTablePage.clickOnIdColumn('1');
notificationPage.checkNotifyContains('Text copied to clipboard');
dataTablePage.pasteClipboard();
expect(dataTablePage.getClipboardInputText()).toEqual('1');
dataTablePage.clickOnIdColumn('2');
notificationPage.checkNotifyContains('Text copied to clipboard');
dataTablePage.clickOnIdColumn('3');
notificationPage.checkNotifyContains('Text copied to clipboard');
dataTablePage.pasteClipboard();
expect(dataTablePage.getClipboardInputText()).toEqual('3');
expect(dataTablePage.getClipboardInputText()).toEqual('2');
});

it('[C307072] A tooltip is displayed when mouseOver a column with copyContent set to true', () => {
Expand All @@ -164,20 +160,15 @@ describe('Datatable component', () => {
notificationPage.checkNotificationSnackBarIsNotDisplayed();
});

xit('[C307073] A column value with copyContent set to true is copied when clicking on it', () => {
it('[C307073] A column value with copyContent set to true is copied when clicking on it', () => {
copyContentDataTablePage.mouseOverIdColumn('1');
expect(copyContentDataTablePage.getCopyContentTooltip()).toEqual('Click to copy');
copyContentDataTablePage.clickOnIdColumn('1');
notificationPage.checkNotifyContains('Text copied to clipboard');
copyContentDataTablePage.pasteClipboard();
expect(copyContentDataTablePage.getClipboardInputText()).toEqual('1');
copyContentDataTablePage.clickOnIdColumn('2');
notificationPage.checkNotifyContains('Text copied to clipboard');
copyContentDataTablePage.mouseOverIdColumn('3');
copyContentDataTablePage.clickOnIdColumn('3');
notificationPage.checkNotifyContains('Text copied to clipboard');
copyContentDataTablePage.pasteClipboard();
expect(copyContentDataTablePage.getClipboardInputText()).toEqual('3');
expect(copyContentDataTablePage.getClipboardInputText()).toEqual('2');
});

it('[C307100] A column value of type text and with copyContent set to true is copied when clicking on it', () => {
Expand Down
4 changes: 1 addition & 3 deletions e2e/process-services-cloud/task-header-cloud.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { LoginSSOPage, SettingsPage, AppListCloudPage, TaskHeaderCloudPage, Task
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
import { TaskDetailsCloudDemoPage } from '../pages/adf/demo-shell/process-services/taskDetailsCloudDemoPage';
import resources = require('../util/resources');
import { browser } from 'protractor';

describe('Task Header cloud component', () => {

Expand Down Expand Up @@ -142,11 +141,10 @@ describe('Task Header cloud component', () => {
.toEqual(subTask.entry.parentTaskId === null ? '' : subTask.entry.parentTaskId);
});

xit('[C307032] Should display the appropriate title for the unclaim option of a Task', async () => {
it('[C307032] Should display the appropriate title for the unclaim option of a Task', async () => {
tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(basicCreatedTaskName);
tasksCloudDemoPage.taskListCloudComponent().selectRow(basicCreatedTaskName);
browser.driver.sleep(30000);
expect(taskDetailsCloudDemoPage.getReleaseButtonText()).toBe('RELEASE');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class DataTableComponentPage {
}

getCellByRowNumberAndColumnName(rowNumber, columnName) {
return this.list.get(rowNumber).element(by.css(`div[title="${columnName}"] span`));
return this.list.get(rowNumber).all(by.css(`div[title="${columnName}"] span`)).first();
}

getCellByRowContentAndColumn(rowColumn, rowContent, columnName) {
Expand Down
50 changes: 25 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/test-e2e-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ while [[ $1 == -* ]]; do
-b|--browser) set_browser; shift;;
-dev|--dev) set_development; shift;;
-s|--spec) set_test $2; shift 2;;
-db|--debug) debug; shift;;
-ud|--use-dist) lite_server; shift;;
-save) set_save_screenshot; shift;;
-proxy|--proxy) set_proxy $2; shift 2;;
-s|--seleniumServer) set_selenium $2; shift 2;;
-db|--debug) debug; shift;;
-host|--host) set_host $2; shift 2;;
-host_bpm|--host_bpm) set_host_bpm $2; shift 2;;
-host_sso|--host_sso) set_host_sso $2; shift 2;;
Expand Down

0 comments on commit 5e7aabf

Please sign in to comment.