[ADF-3828] - e2e add assignee tests (#4221)

* add identity host

* add test for  assign user

* clear assignee input field

* added hostIdentity parameter

* add test for default assignee user

* add hostIdentity parameter

* add test for remove assignee

* add a new constant for start task name

* add hostIdentitty in setProviderBpmSso method

* remove duplicated method

* fix test C291799

* fix test C291872
This commit is contained in:
rgherghelas
2019-02-05 14:54:40 +02:00
committed by Eugenio Romano
parent 673b0f6b5c
commit 2badd81634
16 changed files with 76 additions and 30 deletions

View File

@@ -52,11 +52,11 @@ describe('Universal Icon component', function () {
it('[C291872] Should display the icons on the page', () => { it('[C291872] Should display the icons on the page', () => {
expect(iconsPage.locateLigatureIcon('alarm').isDisplayed()).toBe(true, 'Ligature icon is not displayed'); expect(iconsPage.locateLigatureIcon('folder').isDisplayed()).toBe(true, 'Ligature icon is not displayed');
expect(iconsPage.locateCustomIcon('adf:move_file').isDisplayed()).toBe(true, 'Named icon is not displayed'); expect(iconsPage.locateCustomIcon('adf:move_file').isDisplayed()).toBe(true, 'Named icon is not displayed');
expect(iconsPage.locateCustomIcon('image/gif').isDisplayed()).toBe(true, 'Thumbnail service icon is not displayed'); expect(iconsPage.locateCustomIcon('adf:folder').isDisplayed()).toBe(true, 'Thumbnail service icon is not displayed');
}); });
}); });

View File

@@ -36,13 +36,13 @@ describe('Login component - SSO', () => {
it('[C261050] Should be possible login in the PS with SSO', () => { it('[C261050] Should be possible login in the PS with SSO', () => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginApsPage.clickOnSSOButton(); loginApsPage.clickOnSSOButton();
loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
}); });
it('[C280667] Should be redirect directly to keycloak without show the login page with silent login', () => { it('[C280667] Should be redirect directly to keycloak without show the login page with silent login', () => {
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity);
loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
}); });
}); });

View File

@@ -36,7 +36,7 @@ describe('User Info - SSO', () => {
await identityService.init(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); await identityService.init(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
identityUser = await identityService.createIdentityUser(); identityUser = await identityService.createIdentityUser();
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
browser.ignoreSynchronization = true; browser.ignoreSynchronization = true;
loginSSOPage.loginAPS(identityUser['0'].username, identityUser['0'].password); loginSSOPage.loginAPS(identityUser['0'].username, identityUser['0'].password);

View File

@@ -251,10 +251,6 @@ export class DataTablePage {
return this; return this;
} }
checkSpinnerIsNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.spinner);
}
checkRowIsDisplayedByName(filename) { checkRowIsDisplayedByName(filename) {
Util.waitUntilElementIsVisible(element.all(by.css(`div[filename="${filename}"]`)).first()); Util.waitUntilElementIsVisible(element.all(by.css(`div[filename="${filename}"]`)).first());
} }

View File

@@ -152,4 +152,18 @@ export class EditTaskFilterCloudComponent {
return this; return this;
} }
clearAssignment() {
this.clearField(this.assignment);
return this;
}
clearField(locator) {
Util.waitUntilElementIsVisible(locator);
locator.getAttribute('value').then((result) => {
for (let i = result.length; i >= 0; i--) {
locator.sendKeys(protractor.Key.BACK_SPACE);
}
});
}
} }

View File

