mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-259] refactor login page (#5733)
* refator login page * refator login page * remove obsolete classes and move what is needed in the test pck * fix const * revert modify * remove duplicate browser property * fix build * fix * fix * fix lint * move drop action in testing remove not necessary space js-api centralize content * first refactor use js-api * fix protractor * refactor test config * simplify properties fix namings * ps cloud simplify remove unused js files * id fix * fix search test simplify environment var step 1 * fix lint * first user iteration fix * fix model * unify use of apiService * first step automatic user creation Identity * refactor creation user content-services * refactor creation user search * refactor creation user core * process service refactoring 1 * process service refactoring 1 * process service refactoring 2 * fix process * appconfig * fix process util * fix gallery * fix "this" reference issues * fix incorrect import paths * fix core * some fixes * allign * fix some test remove structure folder and move in actions * fixes * move folders in the right place * fix * fix rebase * solve build issue * fix e2e * change init aae * order api and some fixes * fix possible not valid password * fix some ps test * replace host port also in objects * Update app-config.service.ts * fix process * fix process test * process service cloud fix * fiexs * modify init script * fix two test * remove unused property * host issue * not use npx * fix ps cloud test Co-authored-by: Denys Vuika <denys.vuika@gmail.com>
This commit is contained in:
co-authored by
Denys Vuika
parent
f0df6b3a5f
commit
a78f24ada1
@@ -16,24 +16,23 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { StringUtil, LoginPage, NotificationHistoryPage } from '@alfresco/adf-testing';
|
||||
import { StringUtil, LoginSSOPage, NotificationHistoryPage, ApiService } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../pages/adf/content-services.page';
|
||||
import { UploadDialogPage } from '../../pages/adf/dialog/upload-dialog.page';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
|
||||
import { AcsUserModel } from '../../models/ACS/acs-user.model';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
|
||||
describe('Upload - User permission', () => {
|
||||
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const uploadDialog = new UploadDialogPage();
|
||||
const loginPage = new LoginPage();
|
||||
let acsUser;
|
||||
let acsUserTwo;
|
||||
const loginPage = new LoginSSOPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const emptyFile = new FileModel({
|
||||
'name': browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
|
||||
@@ -50,49 +49,42 @@ describe('Upload - User permission', () => {
|
||||
'location': browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_location
|
||||
});
|
||||
|
||||
let acsUser, acsUserTwo, consumerSite, managerSite;
|
||||
|
||||
beforeAll(async () => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf_acs.host
|
||||
});
|
||||
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
|
||||
|
||||
acsUser = await usersActions.createUser(acsUser);
|
||||
acsUserTwo = await usersActions.createUser(acsUserTwo);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
acsUser = new AcsUserModel();
|
||||
acsUserTwo = new AcsUserModel();
|
||||
await loginPage.login(acsUser.email, acsUser.password);
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUserTwo);
|
||||
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
this.consumerSite = await this.alfrescoJsApi.core.sitesApi.createSite({
|
||||
consumerSite = await apiService.getInstance().core.sitesApi.createSite({
|
||||
title: StringUtil.generateRandomString(),
|
||||
visibility: 'PUBLIC'
|
||||
});
|
||||
|
||||
this.managerSite = await this.alfrescoJsApi.core.sitesApi.createSite({
|
||||
managerSite = await apiService.getInstance().core.sitesApi.createSite({
|
||||
title: StringUtil.generateRandomString(),
|
||||
visibility: 'PUBLIC'
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(this.consumerSite.entry.id, {
|
||||
id: acsUser.id,
|
||||
await apiService.getInstance().core.sitesApi.addSiteMember(consumerSite.entry.id, {
|
||||
id: acsUser.email,
|
||||
role: CONSTANTS.CS_USER_ROLES.CONSUMER
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(this.managerSite.entry.id, {
|
||||
id: acsUser.id,
|
||||
await apiService.getInstance().core.sitesApi.addSiteMember(managerSite.entry.id, {
|
||||
id: acsUser.email,
|
||||
role: CONSTANTS.CS_USER_ROLES.MANAGER
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await this.alfrescoJsApi.core.sitesApi.deleteSite(this.managerSite.entry.id, { permanent: true });
|
||||
await this.alfrescoJsApi.core.sitesApi.deleteSite(this.consumerSite.entry.id, { permanent: true });
|
||||
await apiService.getInstance().core.sitesApi.deleteSite(managerSite.entry.id, { permanent: true });
|
||||
await apiService.getInstance().core.sitesApi.deleteSite(consumerSite.entry.id, { permanent: true });
|
||||
});
|
||||
|
||||
describe('Consumer permissions', () => {
|
||||
@@ -102,14 +94,13 @@ describe('Upload - User permission', () => {
|
||||
});
|
||||
|
||||
it('[C291921] Should display tooltip for uploading files without permissions', async () => {
|
||||
await navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
|
||||
await navigationBarPage.openContentServicesFolder(consumerSite.entry.guid);
|
||||
|
||||
await contentServicesPage.checkDragAndDropDIsDisplayed();
|
||||
|
||||
await contentServicesPage.dragAndDropFile(emptyFile.location);
|
||||
|
||||
await uploadDialog.fileIsError(emptyFile.name);
|
||||
|
||||
await uploadDialog.displayTooltip();
|
||||
|
||||
await expect(await uploadDialog.getTooltip()).toEqual('Insufficient permissions to upload in this location [403]');
|
||||
@@ -124,7 +115,7 @@ describe('Upload - User permission', () => {
|
||||
await uploadDialog.clickOnCloseButton();
|
||||
await uploadDialog.dialogIsNotDisplayed();
|
||||
|
||||
await navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
|
||||
await navigationBarPage.openContentServicesFolder(consumerSite.entry.guid);
|
||||
|
||||
await browser.sleep(3000);
|
||||
|
||||
@@ -135,9 +126,8 @@ describe('Upload - User permission', () => {
|
||||
});
|
||||
|
||||
describe('full permissions', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.openContentServicesFolder(this.managerSite.entry.guid);
|
||||
await navigationBarPage.openContentServicesFolder(managerSite.entry.guid);
|
||||
|
||||
await contentServicesPage.goToDocumentList();
|
||||
});
|
||||
@@ -150,7 +140,6 @@ describe('Upload - User permission', () => {
|
||||
});
|
||||
|
||||
describe('multiple users', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await contentServicesPage.goToDocumentList();
|
||||
});
|
||||
@@ -163,7 +152,7 @@ describe('Upload - User permission', () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
|
||||
|
||||
await navigationBarPage.clickLoginButton();
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUserTwo);
|
||||
await loginPage.login(acsUserTwo.email, acsUserTwo.password);
|
||||
await contentServicesPage.goToDocumentList();
|
||||
|
||||
await contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
|
||||
@@ -173,7 +162,7 @@ describe('Upload - User permission', () => {
|
||||
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
|
||||
|
||||
await navigationBarPage.clickLoginButton();
|
||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
await loginPage.login(acsUser.email, acsUser.password);
|
||||
await contentServicesPage.goToDocumentList();
|
||||
|
||||
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
|
||||
|
||||
Reference in New Issue
Block a user