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

[ACA-3390]Add startProcessWithApplication method on StartProcessPage #5741

Merged
merged 3 commits into from Jun 2, 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
20 changes: 10 additions & 10 deletions e2e/process-services/start-process-component.e2e.ts
Expand Up @@ -182,8 +182,8 @@ describe('Start Process Component', () => {

await startProcessPage.checkStartProcessButtonIsDisabled();
await startProcessPage.clickProcessDropdownArrow();
await startProcessPage.checkOptionIsDisplayed(processModelWithSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkProcessOptionIsDisplayed(processModelWithSe);
await startProcessPage.checkProcessOptionIsDisplayed(processModelWithoutSe);
});

it('[C260443] Should be possible to start a process without start event', async () => {
Expand Down Expand Up @@ -241,9 +241,9 @@ describe('Start Process Component', () => {
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkProcessOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkProcessOptionIsDisplayed(processModelWithSe);
await startProcessPage.selectProcessOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
});

Expand All @@ -253,9 +253,9 @@ describe('Start Process Component', () => {
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition(processModelWithoutSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkOptionIsNotDisplayed(processModelWithSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkProcessOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkProcessOptionIsNotDisplayed(processModelWithSe);
await startProcessPage.selectProcessOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
});

Expand All @@ -275,7 +275,7 @@ describe('Start Process Component', () => {
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Type');
await startProcessPage.typeProcessDefinition(processModelWithoutSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.selectProcessOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.clickStartProcessButton();
Expand All @@ -300,7 +300,7 @@ describe('Start Process Component', () => {
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.selectProcessOption(processModelWithoutSe);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.clickProcessDropdownArrow();

Expand Down
2 changes: 1 addition & 1 deletion e2e/process-services/stencil.e2e.ts
Expand Up @@ -76,7 +76,7 @@ describe('Stencil', () => {
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();

await startProcessPage.startProcess({ name, processName: app.processName });
await startProcessPage.startProcess(name, app.processName);
await processListDemoPage.checkProcessIsDisplayed(name);
await processFiltersPage.selectFromProcessList(name);

Expand Down
2 changes: 1 addition & 1 deletion e2e/process-services/task-assignee.e2e.ts
Expand Up @@ -88,7 +88,7 @@ describe('Task Assignee', () => {
await processListPage.checkProcessListIsDisplayed();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.startProcess({ name , processName: app.processNames[0] });
await startProcessPage.startProcess(name, app.processNames[0]);
await processFiltersPage.selectFromProcessList(name);
await processDetailsPage.clickOnActiveTask();

Expand Down
Expand Up @@ -25,6 +25,7 @@ export class StartProcessPage {

defaultProcessName: ElementFinder = element(by.css('input[id="processName"]'));
processNameInput: ElementFinder = element(by.id('processName'));
disabledSelectProcessDropdown: ElementFinder = element(by.css('input[id="processDefinitionName"][disabled]'));
selectProcessDropdownArrow: ElementFinder = element(by.css('button[id="adf-select-process-dropdown"]'));
cancelProcessButton: ElementFinder = element(by.id('cancel_process'));
formStartProcessButton: ElementFinder = element(by.css('button[data-automation-id="adf-form-start process"]'));
Expand All @@ -33,7 +34,8 @@ export class StartProcessPage {
processDefinition: ElementFinder = element(by.css('input[id="processDefinitionName"]'));
processDefinitionOptionsPanel: ElementFinder = element(by.css('div[class*="mat-autocomplete-panel"]'));

dropdownPage = new DropdownPage();
processDefinitionDropdown = new DropdownPage(element(by.id('adf-select-process-dropdown')));
applicationDropdown = new DropdownPage(element(by.css('[data-automation-id*="start-process-app"] div[class="mat-select-arrow"]')));

async checkNoProcessMessage(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.noProcess);
Expand Down Expand Up @@ -64,23 +66,28 @@ export class StartProcessPage {

async selectFromProcessDropdown(name): Promise<void> {
await this.clickProcessDropdownArrow();
await this.selectOption(name);
await this.selectProcessOption(name);
}

async selectFromApplicationDropdown(name): Promise<void> {
await this.applicationDropdown.clickDropdown();
await this.applicationDropdown.selectOption(name);
}

async clickProcessDropdownArrow(): Promise<void> {
await BrowserActions.click(this.selectProcessDropdownArrow);
}

async checkOptionIsDisplayed(name): Promise<void> {
await this.dropdownPage.checkOptionIsDisplayed(name);
async checkProcessOptionIsDisplayed(name): Promise<void> {
await this.processDefinitionDropdown.checkOptionIsDisplayed(name);
}

async checkOptionIsNotDisplayed(name): Promise<void> {
await this.dropdownPage.checkOptionIsNotDisplayed(name);
async checkProcessOptionIsNotDisplayed(name): Promise<void> {
await this.processDefinitionDropdown.checkOptionIsNotDisplayed(name);
}

async selectOption(name): Promise<void> {
await this.dropdownPage.selectOption(name);
async selectProcessOption(name): Promise<void> {
await this.processDefinitionDropdown.selectOption(name);
}

async typeProcessDefinition(name): Promise<void> {
Expand Down Expand Up @@ -145,8 +152,20 @@ export class StartProcessPage {
return new FormFields();
}

async startProcess({name, processName }) {
async checkProcessDefinitionDropdownIsEnabled(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.disabledSelectProcessDropdown);
cristinaj marked this conversation as resolved.
Show resolved Hide resolved
}

async startProcess(name: string, processName: string) {
await this.enterProcessName(name);
await this.selectFromProcessDropdown(processName);
await this.clickStartProcessButton();
}

async startProcessWithApplication(name: string, applicationName: string, processName: string) {
await this.enterProcessName(name);
await this.selectFromApplicationDropdown(applicationName);
await this.checkProcessDefinitionDropdownIsEnabled();
await this.selectFromProcessDropdown(processName);
await this.clickStartProcessButton();
}
Expand Down