mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACS-7303] beforeEach and afterAll updated for share-action tests (#3742)
* [ACS-7303] beforeEach and afterAll updated for share-action tests * [ACS-7303] deleted .only
This commit is contained in:
@@ -23,11 +23,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Site } from '@alfresco/js-api';
|
import { Site } from '@alfresco/js-api';
|
||||||
import { ApiClientFactory, FileActionsApi, NodesApi, SharedLinksApi, SitesApi, Utils, test, timeouts } from '@alfresco/playwright-shared';
|
import {
|
||||||
|
ApiClientFactory,
|
||||||
|
FileActionsApi,
|
||||||
|
NodesApi,
|
||||||
|
SharedLinksApi,
|
||||||
|
SitesApi,
|
||||||
|
Utils,
|
||||||
|
test,
|
||||||
|
timeouts,
|
||||||
|
TrashcanApi
|
||||||
|
} from '@alfresco/playwright-shared';
|
||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
|
|
||||||
test.describe('Unshare a file from Search Results', () => {
|
test.describe('Unshare a file from Search Results', () => {
|
||||||
const random = Utils.random();
|
const random = Utils.random();
|
||||||
|
let nodesApi: NodesApi;
|
||||||
|
let trashcanApi: TrashcanApi;
|
||||||
|
|
||||||
const username = `user-${random}`;
|
const username = `user-${random}`;
|
||||||
const parent = `parent-${random}`;
|
const parent = `parent-${random}`;
|
||||||
@@ -57,7 +69,8 @@ test.describe('Unshare a file from Search Results', () => {
|
|||||||
test.setTimeout(timeouts.extendedTest);
|
test.setTimeout(timeouts.extendedTest);
|
||||||
await apiClientFactory.setUpAcaBackend('admin');
|
await apiClientFactory.setUpAcaBackend('admin');
|
||||||
await apiClientFactory.createUser({ username });
|
await apiClientFactory.createUser({ username });
|
||||||
const nodesApi = await NodesApi.initialize(username, username);
|
nodesApi = await NodesApi.initialize(username, username);
|
||||||
|
trashcanApi = await TrashcanApi.initialize(username, username);
|
||||||
sitesApi = await SitesApi.initialize(username, username);
|
sitesApi = await SitesApi.initialize(username, username);
|
||||||
const shareApi = await SharedLinksApi.initialize(username, username);
|
const shareApi = await SharedLinksApi.initialize(username, username);
|
||||||
const filesAction = await FileActionsApi.initialize(username, username);
|
const filesAction = await FileActionsApi.initialize(username, username);
|
||||||
@@ -89,14 +102,12 @@ test.describe('Unshare a file from Search Results', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test.beforeEach(async ({ loginPage, personalFiles }) => {
|
test.beforeEach(async ({ loginPage, personalFiles }) => {
|
||||||
await loginPage.navigate();
|
await Utils.tryLoginUser(loginPage, username, username, 'beforeEach failed');
|
||||||
await loginPage.loginUser({ username: username, password: username });
|
|
||||||
await personalFiles.waitForPageLoad();
|
await personalFiles.waitForPageLoad();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async () => {
|
test.afterAll(async () => {
|
||||||
await apiClientFactory.nodes.deleteNode(parentId, { permanent: true });
|
await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed', sitesApi, [sitePrivate]);
|
||||||
await sitesApi.deleteSites([sitePrivate]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C306995] Unshare dialog UI', async ({ personalFiles, searchPage }) => {
|
test('[C306995] Unshare dialog UI', async ({ personalFiles, searchPage }) => {
|
||||||
@@ -172,7 +183,7 @@ test.describe('Unshare a file from Search Results', () => {
|
|||||||
|
|
||||||
await page.goto(url);
|
await page.goto(url);
|
||||||
await personalFiles.viewer.waitForViewerToOpen();
|
await personalFiles.viewer.waitForViewerToOpen();
|
||||||
expect(personalFiles.viewer.fileTitleButtonLocator).not.toEqual(file4);
|
expect(personalFiles.viewer.fileTitleButtonLocator.textContent()).not.toEqual(file4);
|
||||||
expect(await nodesApiAction.isFileShared(file4Id)).toBe(false);
|
expect(await nodesApiAction.isFileShared(file4Id)).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ export class ShareDialogComponent extends BaseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getLinkUrl(): Promise<string> {
|
async getLinkUrl(): Promise<string> {
|
||||||
return await this.url.inputValue();
|
return await this.url.first().inputValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
async isUrlReadOnly(): Promise<boolean> {
|
async isUrlReadOnly(): Promise<boolean> {
|
||||||
|
Reference in New Issue
Block a user