mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACS-5343] refactor Playwright framework in ACA (#3261)
* [ACS-5343] refactor Playwright framework in ACA * Add the tests for Actions, from the Adam PR [ACS-5328] * Small fixes * Improve logs * [ACS-5343] adding-goThroughPages-and-delete * [ACS-5343] added git changes * [ACS-5343] added git changes for playwright * [ACS-5343] fix for e2e * [ACS-5343] e2e protractor path fix * remove import * [ACS-5343] e2e playwright user fix * [ACS-5343] e2e playwright user ids fix * [ACS-5343] e2e playwright users ids fix * changes for git * fix playwright test run * tsconfig path fix * playwright action yml added * retrigger checks * add test id from testrail * merge conflits * fix gha * fix credentials --------- Co-authored-by: adam.zakrzewski <adam.zakrzewski@hyland.com> Co-authored-by: akash.rathod@hyland.com <akash.rathod@hyland.com> Co-authored-by: Denys Vuika <denys.vuika@gmail.com>
This commit is contained in:
141
e2e/protractor/suites/list-views/shared-files.test.ts
Executable file
141
e2e/protractor/suites/list-views/shared-files.test.ts
Executable file
@@ -0,0 +1,141 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Shared Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileAdmin = `fileSite-${Utils.random()}.txt`;
|
||||
|
||||
const folderUser = `folder-${Utils.random()}`;
|
||||
let folderId: string;
|
||||
const file1User = `file1-${Utils.random()}.txt`;
|
||||
let file1Id: string;
|
||||
const file2User = `file2-${Utils.random()}.txt`;
|
||||
let file2Id: string;
|
||||
const file3User = `file3-${Utils.random()}.txt`;
|
||||
let file3Id: string;
|
||||
const file4User = `file4-${Utils.random()}.txt`;
|
||||
let file4Id: string;
|
||||
|
||||
const apis = {
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.createUser({ username });
|
||||
await adminApiActions.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(siteName);
|
||||
const nodeId = (await adminApiActions.nodes.createFile(fileAdmin, docLibId)).entry.id;
|
||||
|
||||
await adminApiActions.shareNodes([nodeId]);
|
||||
await adminApiActions.shared.waitForFilesToBeShared([nodeId]);
|
||||
|
||||
folderId = (await apis.user.nodes.createFolder(folderUser)).entry.id;
|
||||
file1Id = (await apis.user.nodes.createFile(file1User, folderId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2User)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3User)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4User)).entry.id;
|
||||
|
||||
await apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id]);
|
||||
await apis.user.shared.waitForFilesToBeShared([file1Id, file2Id, file3Id, file4Id]);
|
||||
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
await apis.user.shared.unshareFileById(file3Id);
|
||||
|
||||
await apis.user.shared.waitForFilesToNotBeShared([file2Id, file3Id]);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await adminApiActions.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodeById(folderId);
|
||||
await apis.user.nodes.deleteNodeById(file4Id);
|
||||
});
|
||||
|
||||
it('[C213113] has the correct columns', async () => {
|
||||
const expectedColumns = ['Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by', 'Tags'];
|
||||
const actualColumns = await dataTable.getColumnHeadersText();
|
||||
|
||||
await expect(actualColumns).toEqual(expectedColumns);
|
||||
});
|
||||
|
||||
it('[C213115] default sorting column', async () => {
|
||||
expect(await dataTable.getSortedColumnHeaderText()).toBe('Modified');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('[C213114] displays the files shared by everyone', async () => {
|
||||
expect(await dataTable.isItemPresent(fileAdmin)).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(await dataTable.isItemPresent(file1User)).toBe(true, `${file1User} not displayed`);
|
||||
});
|
||||
|
||||
it(`[C213117] file not displayed if it's been deleted`, async () => {
|
||||
expect(await dataTable.isItemPresent(file2User)).toBe(false, `${file2User} is displayed`);
|
||||
});
|
||||
|
||||
it('[C213118] unshared file is not displayed', async () => {
|
||||
expect(await dataTable.isItemPresent(file3User)).toBe(false, `${file3User} is displayed`);
|
||||
});
|
||||
|
||||
it('[C213665] Location column displays the parent folder of the file', async () => {
|
||||
expect(await dataTable.getItemLocationTooltip(file4User)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileAdmin)).toEqual(siteName);
|
||||
expect(await dataTable.getItemLocation(file1User)).toEqual(folderUser);
|
||||
});
|
||||
|
||||
it('[C213666] Location column redirect - file in user Home', async () => {
|
||||
await dataTable.clickItemLocation(file4User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']);
|
||||
});
|
||||
|
||||
it('[C280490] Location column redirect - file in folder', async () => {
|
||||
await dataTable.clickItemLocation(file1User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', folderUser]);
|
||||
});
|
||||
|
||||
it('[C280491] Location column redirect - file in site', async () => {
|
||||
await dataTable.clickItemLocation(fileAdmin);
|
||||
expect(await breadcrumb.getAllItems()).toEqual(['My Libraries', siteName]);
|
||||
});
|
||||
|
||||
it('[C213667] Location column displays a tooltip with the entire path of the file', async () => {
|
||||
expect(await dataTable.getItemLocationTooltip(fileAdmin)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(await dataTable.getItemLocationTooltip(file1User)).toEqual(`Personal Files/${folderUser}`);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user