Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stabilize some e2e cloud #5701

Merged
merged 6 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 5 additions & 8 deletions e2e/process-services-cloud/people-group-cloud-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,9 @@ describe('People Groups Cloud Component', () => {
await peopleCloudComponent.searchAssignee(apsUser.lastName);
await peopleCloudComponent.checkUserIsDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
await peopleCloudComponent.searchAssignee(devopsUser.lastName);
await peopleCloudComponent.checkUserIsNotDisplayed(`${devopsUser.firstName} ${devopsUser.lastName}`);
await peopleCloudComponent.checkUserIsNotDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
await peopleCloudComponent.checkNoResultsFoundError();
await peopleCloudComponent.searchAssignee(noRoleUser.lastName);
await browser.sleep(5000);
await peopleCloudComponent.checkUserIsNotDisplayed(`${noRoleUser.firstName} ${noRoleUser.lastName}`);
await peopleCloudComponent.checkNoResultsFoundError();
});

it('Multiple roles filtering', async () => {
Expand All @@ -139,8 +137,7 @@ describe('People Groups Cloud Component', () => {
await peopleCloudComponent.searchAssignee(testUser.lastName);
await peopleCloudComponent.checkUserIsDisplayed(`${testUser.firstName} ${testUser.lastName}`);
await peopleCloudComponent.searchAssignee(noRoleUser.lastName);
await peopleCloudComponent.checkUserIsNotDisplayed(`${testUser.firstName} ${testUser.lastName}`);
await peopleCloudComponent.checkUserIsNotDisplayed(`${noRoleUser.firstName} ${noRoleUser.lastName}`);
await peopleCloudComponent.checkNoResultsFoundError();
});
});

Expand Down Expand Up @@ -238,8 +235,8 @@ describe('People Groups Cloud Component', () => {
await peopleCloudComponent.checkSelectedPeople(`${testUser.firstName} ${testUser.lastName}`);
await peopleCloudComponent.checkSelectedPeople(`${noRoleUser.firstName} ${noRoleUser.lastName}`);

await peopleCloudComponent.searchAssigneeToExisting(noRoleUser.lastName);
await peopleCloudComponent.checkUserIsNotDisplayed(`${noRoleUser.firstName} ${noRoleUser.lastName}`);
await peopleCloudComponent.searchAssignee(noRoleUser.lastName);
await peopleCloudComponent.checkNoResultsFoundError();
});

