mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-4474]Add isStartProcessButtonEnabled method
* [ACA-4474] Add isStartProcessButtonEnabled method * Refactor tests * Fix lint error * Refactor isStartProcessButtonEnabled method * Fix startProcessWithProcessDefinition method * Fix tests * no message * Fix isStartProcessButtonDisabled method * Exclude failing e2e
This commit is contained in:
@@ -28,6 +28,7 @@ export class StartProcessCloudPage {
|
||||
cancelProcessButton = element(by.id('cancel_process'));
|
||||
formStartProcessButton = element(by.css('button[data-automation-id="adf-form-start process"]'));
|
||||
startProcessButton = element(by.css('button[data-automation-id="btn-start"]'));
|
||||
startProcessButtonDisabled = element(by.css('button[data-automation-id="btn-start"][disabled]'));
|
||||
noProcess = element(by.id('no-process-message'));
|
||||
processDefinition = element(by.css('input[id="processDefinitionName"]'));
|
||||
processDefinitionOptionsPanel = element(by.css('div[class*="processDefinitionOptions"]'));
|
||||
@@ -83,12 +84,21 @@ export class StartProcessCloudPage {
|
||||
await BrowserActions.click(this.cancelProcessButton);
|
||||
}
|
||||
|
||||
async checkStartProcessButtonIsEnabled(): Promise<boolean> {
|
||||
await browser.sleep(2000); // waiting for API response
|
||||
async isStartProcessButtonEnabled(): Promise<boolean> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.startProcessButtonDisabled);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.startProcessButton);
|
||||
return this.startProcessButton.isEnabled();
|
||||
}
|
||||
|
||||
async isStartProcessButtonDisabled(): Promise<boolean> {
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.startProcessButtonDisabled);
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async clickStartProcessButton(): Promise<void> {
|
||||
await BrowserActions.click(this.startProcessButton);
|
||||
}
|
||||
@@ -111,7 +121,8 @@ export class StartProcessCloudPage {
|
||||
async startProcessWithProcessDefinition(processName: string, processDefinition: string) {
|
||||
await this.selectFromProcessDropdown(processDefinition);
|
||||
await this.enterProcessName(processName);
|
||||
await this.checkStartProcessButtonIsEnabled();
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.startProcessButtonDisabled);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.startProcessButton);
|
||||
await this.clickStartProcessButton();
|
||||
}
|
||||
|
||||
|
@@ -31,6 +31,7 @@ export class StartProcessPage {
|
||||
cancelProcessButton = element(by.id('cancel_process'));
|
||||
formStartProcessButton = element(by.css('button[data-automation-id="adf-form-start process"]'));
|
||||
startProcessButton = element(by.css('button[data-automation-id="btn-start"]'));
|
||||
startProcessButtonDisabled = element(by.css('button[data-automation-id="btn-start"][disabled]'));
|
||||
noProcess = element(by.css('.adf-empty-content__title'));
|
||||
processDefinition = element(by.css('input[id="processDefinitionName"]'));
|
||||
processDefinitionOptionsPanel = element(by.css('div[class*="mat-autocomplete-panel"]'));
|
||||
@@ -124,8 +125,9 @@ export class StartProcessPage {
|
||||
return this.formStartProcessButton.isEnabled();
|
||||
}
|
||||
|
||||
async checkStartProcessButtonIsEnabled() {
|
||||
await expect(await this.startProcessButton.isEnabled()).toBe(true);
|
||||
async isStartProcessButtonEnabled() {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.startProcessButtonDisabled);
|
||||
return this.startProcessButton.isEnabled();
|
||||
}
|
||||
|
||||
async checkStartProcessButtonIsDisabled() {
|
||||
|
Reference in New Issue
Block a user