@@ -57,6 +57,7 @@ export class StartTasksCloudComponent {
addAssignee(name) { addAssignee(name) {
Util.waitUntilElementIsVisible(this.assignee); Util.waitUntilElementIsVisible(this.assignee);
this.assignee.clear();
this.assignee.sendKeys(name); this.assignee.sendKeys(name);
this.selectAssigneeFromList(name); this.selectAssigneeFromList(name);
return this; return this;
@@ -72,7 +73,7 @@ export class StartTasksCloudComponent {
getAssignee() { getAssignee() {
Util.waitUntilElementIsVisible(this.assignee); Util.waitUntilElementIsVisible(this.assignee);
return this.assignee.getAttribute('placeholder'); return this.assignee.getAttribute('value');
} }
clickStartButton() { clickStartButton() {

View File

@@ -44,8 +44,9 @@ export class SettingsPage {
bpmText = element(by.css('input[data-automation-id*="bpmHost"]')); bpmText = element(by.css('input[data-automation-id*="bpmHost"]'));
clientIdText = element(by.css('input[id="clientId"]')); clientIdText = element(by.css('input[id="clientId"]'));
authHostText = element(by.css('input[id="oauthHost"]')); authHostText = element(by.css('input[id="oauthHost"]'));
ssoRadioButton = element(by.cssContainingText('mat-radio-button[id*="mat-radio"]', 'SSO'));
basicAuthRadioButton = element(by.cssContainingText('mat-radio-button[id*="mat-radio"]', 'Basic Authentication')); basicAuthRadioButton = element(by.cssContainingText('mat-radio-button[id*="mat-radio"]', 'Basic Authentication'));
identityHostText = element(by.css('input[id="identityHost"]'));
ssoRadioButton = element(by.cssContainingText('[id*="mat-radio"]', 'SSO'));
silentLoginToggleLabel = element(by.css('mat-slide-toggle[name="silentLogin"] label')); silentLoginToggleLabel = element(by.css('mat-slide-toggle[name="silentLogin"] label'));
silentLoginToggleElement = element(by.css('mat-slide-toggle[name="silentLogin"]')); silentLoginToggleElement = element(by.css('mat-slide-toggle[name="silentLogin"]'));
implicitFlowLabel = element(by.css('mat-slide-toggle[name="implicitFlow"] label')); implicitFlowLabel = element(by.css('mat-slide-toggle[name="implicitFlow"] label'));
@@ -139,7 +140,7 @@ export class SettingsPage {
await this.ssoRadioButton.click(); await this.ssoRadioButton.click();
} }
async setProviderBpmSso (processServiceURL, authHost, silentLogin = true, implicitFlow = true ) { async setProviderBpmSso (processServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true ) {
this.goToSettingsPage(); this.goToSettingsPage();
this.setProvider(this.bpm.option, this.bpm.text); this.setProvider(this.bpm.option, this.bpm.text);
Util.waitUntilElementIsVisible(this.bpmText); Util.waitUntilElementIsVisible(this.bpmText);
@@ -148,6 +149,7 @@ export class SettingsPage {
await this.setClientId(); await this.setClientId();
await this.setProcessServicesURL(processServiceURL); await this.setProcessServicesURL(processServiceURL);
await this.setAuthHost(authHost); await this.setAuthHost(authHost);
await this.setIdentityHost(identityHost);
await this.setSilentLogin(silentLogin); await this.setSilentLogin(silentLogin);
await this.setImplicitFlow(implicitFlow); await this.setImplicitFlow(implicitFlow);
await this.clickApply(); await this.clickApply();
@@ -191,6 +193,12 @@ export class SettingsPage {
await this.authHostText.sendKeys(authHostURL); await this.authHostText.sendKeys(authHostURL);
} }
async setIdentityHost (identityHost) {
Util.waitUntilElementIsVisible(this.identityHostText);
await this.identityHostText.clear();
await this.identityHostText.sendKeys(identityHost);
}
async clickApply () { async clickApply () {
Util.waitUntilElementIsVisible(this.applyButton); Util.waitUntilElementIsVisible(this.applyButton);
await this.applyButton.click(); await this.applyButton.click();

View File

@@ -30,7 +30,7 @@ describe('Applications list', () => {
const appName = 'simple-app'; const appName = 'simple-app';
it('[C289910] Should the app be displayed on dashboard when is deployed on APS', () => { it('[C289910] Should the app be displayed on dashboard when is deployed on APS', () => {
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity);
loginSSOPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); loginSSOPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
navigationBarPage.navigateToProcessServicesCloudPage(); navigationBarPage.navigateToProcessServicesCloudPage();
appListCloudComponent.checkApsContainer(); appListCloudComponent.checkApsContainer();

View File

@@ -43,7 +43,7 @@ describe('Edit task filters cloud', () => {
beforeAll(async () => { beforeAll(async () => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
loginSSOPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); loginSSOPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
@@ -62,9 +62,6 @@ describe('Edit task filters cloud', () => {
afterEach((done) => { afterEach((done) => {
tasksCloudDemoPage.myTasksFilter().clickTaskFilter(); tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setSortFilterDropDown('Created Date');
expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Created Date');
tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveButton();
done(); done();
}); });

View File

@@ -51,7 +51,7 @@ describe('Process list cloud', () => {
beforeAll(async () => { beforeAll(async () => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
loginSSOPage.loginAPS(user, password); loginSSOPage.loginAPS(user, password);

View File

@@ -51,7 +51,7 @@ describe('Process filters cloud', () => {
beforeAll(async () => { beforeAll(async () => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
loginSSOPage.loginAPS(user, password); loginSSOPage.loginAPS(user, password);

View File

@@ -43,7 +43,7 @@ describe('Start Process', () => {
beforeAll((done) => { beforeAll((done) => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
loginSSOPage.loginAPS(user, password); loginSSOPage.loginAPS(user, password);
navigationBarPage.navigateToProcessServicesCloudPage(); navigationBarPage.navigateToProcessServicesCloudPage();

View File

@@ -32,7 +32,8 @@ describe('Start Task', () => {
const appListCloudComponent = new AppListCloudComponent(); const appListCloudComponent = new AppListCloudComponent();
const tasksCloudDemoPage = new TasksCloudDemoPage(); const tasksCloudDemoPage = new TasksCloudDemoPage();
const startTask = new StartTasksCloudComponent(); const startTask = new StartTasksCloudComponent();
const standaloneTaskName = Util.generateRandomString(5); const standaloneTaskName1 = Util.generateRandomString(5);
const standaloneTaskName2 = Util.generateRandomString(5);
const taskName255Characters = Util.generateRandomString(255); const taskName255Characters = Util.generateRandomString(255);
const taskNameBiggerThen255Characters = Util.generateRandomString(256); const taskNameBiggerThen255Characters = Util.generateRandomString(256);
const lengthValidationError = 'Length exceeded, 255 characters max.'; const lengthValidationError = 'Length exceeded, 255 characters max.';
@@ -44,7 +45,7 @@ describe('Start Task', () => {
beforeAll((done) => { beforeAll((done) => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
loginSSOPage.loginAPS(user, password); loginSSOPage.loginAPS(user, password);
navigationBarPage.navigateToProcessServicesCloudPage(); navigationBarPage.navigateToProcessServicesCloudPage();
@@ -60,22 +61,22 @@ describe('Start Task', () => {
startTask.checkStartButtonIsDisabled() startTask.checkStartButtonIsDisabled()
.blur(startTask.name) .blur(startTask.name)
.checkValidationErrorIsDisplayed(requiredError); .checkValidationErrorIsDisplayed(requiredError);
startTask.addName(standaloneTaskName) startTask.addName(standaloneTaskName1)
.addDescription('descriptions') .addDescription('descriptions')
.addDueDate('12/12/2018'); .addDueDate('12/12/2018');
startTask.checkStartButtonIsEnabled(); startTask.checkStartButtonIsEnabled();
startTask.clickCancelButton(); startTask.clickCancelButton();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsNotDisplayed(standaloneTaskName); tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsNotDisplayed(standaloneTaskName1);
}); });
it('[C290180] Should be able to create a new standalone task', () => { it('[C290180] Should be able to create a new standalone task', () => {
tasksCloudDemoPage.openNewTaskForm(); tasksCloudDemoPage.openNewTaskForm();
startTask.addName(standaloneTaskName) startTask.addName(standaloneTaskName1)
.addDescription('descriptions') .addDescription('descriptions')
.addDueDate('12/12/2018') .addDueDate('12/12/2018')
.addPriority('50') .addPriority('50')
.clickStartButton(); .clickStartButton();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsDisplayed(standaloneTaskName); tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsDisplayed(standaloneTaskName1);
}); });
it('[C290181] Should be displayed an error message if task name exceed 255 characters', () => { it('[C290181] Should be displayed an error message if task name exceed 255 characters', () => {
@@ -96,7 +97,36 @@ describe('Start Task', () => {
startTask.addDueDate('invalid date') startTask.addDueDate('invalid date')
.blur(startTask.dueDate) .blur(startTask.dueDate)
.validateDate(dateValidationError) .validateDate(dateValidationError)
.checkStartButtonIsDisabled(); .checkStartButtonIsDisabled()
.clickCancelButton();
});
it('[C290182] Should be possible to assign the task to another user', () => {
tasksCloudDemoPage.openNewTaskForm();
startTask.addName(standaloneTaskName1)
.addAssignee('Super Admin')
.clickStartButton();
tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsNotDisplayed(standaloneTaskName1);
});
it('[C291953] Assignee field should display the logged user as default', () => {
tasksCloudDemoPage.openNewTaskForm();
expect(startTask.getAssignee()).toContain('Admin', 'does not contain Admin');
startTask.clickCancelButton();
});
it('[C291956] Should be able to create a new standalone task without assignee', () => {
tasksCloudDemoPage.openNewTaskForm();
startTask.addName(standaloneTaskName2);
startTask.clearField(startTask.assignee);
startTask.clickStartButton();
tasksCloudDemoPage.editTaskFilterCloudComponent()
.clickCustomiseFilterHeader()
.setStateFilterDropDown('CREATED')
.clearAssignment();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsDisplayed(standaloneTaskName2);
}); });
}); });

View File

@@ -53,7 +53,7 @@ describe('Task Header cloud component', () => {
beforeAll(async (done) => { beforeAll(async (done) => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
loginSSOPage.loginAPS(user, password); loginSSOPage.loginAPS(user, password);

View File

@@ -42,7 +42,7 @@ describe('Task filters cloud', () => {
beforeAll(() => { beforeAll(() => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
loginSSOPage.loginAPS(user, password); loginSSOPage.loginAPS(user, password);
}); });

View File

@@ -57,7 +57,7 @@ describe('Task filters cloud', () => {
beforeAll(async () => { beforeAll(async () => {
silentLogin = false; silentLogin = false;
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, silentLogin); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin);
loginSSOPage.clickOnSSOButton(); loginSSOPage.clickOnSSOButton();
loginSSOPage.loginAPS(user, password); loginSSOPage.loginAPS(user, password);