Remove demo shell test and make cloud a bit more stable (#6781)

* remove demo shell test and make cloud a bit more stable

* fix lint

* Update restore-content-directive.e2e.ts

* Update restore-content-directive.e2e.ts

* Update restore-content-directive.e2e.ts

* try fix attach

* Update .travis.yml

* sleep...

* remove about e2e demo shell....

* fix

* lint fix

* configure

* refactor buuild

* names and remove demo shell build from libs

* fix new build approach

* fix

* fix

* .

* uncomment

* .

* .

* fix

* fix

* .

* fix

* lock update

* fix demo shell errors

* use replay subject

* fix some console log error

* suffix problem

* split process e2e

* not need to check everywhere the pagination e2e

* split content

* fix

* fix

* fix

* fix

* reorg

# Conflicts:
#	.travis.yml
This commit is contained in:
Eugenio Romano
2021-03-17 15:17:46 +00:00
committed by GitHub
parent 90aabe3541
commit cd915b307b
115 changed files with 659 additions and 1117 deletions

View File

@@ -1,58 +0,0 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AboutPage, ApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
describe('About Content Services', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const aboutPage = new AboutPage();
let acsUser: UserModel;
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
beforeAll(async() => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.clickAboutButton();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C280002] Should be able to view about content services info', async () => {
await aboutPage.checkAppTitleIsDisplayed();
await aboutPage.checkSourceCodeTitleIsDisplayed();
await aboutPage.checkGithubUrlIsDisplayed();
await aboutPage.checkGithubVersionIsDisplayed();
await aboutPage.checkEcmHostIsDisplayed();
await aboutPage.checkEcmEditionIsDisplayed();
await aboutPage.checkEcmVersionIsDisplayed();
await aboutPage.checkAboutListIsLoaded();
await aboutPage.checkPackageColumnsIsDisplayed();
await aboutPage.checkEcmStatusTitleIsDisplayed();
await aboutPage.checkStatusColumnsIsDisplayed();
await aboutPage.checkEcmLicenseTitleIsDisplayed();
await aboutPage.checkLicenseColumnsIsDisplayed();
await aboutPage.checkEcmModulesTitleIsDisplayed();
await aboutPage.checkModulesColumnsIsDisplayed();
});
});

View File

@@ -24,13 +24,13 @@ import {
UsersActions,
WaitActions
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
import { ContentServicesPage } from '../core/pages/content-services.page';
import { LockFilePage } from '../content-services/pages/lock-file.page';
import { FileModel } from '../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { LockFilePage } from '../../content-services/pages/lock-file.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import { NodeEntry } from '@alfresco/js-api';
import CONSTANTS = require('../util/constants');
import CONSTANTS = require('../../util/constants');
describe('Lock File', () => {

View File

@@ -15,10 +15,10 @@
* limitations under the License.
*/
import { FileModel } from '../models/ACS/file.model';
import { FileModel } from '../../models/ACS/file.model';
import { ApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
import { TagPage } from '../content-services/pages/tag.page';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
import { TagPage } from '../../content-services/pages/tag.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { browser } from 'protractor';
describe('Tag component', () => {

View File

@@ -16,8 +16,8 @@
*/
import { ApiService, LoginPage, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
import { TreeViewPage } from './pages/tree-view.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TreeViewPage } from './../pages/tree-view.page';
describe('Tree View Component', () => {

View File

@@ -66,8 +66,7 @@ describe('Restore content directive', () => {
let testFolder: NodeEntry;
const uploadActions = new UploadActions(apiService);
let folderWithContent, folderWithFolder, subFolder, subFile, testFile, restoreFile, publicSite, siteFolder,
siteFile;
let folderWithContent, folderWithFolder, subFolder, subFile, testFile;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
@@ -81,7 +80,6 @@ describe('Restore content directive', () => {
testFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
folderWithFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
subFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), folderWithFolder.entry.id);
restoreFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
});
afterAll(async () => {
@@ -223,81 +221,6 @@ describe('Restore content directive', () => {
await contentServicesPage.openFolder(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
});
it('[C260241] Should display restore icon both for file and folder', async () => {
await contentServicesPage.checkContentIsDisplayed(testFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(restoreFile.entry.name);
await contentServicesPage.deleteContent(testFolder.entry.name);
await contentServicesPage.deleteContent(restoreFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.checkRestoreButtonIsNotDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(testFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFolder.entry.name);
await trashcanPage.checkRestoreButtonIsDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(testFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsNotSelected(testFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(restoreFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
await trashcanPage.checkRestoreButtonIsDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(testFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
await trashcanPage.checkRestoreButtonIsDisplayed();
});
});
describe('Restore deleted library', () => {
beforeAll(async () => {
await apiService.login(acsUser.username, acsUser.password);
const publicSiteName = `public-${StringUtil.generateRandomString(5)}`;
const publicSiteBody = { visibility: 'PUBLIC', title: publicSiteName };
publicSite = await apiService.getInstance().core.sitesApi.createSite(publicSiteBody);
siteFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), publicSite.entry.guid);
siteFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, siteFolder.entry.id);
await apiService.getInstance().core.sitesApi.deleteSite(publicSite.entry.id);
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async () => {
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
afterAll(async () => {
try {
await apiService.loginWithProfile('admin');
await apiService.getInstance().core.sitesApi.deleteSite(publicSite.entry.id, { permanent: true });
} catch (error) {
}
});
it('[C260241] Should restore the deleted library along with contents inside', async () => {
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(publicSite.entry.id);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(publicSite.entry.id);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(publicSite.entry.id);
await trashcanPage.clickRestore();
await waitActions.nodeIsPresent(publicSite.entry.guid);
await navigationBarPage.goToSite(publicSite);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(siteFolder.entry.name);
await contentServicesPage.openFolder(siteFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(siteFile.entry.name);
await notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored');
});
});
describe('Restore with folder hierarchies', () => {

View File

@@ -1,135 +0,0 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
ApiService,
LoginPage,
PaginationPage,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { FolderModel } from '../models/ACS/folder.model';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
import { TrashcanPage } from '../core/pages/trashcan.page';
describe('Trashcan - Pagination', () => {
const pagination = {
base: 'newFile',
extension: '.txt'
};
const itemsPerPage = {
five: '5',
fiveValue: 5,
ten: '10',
tenValue: 10,
fifteen: '15',
fifteenValue: 15,
twenty: '20',
twentyValue: 20,
default: '25'
};
const loginPage = new LoginPage();
const trashcanPage = new TrashcanPage();
const paginationPage = new PaginationPage();
const navigationBarPage = new NavigationBarPage();
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
let acsUser: UserModel;
const newFolderModel = new FolderModel({ name: 'newFolder' });
const noOfFiles = 20;
beforeAll(async () => {
const uploadActions = new UploadActions(apiService);
const fileNames = StringUtil.generateFilesNames(10, noOfFiles + 9, pagination.base, pagination.extension);
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
const folderUploadedModel = await uploadActions.createFolder(newFolderModel.name, '-my-');
const emptyFiles: any = await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id);
for (const entry of emptyFiles.list.entries) {
await apiService.getInstance().node.deleteNode(entry.entry.id).then(() => {}, async () => {
await apiService.getInstance().node.deleteNode(entry.entry.id);
});
}
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(async () => {
await browser.refresh();
await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C272811] Should be able to set Items per page to 20', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + noOfFiles + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(noOfFiles);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276742] Should be able to set Items per page to 15', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276743] Should be able to set Items per page to 10', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276744] Should be able to set Items per page to 5', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
})
;