mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Eugenio Romano
parent
673b0f6b5c
commit
2badd81634
@@ -52,11 +52,11 @@ describe('Universal Icon component', function () {
|
||||
|
||||
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('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');
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -36,13 +36,13 @@ describe('Login component - SSO', () => {
|
||||
|
||||
it('[C261050] Should be possible login in the PS with SSO', () => {
|
||||
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.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
@@ -36,7 +36,7 @@ describe('User Info - SSO', () => {
|
||||
await identityService.init(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
identityUser = await identityService.createIdentityUser();
|
||||
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();
|
||||
browser.ignoreSynchronization = true;
|
||||
loginSSOPage.loginAPS(identityUser['0'].username, identityUser['0'].password);
|
||||
|
@@ -251,10 +251,6 @@ export class DataTablePage {
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSpinnerIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.spinner);
|
||||
}
|
||||
|
||||
checkRowIsDisplayedByName(filename) {
|
||||
Util.waitUntilElementIsVisible(element.all(by.css(`div[filename="${filename}"]`)).first());
|
||||
}
|
||||
|
@@ -152,4 +152,18 @@ export class EditTaskFilterCloudComponent {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -57,6 +57,7 @@ export class StartTasksCloudComponent {
|
||||
|
||||
addAssignee(name) {
|
||||
Util.waitUntilElementIsVisible(this.assignee);
|
||||
this.assignee.clear();
|
||||
this.assignee.sendKeys(name);
|
||||
this.selectAssigneeFromList(name);
|
||||
return this;
|
||||
@@ -72,7 +73,7 @@ export class StartTasksCloudComponent {
|
||||
|
||||
getAssignee() {
|
||||
Util.waitUntilElementIsVisible(this.assignee);
|
||||
return this.assignee.getAttribute('placeholder');
|
||||
return this.assignee.getAttribute('value');
|
||||
}
|
||||
|
||||
clickStartButton() {
|
||||
|
@@ -44,8 +44,9 @@ export class SettingsPage {
|
||||
bpmText = element(by.css('input[data-automation-id*="bpmHost"]'));
|
||||
clientIdText = element(by.css('input[id="clientId"]'));
|
||||
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'));
|
||||
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'));
|
||||
silentLoginToggleElement = element(by.css('mat-slide-toggle[name="silentLogin"]'));
|
||||
implicitFlowLabel = element(by.css('mat-slide-toggle[name="implicitFlow"] label'));
|
||||
@@ -139,7 +140,7 @@ export class SettingsPage {
|
||||
await this.ssoRadioButton.click();
|
||||
}
|
||||
|
||||
async setProviderBpmSso (processServiceURL, authHost, silentLogin = true, implicitFlow = true ) {
|
||||
async setProviderBpmSso (processServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true ) {
|
||||
this.goToSettingsPage();
|
||||
this.setProvider(this.bpm.option, this.bpm.text);
|
||||
Util.waitUntilElementIsVisible(this.bpmText);
|
||||
@@ -148,6 +149,7 @@ export class SettingsPage {
|
||||
await this.setClientId();
|
||||
await this.setProcessServicesURL(processServiceURL);
|
||||
await this.setAuthHost(authHost);
|
||||
await this.setIdentityHost(identityHost);
|
||||
await this.setSilentLogin(silentLogin);
|
||||
await this.setImplicitFlow(implicitFlow);
|
||||
await this.clickApply();
|
||||
@@ -191,6 +193,12 @@ export class SettingsPage {
|
||||
await this.authHostText.sendKeys(authHostURL);
|
||||
}
|
||||
|
||||
async setIdentityHost (identityHost) {
|
||||
Util.waitUntilElementIsVisible(this.identityHostText);
|
||||
await this.identityHostText.clear();
|
||||
await this.identityHostText.sendKeys(identityHost);
|
||||
}
|
||||
|
||||
async clickApply () {
|
||||
Util.waitUntilElementIsVisible(this.applyButton);
|
||||
await this.applyButton.click();
|
||||
|
@@ -30,7 +30,7 @@ describe('Applications list', () => {
|
||||
const appName = 'simple-app';
|
||||
|
||||
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);
|
||||
navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
appListCloudComponent.checkApsContainer();
|
||||
|
@@ -43,7 +43,7 @@ describe('Edit task filters cloud', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
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.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
@@ -62,9 +62,6 @@ describe('Edit task filters cloud', () => {
|
||||
|
||||
afterEach((done) => {
|
||||
tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
|
||||
tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setSortFilterDropDown('Created Date');
|
||||
expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Created Date');
|
||||
tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveButton();
|
||||
done();
|
||||
});
|
||||
|
||||
|
@@ -51,7 +51,7 @@ describe('Process list cloud', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
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.loginAPS(user, password);
|
||||
|
||||
|
@@ -51,7 +51,7 @@ describe('Process filters cloud', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
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.loginAPS(user, password);
|
||||
|
||||
|
@@ -43,7 +43,7 @@ describe('Start Process', () => {
|
||||
|
||||
beforeAll((done) => {
|
||||
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.loginAPS(user, password);
|
||||
navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
|
@@ -32,7 +32,8 @@ describe('Start Task', () => {
|
||||
const appListCloudComponent = new AppListCloudComponent();
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
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 taskNameBiggerThen255Characters = Util.generateRandomString(256);
|
||||
const lengthValidationError = 'Length exceeded, 255 characters max.';
|
||||
@@ -44,7 +45,7 @@ describe('Start Task', () => {
|
||||
|
||||
beforeAll((done) => {
|
||||
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.loginAPS(user, password);
|
||||
navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
@@ -60,22 +61,22 @@ describe('Start Task', () => {
|
||||
startTask.checkStartButtonIsDisabled()
|
||||
.blur(startTask.name)
|
||||
.checkValidationErrorIsDisplayed(requiredError);
|
||||
startTask.addName(standaloneTaskName)
|
||||
startTask.addName(standaloneTaskName1)
|
||||
.addDescription('descriptions')
|
||||
.addDueDate('12/12/2018');
|
||||
startTask.checkStartButtonIsEnabled();
|
||||
startTask.clickCancelButton();
|
||||
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsNotDisplayed(standaloneTaskName);
|
||||
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkContentIsNotDisplayed(standaloneTaskName1);
|
||||
});
|
||||
|
||||
it('[C290180] Should be able to create a new standalone task', () => {
|
||||
tasksCloudDemoPage.openNewTaskForm();
|
||||
startTask.addName(standaloneTaskName)
|
||||
startTask.addName(standaloneTaskName1)
|
||||
.addDescription('descriptions')
|
||||
.addDueDate('12/12/2018')
|
||||
.addPriority('50')
|
||||
.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', () => {
|
||||
@@ -96,7 +97,36 @@ describe('Start Task', () => {
|
||||
startTask.addDueDate('invalid date')
|
||||
.blur(startTask.dueDate)
|
||||
.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);
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -53,7 +53,7 @@ describe('Task Header cloud component', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
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.loginAPS(user, password);
|
||||
|
||||
|
@@ -42,7 +42,7 @@ describe('Task filters cloud', () => {
|
||||
|
||||
beforeAll(() => {
|
||||
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.loginAPS(user, password);
|
||||
});
|
||||
|
@@ -57,7 +57,7 @@ describe('Task filters cloud', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
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.loginAPS(user, password);
|
||||
|
||||
|
Reference in New Issue
Block a user