mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3962] sso download directive automated (#4452)
* sso download directive automated * temp changes * temp changes * moving of services under lib testing and ADF-3962 automated * removed the browser sleep * cspell and linting fixes. * codacy improvements * export public-api update * remove circular dep * remove circular dep * fixes * fix user info test * fix datatable * random commit * move other string * fix lint * fix lint * fix prolem type * fix failing test * fix tag test * fix problems after rebase * fix lint * remove space * remove visibility method duplicated
This commit is contained in:
committed by
Eugenio Romano
parent
89f612bbb0
commit
4376d357ac
@@ -23,7 +23,7 @@ import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import { CardViewComponentPage } from '../../pages/adf/cardViewComponentPage';
|
||||
import { Util } from '../../util/util';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
describe('CardView Component', () => {
|
||||
const loginPage = new LoginPage();
|
||||
@@ -47,7 +47,7 @@ describe('CardView Component', () => {
|
||||
it('[C279938] Should the label be present', () => {
|
||||
const label = element(by.css('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279898] Should be possible edit key-value pair properties', () => {
|
||||
@@ -69,7 +69,7 @@ describe('CardView Component', () => {
|
||||
it('[C279939] Should the label be present', () => {
|
||||
const label = element(by.css('div[data-automation-id="card-select-label-select"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279899] Should be possible edit selectBox item', () => {
|
||||
@@ -86,7 +86,7 @@ describe('CardView Component', () => {
|
||||
it('[C279937] Should the label be present', () => {
|
||||
const label = element(by.css('div[data-automation-id="card-textitem-label-name"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279943] Should be present a default value', () => {
|
||||
@@ -117,7 +117,7 @@ describe('CardView Component', () => {
|
||||
it('[C279940] Should the label be present', () => {
|
||||
const label = element(by.css('div[data-automation-id="card-textitem-label-int"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279945] Should be present a default value', () => {
|
||||
@@ -191,7 +191,7 @@ describe('CardView Component', () => {
|
||||
it('[C279941] Should the label be present', () => {
|
||||
const label = element(by.css('div[data-automation-id="card-textitem-label-float"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279952] Should be present a default value', () => {
|
||||
@@ -241,7 +241,7 @@ describe('CardView Component', () => {
|
||||
it('[C279942] Should the label be present', () => {
|
||||
const label = element(by.css('div[data-automation-id="card-boolean-label-boolean"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279957] Should be possible edit the checkbox value when click on it', () => {
|
||||
@@ -260,11 +260,11 @@ describe('CardView Component', () => {
|
||||
it('[C279961] Should the label be present', () => {
|
||||
const labelDate = element(by.css('div[data-automation-id="card-dateitem-label-date"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(labelDate);
|
||||
BrowserVisibility.waitUntilElementIsPresent(labelDate);
|
||||
|
||||
const labelDatetime = element(by.css('div[data-automation-id="card-dateitem-label-datetime"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(labelDatetime);
|
||||
BrowserVisibility.waitUntilElementIsPresent(labelDatetime);
|
||||
});
|
||||
|
||||
it('[C279962] Should be present a default value', () => {
|
||||
@@ -283,10 +283,10 @@ describe('CardView Component', () => {
|
||||
const editIconKey = element(by.css('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]'));
|
||||
const editIconData = element(by.css('mat-datetimepicker-toggle'));
|
||||
|
||||
Util.waitUntilElementIsNotVisible(editIconText);
|
||||
Util.waitUntilElementIsNotVisible(editIconInt);
|
||||
Util.waitUntilElementIsNotVisible(editIconFloat);
|
||||
Util.waitUntilElementIsNotVisible(editIconKey);
|
||||
Util.waitUntilElementIsNotVisible(editIconData);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(editIconText);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(editIconInt);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(editIconFloat);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(editIconKey);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(editIconData);
|
||||
});
|
||||
});
|
||||
|
@@ -29,7 +29,7 @@ import resources = require('../../util/resources');
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
||||
import { Util } from '../../util/util';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('permissions', () => {
|
||||
@@ -78,7 +78,7 @@ describe('permissions', () => {
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(contributorUser);
|
||||
|
||||
site = await this.alfrescoJsApi.core.sitesApi.createSite({
|
||||
title: Util.generateRandomString(),
|
||||
title: StringUtil.generateRandomString(),
|
||||
visibility: 'PUBLIC'
|
||||
});
|
||||
|
||||
|
@@ -20,7 +20,7 @@ import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import TestConfig = require('../test.config');
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { ErrorPage } from '../pages/adf/errorPage';
|
||||
import { browser } from '../../node_modules/protractor';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Error Component', () => {
|
||||
|
||||
|
@@ -259,7 +259,7 @@ describe('Login component', () => {
|
||||
settingsPage.setProviderEcmBpm();
|
||||
loginPage.enableLogoSwitch();
|
||||
loginPage.enterLogo('https://rawgit.com/Alfresco/alfresco-ng2-components/master/assets/angular2.png');
|
||||
loginPage.checkLoginImgURL('https://rawgit.com/Alfresco/alfresco-ng2-components/master/assets/angular2.png');
|
||||
loginPage.checkLoginImgURL();
|
||||
});
|
||||
|
||||
it('[C291854] Should be possible login in valid credentials', () => {
|
||||
|
@@ -29,7 +29,7 @@ import { SettingsPage } from '../../pages/adf/settingsPage';
|
||||
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
|
||||
import { Util } from '../../util/util';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { LogoutPage } from '../../pages/adf/demo-shell/logoutPage';
|
||||
|
||||
@@ -64,7 +64,7 @@ describe('Login component - Redirect', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(user.id, user.password);
|
||||
|
||||
uploadedFolder = await uploadActions.createFolder(this.alfrescoJsApi, 'protecteFolder' + Util.generateRandomString(), '-my-');
|
||||
uploadedFolder = await uploadActions.createFolder(this.alfrescoJsApi, 'protecteFolder' + StringUtil.generateRandomString(), '-my-');
|
||||
|
||||
done();
|
||||
});
|
||||
|
@@ -18,10 +18,9 @@
|
||||
import { LoginSSOPage } from '@alfresco/adf-testing';
|
||||
import { SettingsPage } from '../pages/adf/settingsPage';
|
||||
import TestConfig = require('../test.config');
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import { UserInfoPage } from '@alfresco/adf-testing';
|
||||
import { Identity } from '../actions/APS-cloud/identity';
|
||||
import { IdentityService, ApiService } from '@alfresco/adf-testing';
|
||||
|
||||
describe('User Info - SSO', () => {
|
||||
|
||||
@@ -29,21 +28,25 @@ describe('User Info - SSO', () => {
|
||||
const loginSSOPage = new LoginSSOPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const userInfoPage = new UserInfoPage();
|
||||
const identityService: Identity = new Identity();
|
||||
let silentLogin, identityUser;
|
||||
let identityService: IdentityService;
|
||||
|
||||
beforeAll(async () => {
|
||||
await identityService.init(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword, 'alfresco');
|
||||
const apiService = new ApiService('alfresco', TestConfig.adf.url, TestConfig.adf.hostSso, 'ECM');
|
||||
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
identityService = new IdentityService(apiService);
|
||||
identityUser = await identityService.createIdentityUser();
|
||||
|
||||
silentLogin = false;
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin, true, 'alfresco');
|
||||
loginSSOPage.clickOnSSOButton();
|
||||
browser.ignoreSynchronization = true;
|
||||
loginSSOPage.loginSSOIdentityService(identityUser.username, identityUser.password);
|
||||
|
||||
loginSSOPage.loginSSOIdentityService(identityUser.email, identityUser.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await identityService.deleteIdentityUser(identityUser.id);
|
||||
await identityService.deleteIdentityUser(identityUser.idIdentityService);
|
||||
});
|
||||
|
||||
it('[C290066] Should display UserInfo when login using SSO', () => {
|
||||
|
@@ -81,7 +81,7 @@ describe('User Info component', () => {
|
||||
expect(userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
|
||||
expect(userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
|
||||
expect(userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
|
||||
expect(userInfoPage.getContentJobTitle()).toEqual(contentUserModel.jobTitle);
|
||||
expect(userInfoPage.getContentJobTitle()).toEqual('N/A');
|
||||
|
||||
userInfoPage.checkInitialImage();
|
||||
userInfoPage.APSProfileImageNotDisplayed();
|
||||
@@ -91,7 +91,7 @@ describe('User Info component', () => {
|
||||
expect(userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
|
||||
expect(userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
|
||||
expect(userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
|
||||
expect(userInfoPage.getContentJobTitle()).toEqual(contentUserModel.jobTitle);
|
||||
expect(userInfoPage.getContentJobTitle()).toEqual('N/A');
|
||||
|
||||
userInfoPage.checkInitialImage();
|
||||
userInfoPage.APSProfileImageNotDisplayed();
|
||||
@@ -99,9 +99,9 @@ describe('User Info component', () => {
|
||||
userInfoPage.clickOnProcessServicesTab();
|
||||
userInfoPage.checkProcessServicesTabIsSelected();
|
||||
|
||||
expect(userInfoPage.getProcessHeaderTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
|
||||
expect(userInfoPage.getProcessTitle()).toEqual(processUserModel.firstName + ' ' + processUserModel.lastName);
|
||||
expect(userInfoPage.getProcessEmail()).toEqual(processUserModel.email);
|
||||
expect(userInfoPage.getProcessHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
|
||||
expect(userInfoPage.getProcessTitle()).toEqual(contentUserModel.firstName + ' ' + processUserModel.lastName);
|
||||
expect(userInfoPage.getProcessEmail()).toEqual(contentUserModel.email);
|
||||
|
||||
userInfoPage.checkInitialImage();
|
||||
userInfoPage.APSProfileImageNotDisplayed();
|
||||
@@ -120,7 +120,7 @@ describe('User Info component', () => {
|
||||
expect(userInfoPage.getContentHeaderTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
|
||||
expect(userInfoPage.getContentTitle()).toEqual(contentUserModel.firstName + ' ' + contentUserModel.lastName);
|
||||
expect(userInfoPage.getContentEmail()).toEqual(contentUserModel.email);
|
||||
expect(userInfoPage.getContentJobTitle()).toEqual(contentUserModel.jobTitle);
|
||||
expect(userInfoPage.getContentJobTitle()).toEqual('N/A');
|
||||
|
||||
userInfoPage.checkInitialImage();
|
||||
userInfoPage.APSProfileImageNotDisplayed();
|
||||
@@ -150,7 +150,7 @@ describe('User Info component', () => {
|
||||
it('[C260117] Should display UserInfo with profile image uploaded in ACS', async(done) => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
await PeopleAPI.updateAvatarViaAPI(contentUserModel, acsAvatarFileModel, '-me-');
|
||||
await PeopleAPI.getAvatarViaAPI(4, contentUserModel, '-me-', function (result) {});
|
||||
await PeopleAPI.getAvatarViaAPI(4, contentUserModel, '-me-', function () {});
|
||||
});
|
||||
|
||||
loginPage.goToLoginPage();
|
||||
|
@@ -26,7 +26,7 @@ import { AboutPage } from '../../pages/adf/demo-shell/aboutPage';
|
||||
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import resources = require('../../util/resources');
|
||||
import { Util } from '../../util/util';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
|
||||
import { FileModel } from '../../models/ACS/fileModel';
|
||||
import { FolderModel } from '../../models/ACS/folderModel';
|
||||
@@ -106,7 +106,7 @@ xdescribe('Viewer', () => {
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
site = await this.alfrescoJsApi.core.sitesApi.createSite({
|
||||
title: Util.generateRandomString(8),
|
||||
title: StringUtil.generateRandomString(8),
|
||||
visibility: 'PUBLIC'
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user