mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fix e2e test (#4981)
* fix core viewer * increase rendition retry * sso refresh before test * general fix test * try use last proxy * avoid use proxy * remove proxy * fix setting tests * fix share and sso test * fix lint exclude * fix sso * fix some process services cloud e2e * fix sso download * exclude sso test * fix cloud * add logout content service test * add logout core * add logout search * redefine global before all * separate protracotr method * try * try multiple attempt before all * add prefix group and users * add prefix group and users * add prefix group and users * rexecute sso test * fix process service visibility e2e * split SSO login test * fix SSO download * fix SSO download * fix some cloud issues * fix some cloud issues * fix some cloud issues * share file fix cs * fix cloud test
This commit is contained in:
@@ -67,7 +67,7 @@ export class DocumentListPage {
|
||||
clickOnActionMenu(content) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const row = this.dataTable.getRow('Display name', content);
|
||||
row.element(this.optionButton).click();
|
||||
BrowserActions.click(row.element(this.optionButton));
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.actionMenu);
|
||||
browser.sleep(500);
|
||||
return this;
|
||||
|
@@ -17,6 +17,9 @@
|
||||
|
||||
import { ApiService } from '../api.service';
|
||||
import { StringUtil } from '../../utils/string.util';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
const GROUP_SUFFIX = browser.params.testConfig ? browser.params.testConfig.projectName : 'TestGroup';
|
||||
|
||||
export class GroupIdentityService {
|
||||
|
||||
@@ -40,7 +43,7 @@ export class GroupIdentityService {
|
||||
const path = '/groups';
|
||||
const method = 'POST';
|
||||
const queryParams = {}, postBody = {
|
||||
'name': groupName + 'TestGroup'
|
||||
'name': groupName + GROUP_SUFFIX
|
||||
};
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
@@ -49,8 +52,7 @@ export class GroupIdentityService {
|
||||
async deleteGroup(groupId) {
|
||||
const path = `/groups/${groupId}`;
|
||||
const method = 'DELETE';
|
||||
const queryParams = {}, postBody = {
|
||||
};
|
||||
const queryParams = {}, postBody = {};
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
}
|
||||
@@ -58,7 +60,7 @@ export class GroupIdentityService {
|
||||
async getGroupInfoByGroupName(groupName) {
|
||||
const path = `/groups`;
|
||||
const method = 'GET';
|
||||
const queryParams = { 'search' : groupName }, postBody = {};
|
||||
const queryParams = { 'search': groupName }, postBody = {};
|
||||
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data[0];
|
||||
@@ -68,7 +70,7 @@ export class GroupIdentityService {
|
||||
const path = `/groups/${groupId}/role-mappings/realm`;
|
||||
const method = 'POST';
|
||||
const queryParams = {},
|
||||
postBody = [{'id': roleId, 'name': roleName}];
|
||||
postBody = [{ 'id': roleId, 'name': roleName }];
|
||||
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
@@ -102,7 +104,7 @@ export class GroupIdentityService {
|
||||
*/
|
||||
async getClientIdByApplicationName(applicationName: string) {
|
||||
const path = `/clients`;
|
||||
const method = 'GET', queryParams = {clientId: applicationName}, postBody = {};
|
||||
const method = 'GET', queryParams = { clientId: applicationName }, postBody = {};
|
||||
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data[0].id;
|
||||
|
@@ -16,13 +16,16 @@
|
||||
*/
|
||||
|
||||
import { StringUtil } from '../utils/string.util';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
const EMAIL_DOMAIN = browser.params.testConfig ? browser.params.testConfig.projectName : 'alfresco';
|
||||
|
||||
export class UserModel {
|
||||
|
||||
firstName: string = StringUtil.generateRandomString();
|
||||
lastName: string = StringUtil.generateRandomString();
|
||||
password: string = StringUtil.generateRandomString();
|
||||
email: string = StringUtil.generateRandomEmail('@alfresco.com');
|
||||
email: string = StringUtil.generateRandomEmail(`@${EMAIL_DOMAIN}.com`);
|
||||
username: string = StringUtil.generateRandomString().toLowerCase();
|
||||
idIdentityService: string;
|
||||
|
||||
|
@@ -51,11 +51,6 @@ export class DateWidget {
|
||||
return dateInput.clear();
|
||||
}
|
||||
|
||||
clickOutsideWidget(fieldId) {
|
||||
const form = this.formFields.getWidget(fieldId);
|
||||
BrowserActions.click(form);
|
||||
}
|
||||
|
||||
getErrorMessage(fieldId) {
|
||||
const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`));
|
||||
return BrowserActions.getText(errorMessage);
|
||||
|
@@ -28,37 +28,38 @@ export class LoginSSOPage {
|
||||
header = element(by.id('adf-header'));
|
||||
loginError = element(by.css(`div[data-automation-id="login-error"]`));
|
||||
|
||||
loginSSOIdentityService(username, password) {
|
||||
async loginSSOIdentityService(username, password) {
|
||||
browser.ignoreSynchronization = true;
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.usernameField);
|
||||
this.enterUsername(username);
|
||||
this.enterPassword(password);
|
||||
this.clickLoginButton();
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.header);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.usernameField);
|
||||
await this.enterUsername(username);
|
||||
await this.enterPassword(password);
|
||||
await this.clickLoginButton();
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.header);
|
||||
await browser.waitForAngular('');
|
||||
}
|
||||
|
||||
clickOnSSOButton() {
|
||||
return BrowserActions.clickExecuteScript('[data-automation-id="login-button-sso"]');
|
||||
async clickOnSSOButton() {
|
||||
await BrowserActions.clickExecuteScript('[data-automation-id="login-button-sso"]');
|
||||
}
|
||||
|
||||
enterUsername(username) {
|
||||
BrowserActions.clearSendKeys(this.usernameField, username);
|
||||
async enterUsername(username) {
|
||||
await BrowserActions.clearSendKeys(this.usernameField, username);
|
||||
}
|
||||
|
||||
enterPassword(password) {
|
||||
BrowserActions.clearSendKeys(this.passwordField, password);
|
||||
async enterPassword(password) {
|
||||
await BrowserActions.clearSendKeys(this.passwordField, password);
|
||||
}
|
||||
|
||||
clickLoginButton() {
|
||||
return BrowserActions.click(this.loginButton);
|
||||
async clickLoginButton() {
|
||||
await BrowserActions.click(this.loginButton);
|
||||
}
|
||||
|
||||
checkLoginErrorIsDisplayed() {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.loginError);
|
||||
async checkLoginErrorIsDisplayed() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.loginError);
|
||||
}
|
||||
|
||||
getLoginErrorMessage() {
|
||||
async getLoginErrorMessage() {
|
||||
return BrowserActions.getText(this.loginError);
|
||||
}
|
||||
|
||||
|
@@ -88,11 +88,11 @@ export class LoginPage {
|
||||
}
|
||||
|
||||
enterUsername(username) {
|
||||
BrowserActions.clearSendKeys(this.txtUsername, username);
|
||||
return BrowserActions.clearSendKeys(this.txtUsername, username);
|
||||
}
|
||||
|
||||
enterPassword(password) {
|
||||
BrowserActions.clearSendKeys(this.txtPassword, password);
|
||||
return BrowserActions.clearSendKeys(this.txtPassword, password);
|
||||
}
|
||||
|
||||
async clearUsername() {
|
||||
|
@@ -149,7 +149,7 @@ export class SettingsPage {
|
||||
this.setSilentLogin(silentLogin);
|
||||
this.setImplicitFlow(implicitFlow);
|
||||
this.setLogoutUrl(logoutUr);
|
||||
this.clickApply();
|
||||
await this.clickApply();
|
||||
await browser.sleep(1000);
|
||||
}
|
||||
|
||||
|
@@ -30,8 +30,8 @@ export class EditTaskFilterCloudComponentPage {
|
||||
id = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-taskId"]'));
|
||||
processDefinitionId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processDefinitionId"]'));
|
||||
processInstanceId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processInstanceId"]'));
|
||||
lastModifiedFrom = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-lastModifiedFrom"]'));
|
||||
lastModifiedTo = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-lastModifiedTo"]'));
|
||||
lastModifiedFrom = element(by.css('input[placeholder="LastModifiedFrom"]'));
|
||||
lastModifiedTo = element(by.css('input[placeholder="LastModifiedTo"]'));
|
||||
parentTaskId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-parentTaskId"]'));
|
||||
owner = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-owner"]'));
|
||||
saveButton = element(by.css('[data-automation-id="adf-filter-action-save"]'));
|
||||
@@ -58,7 +58,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getStatusFilterDropDownValue() {
|
||||
return element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-status'] span")).first().getText();
|
||||
return BrowserActions.getText(element(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-status'] span span")));
|
||||
}
|
||||
|
||||
setSortFilterDropDown(option) {
|
||||
@@ -70,8 +70,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getSortFilterDropDownValue() {
|
||||
const elementSort = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-sort'] span")).first();
|
||||
return BrowserActions.getText(elementSort);
|
||||
return BrowserActions.getText(element(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-sort'] span span")));
|
||||
}
|
||||
|
||||
setOrderFilterDropDown(option) {
|
||||
@@ -84,13 +83,12 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getOrderFilterDropDownValue() {
|
||||
return element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-order'] span")).first().getText();
|
||||
return BrowserActions.getText(element(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-order'] span span")));
|
||||
}
|
||||
|
||||
clickOnDropDownArrow(option) {
|
||||
const dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']")).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(dropDownArrow);
|
||||
dropDownArrow.click();
|
||||
BrowserActions.click(dropDownArrow);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectedOption);
|
||||
}
|
||||
|
||||
@@ -126,18 +124,18 @@ export class EditTaskFilterCloudComponentPage {
|
||||
return BrowserActions.getText(this.owner);
|
||||
}
|
||||
|
||||
setLastModifiedFrom(option) {
|
||||
setLastModifiedFrom(lastModifiedFromDate) {
|
||||
this.clearField(this.lastModifiedFrom);
|
||||
return this.setProperty('lastModifiedFrom', option);
|
||||
BrowserActions.clearSendKeys(this.lastModifiedFrom, lastModifiedFromDate);
|
||||
}
|
||||
|
||||
getLastModifiedFrom() {
|
||||
return BrowserActions.getText(this.lastModifiedFrom);
|
||||
}
|
||||
|
||||
setLastModifiedTo(option) {
|
||||
setLastModifiedTo(lastModifiedToDate) {
|
||||
this.clearField(this.lastModifiedTo);
|
||||
return this.setProperty('lastModifiedTo', option);
|
||||
BrowserActions.clearSendKeys(this.lastModifiedTo, lastModifiedToDate);
|
||||
}
|
||||
|
||||
getLastModifiedTo() {
|
||||
@@ -210,8 +208,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getAppNameDropDownValue() {
|
||||
const locator = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-appName'] span")).first();
|
||||
return BrowserActions.getText(locator);
|
||||
return BrowserActions.getText(element(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-appName'] span span")));
|
||||
}
|
||||
|
||||
setId(option) {
|
||||
|
Reference in New Issue
Block a user