it('[C309677] Should populate the Users without any validation when the Preselect flag is set to false', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ describe('People Groups Cloud Component', () => {
await peopleCloudComponent.selectAssigneeFromList(`${testUser.firstName} ${testUser.lastName}`);
await peopleCloudComponent.checkSelectedPeople(`${testUser.firstName} ${testUser.lastName}`);

await peopleCloudComponent.searchAssigneeToExisting(apsUser.firstName);
await peopleCloudComponent.searchAssignee(apsUser.firstName);
await peopleCloudComponent.checkUserIsDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
await peopleCloudComponent.selectAssigneeFromList(`${apsUser.firstName} ${apsUser.lastName}`);
await peopleCloudComponent.checkSelectedPeople(`${apsUser.firstName} ${apsUser.lastName}`);

await peopleCloudComponent.searchAssigneeToExisting(noRoleUser.firstName);
await peopleCloudComponent.checkUserIsNotDisplayed(`${noRoleUser.firstName} ${noRoleUser.lastName}`);
await peopleCloudComponent.searchAssignee(noRoleUser.firstName);
await peopleCloudComponent.checkNoResultsFoundError();
});

it('[C305041] Should filter the Groups Single Selection with the Application name filter', async () => {
Expand Down
4 changes: 2 additions & 2 deletions e2e/process-services-cloud/process-header-cloud.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('Process Header cloud component', () => {
await processCloudDemoPage.processListCloudComponent().selectRow(runningProcess.entry.name);
await expect(await processHeaderCloudPage.getId()).toEqual(runningProcess.entry.id);
await expect(await processHeaderCloudPage.getName()).toEqual(runningProcess.entry.name);
await expect(await processHeaderCloudPage.getStatus()).toEqual(runningProcess.entry.status);
await expect(await processHeaderCloudPage.getStatus()).toEqual('RUNNING');
await expect(await processHeaderCloudPage.getInitiator()).toEqual(runningProcess.entry.initiator);
await expect(await processHeaderCloudPage.getStartDate()).toEqual(runningCreatedDate);
await expect(await processHeaderCloudPage.getParentId()).toEqual(CONSTANTS.PROCESS_DETAILS.NO_PARENT);
Expand All @@ -143,7 +143,7 @@ describe('Process Header cloud component', () => {

await expect(await processHeaderCloudPage.getId()).toEqual(childCompleteProcess.entry.id);
await expect(await processHeaderCloudPage.getName()).toEqual(CONSTANTS.PROCESS_DETAILS.NO_NAME);
await expect(await processHeaderCloudPage.getStatus()).toEqual(childCompleteProcess.entry.status);
await expect(await processHeaderCloudPage.getStatus()).toEqual('COMPLETED');
await expect(await processHeaderCloudPage.getInitiator()).toEqual(childCompleteProcess.entry.initiator);
await expect(await processHeaderCloudPage.getStartDate()).toEqual(completedCreatedDate);
await expect(await processHeaderCloudPage.getParentId()).toEqual(childCompleteProcess.entry.parentId);
Expand Down
23 changes: 19 additions & 4 deletions e2e/process-services-cloud/task-filters-cloud.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@
*/

import { browser } from 'protractor';
import { LoginSSOPage, TasksService, ApiService, AppListCloudPage, StringUtil, IdentityService, GroupIdentityService } from '@alfresco/adf-testing';
import {
LoginSSOPage,
TasksService,
ApiService,
AppListCloudPage,
StringUtil,
IdentityService,
GroupIdentityService,
QueryService
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigation-bar.page';
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasks-cloud-demo.page';

Expand All @@ -27,16 +36,19 @@ describe('Task filters cloud', () => {
const navigationBarPage = new NavigationBarPage();
const appListCloudComponent = new AppListCloudPage();
const tasksCloudDemoPage = new TasksCloudDemoPage();

let tasksService: TasksService;
let identityService: IdentityService;
let groupIdentityService: GroupIdentityService;
let queryService: QueryService;
let testUser, groupInfo;
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.config.bpmHost, browser.params.config.oauth2.host, 'BPM');

const newTask = StringUtil.generateRandomString(5), completedTask = StringUtil.generateRandomString(5);
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;

beforeAll(async() => {
beforeAll(async () => {
queryService = new QueryService(apiService);

await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
Expand All @@ -48,11 +60,13 @@ describe('Task filters cloud', () => {
await apiService.login(testUser.email, testUser.password);

await loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);

});

afterAll(async() => {
afterAll(async () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
await identityService.deleteIdentityUser(testUser.idIdentityService);

});

beforeEach(async () => {
Expand Down Expand Up @@ -84,6 +98,7 @@ describe('Task filters cloud', () => {
await tasksService.claimTask(toBeCompletedTask.entry.id, simpleApp);
await tasksService.completeTask(toBeCompletedTask.entry.id, simpleApp);

await queryService.getTaskByStatus(toBeCompletedTask.entry.name, simpleApp, 'COMPLETED');
await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks');
await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks');
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTask);
Expand All @@ -94,5 +109,5 @@ describe('Task filters cloud', () => {
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTask);
});

});
});
});
17 changes: 11 additions & 6 deletions e2e/process-services-cloud/task-header-cloud.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('Task Header cloud component', () => {
await expect(await taskHeaderCloudPage.getId()).toEqual(basicCreatedTask.entry.id);
await expect(await taskHeaderCloudPage.getDescription())
.toEqual(isValueInvalid(basicCreatedTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : basicCreatedTask.entry.description);
await expect(await taskHeaderCloudPage.getStatus()).toEqual(basicCreatedTask.entry.status);
await expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
await expect(await taskHeaderCloudPage.getPriority()).toEqual(basicCreatedTask.entry.priority.toString());
await expect(await taskHeaderCloudPage.getCategory()).toEqual(!basicCreatedTask.entry.category ?
CONSTANTS.TASK_DETAILS.NO_CATEGORY : basicCreatedTask.entry.category);
Expand All @@ -165,7 +165,7 @@ describe('Task Header cloud component', () => {
await expect(await taskHeaderCloudPage.getId()).toEqual(completedTask.entry.id);
await expect(await taskHeaderCloudPage.getDescription())
.toEqual(isValueInvalid(completedTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : completedTask.entry.description);
await expect(await taskHeaderCloudPage.getStatus()).toEqual(completedTask.entry.status);
await expect(await taskHeaderCloudPage.getStatus()).toEqual('COMPLETED');
await expect(await taskHeaderCloudPage.getPriority()).toEqual(completedTask.entry.priority.toString());
await expect(await taskHeaderCloudPage.getCategory()).toEqual(!completedTask.entry.category ?
CONSTANTS.TASK_DETAILS.NO_CATEGORY : completedTask.entry.category);
Expand All @@ -185,7 +185,7 @@ describe('Task Header cloud component', () => {
await expect(await taskHeaderCloudPage.getId()).toEqual(subTask.entry.id);
await expect(await taskHeaderCloudPage.getDescription())
.toEqual(isValueInvalid(subTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : subTask.entry.description);
await expect(await taskHeaderCloudPage.getStatus()).toEqual(subTask.entry.status);
await expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
await expect(await taskHeaderCloudPage.getPriority()).toEqual(subTask.entry.priority.toString());
await expect(await taskHeaderCloudPage.getCategory()).toEqual(!subTask.entry.category ?
CONSTANTS.TASK_DETAILS.NO_CATEGORY : subTask.entry.category);
Expand Down Expand Up @@ -239,12 +239,17 @@ describe('Task Header cloud component', () => {
const currentAssignee = await peopleCloudComponentPage.getChipAssignee();
await expect(currentAssignee).toContain(testUser.firstName, 'Invalid Assignee first name set for the new task');
await expect(currentAssignee).toContain(testUser.lastName, 'Invalid Assignee last name set for the new task');

await peopleCloudComponentPage.searchAssignee('hrUser');
await peopleCloudComponentPage.checkUserIsDisplayed('HR User');
await peopleCloudComponentPage.selectAssigneeFromList('HR User');
await peopleCloudComponentPage.checkSelectedPeople('HR User');

await peopleCloudComponentPage.searchAssignee('processAdmin');
await peopleCloudComponentPage.checkUserIsDisplayed('Process Admin User');
await peopleCloudComponentPage.selectAssigneeFromList('Process Admin User');
await peopleCloudComponentPage.checkSelectedPeople('Process Admin User');

await peopleCloudComponentPage.searchAssignee('modeler');
await peopleCloudComponentPage.checkOptionIsNotDisplayed();
await peopleCloudComponentPage.checkNoResultsFoundError();
});

describe('Default Date format', () => {
Expand Down
7 changes: 4 additions & 3 deletions lib/testing/src/lib/core/utils/browser-visibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

import { browser, by, element, ElementFinder, protractor } from 'protractor';

const DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 40000;
const DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 20000;
const NOT_VISIBLE_DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 5000;

export class BrowserVisibility {

Expand Down Expand Up @@ -48,7 +49,7 @@ export class BrowserVisibility {
/*
* Wait for element to not be visible
*/
static async waitUntilElementIsNotVisible(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
static async waitUntilElementIsNotVisible(elementToCheck: ElementFinder, waitTimeout: number = NOT_VISIBLE_DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(protractor.ExpectedConditions.invisibilityOf(elementToCheck), waitTimeout, 'Element is Visible and it should not' + elementToCheck.locator());
}

Expand All @@ -59,7 +60,7 @@ export class BrowserVisibility {
return browser.wait(protractor.ExpectedConditions.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, 'Element doesn\'t have a value ' + elementToCheck.locator());
}

static async waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
static async waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = NOT_VISIBLE_DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(protractor.ExpectedConditions.stalenessOf(elementToCheck), waitTimeout, 'Element is present ' + elementToCheck.locator());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class PeopleCloudComponentPage {

peopleCloudSearch: ElementFinder = element(by.css('input[data-automation-id="adf-people-cloud-search-input"]'));
assigneeField: ElementFinder = element(by.css('input[data-automation-id="adf-people-cloud-search-input"]'));
selectionReady: ElementFinder = element(by.css('div[data-automation-id="adf-people-cloud-row"]'));
formFields: FormFields = new FormFields();
labelLocator: Locator = by.css("label[class*='adf-label']");
inputLocator: Locator = by.css('input');
Expand All @@ -48,10 +49,6 @@ export class PeopleCloudComponentPage {
await BrowserActions.clearSendKeys(this.peopleCloudSearch, name);
}

async searchAssigneeToExisting(name: string): Promise<void> {
await BrowserActions.clearSendKeys(this.peopleCloudSearch, name);
}

async selectAssigneeFromList(name: string): Promise<void> {
const assigneeRow = element.all(by.cssContainingText('mat-option span.adf-people-label-name', name)).first();
await BrowserActions.click(assigneeRow);
Expand Down Expand Up @@ -79,6 +76,7 @@ export class PeopleCloudComponentPage {
}

async checkUserIsNotDisplayed(name: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.selectionReady);
const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name));
await BrowserVisibility.waitUntilElementIsNotVisible(assigneeRow);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class TaskFiltersCloudComponentPage {
this.filter = this.getTaskFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
await browser.sleep(1000);
await browser.sleep(1500);
}

async checkTaskFilterNotDisplayed(filterName: string): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion protractor.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const projectRoot = path.resolve(__dirname);
const width = 1657, height = 1657;

let ENV_FILE = process.env.ENV_FILE;
let GROUP_SUFFIX = process.env.PREFIX;
let GROUP_SUFFIX = process.env.PREFIX || 'adf';

RESOURCES.ACTIVITI_CLOUD_APPS = ACTIVITI_CLOUD_APPS;
if (ENV_FILE) {
Expand Down