Skip to content

Commit

Permalink
code fix and remove protractor test
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrathod28 committed Nov 9, 2023
1 parent f887c32 commit ddf4c69
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 241 deletions.
3 changes: 3 additions & 0 deletions e2e/playwright/actions/tsconfig.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
"skipLibCheck": true,
"paths": {
"alfresco/playwright-shared": [" . ./../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
3 changes: 3 additions & 0 deletions e2e/playwright/authentication/tsconfig.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
"skipLibCheck": true,
"paths": {
"alfresco/playwright-shared": [" . ./../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
3 changes: 3 additions & 0 deletions e2e/playwright/folder-rules/tsconfig.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
"skipLibCheck": true,
"paths": {
"alfresco/playwright-shared": [" . ./../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
3 changes: 3 additions & 0 deletions e2e/playwright/navigation/tsconfig.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
"skipLibCheck": true,
"paths": {
"alfresco/playwright-shared": [" . ./../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { MyLibrariesPage, test } from '@alfresco/playwright-shared';
import * as testData from '@alfresco/playwright-shared';
import { expect } from '@playwright/test';

export async function checkActionsAvailable(
async function checkActionsAvailable(
myLibrariesPage: MyLibrariesPage,
item: string,
expectedToolbarPrimary: string[],
Expand All @@ -38,7 +38,7 @@ export async function checkActionsAvailable(
await myLibrariesPage.matMenu.verifyActualMoreActions(expectedToolbarMore);
}

export async function checkActionsViewerAvailable(
async function checkActionsViewerAvailable(
myLibrariesPage: MyLibrariesPage,
item: string,
expectedToolbarPrimary: string[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
"skipLibCheck": true,
"paths": {
"alfresco/playwright-shared": [" . ./../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
3 changes: 3 additions & 0 deletions e2e/playwright/viewer/tsconfig.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
"skipLibCheck": true,
"paths": {
"alfresco/playwright-shared": [" . ./../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { librariesTests } from './my-libraries';
import { favoritesTests } from './favorites';
import { searchResultsTests } from './search-results';
import { sharedFilesTests } from './shared-files';
import { collaboratorTests, filesLockedByCurrentUser, filesLockedByOtherUser } from './other-permissions';

describe('Special permissions : ', () => {
const random = testData.random;
Expand All @@ -37,7 +36,6 @@ describe('Special permissions : ', () => {

const userManager = `manager-${random}`;
const userConsumer = `consumer-${random}`;
const userCollaborator = `collaborator-${random}`;
const userDemoted = `demoted-${random}`;

let fileDocxFavId: string;
Expand All @@ -61,28 +59,24 @@ describe('Special permissions : ', () => {

const userManagerApi = new RepoClient(userManager, userManager);
const userConsumerApi = new RepoClient(userConsumer, userConsumer);
const userCollaboratorApi = new RepoClient(userCollaborator, userCollaborator);
const userDemotedApi = new RepoClient(userDemoted, userDemoted);

const loginPage = new LoginPage();

beforeAll(async () => {
await adminApiActions.createUser({ username: userManager });
await adminApiActions.createUser({ username: userConsumer });
await adminApiActions.createUser({ username: userCollaborator });
await adminApiActions.createUser({ username: userDemoted });

await managerActions.login(userManager, userManager);
await demotedUserActions.login(userDemoted, userDemoted);

const consumerFavoritesTotalItems = await userConsumerApi.favorites.getFavoritesTotalItems();
const managerSearchTotalItems = await userManagerApi.search.getTotalItems(userManager);
const collaboratorFavoritesTotalItems = await userCollaboratorApi.favorites.getFavoritesTotalItems();

await userManagerApi.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
const docLibId = await userManagerApi.sites.getDocLibId(sitePrivate);
await userManagerApi.sites.addSiteConsumer(sitePrivate, userConsumer);
await userManagerApi.sites.addSiteCollaborator(sitePrivate, userCollaborator);
await userManagerApi.sites.addSiteManager(sitePrivate, userDemoted);

await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocx.name);
Expand Down Expand Up @@ -130,8 +124,6 @@ describe('Special permissions : ', () => {
fileGranularPermissionId
]);

await userCollaboratorApi.favorites.addFavoritesByIds('file', [fileDocxSharedFavId, fileSharedFavId]);

await managerActions.lockNodes([fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId]);

await userManagerApi.nodes.setGranularPermission(fileGranularPermissionId, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
Expand All @@ -150,8 +142,7 @@ describe('Special permissions : ', () => {
fileGranularPermissionId,
fileLockedByUserId
]),
userManagerApi.search.waitForApi(userManager, { expect: managerSearchTotalItems + 14 }),
userCollaboratorApi.favorites.waitForApi({ expect: collaboratorFavoritesTotalItems + 2 })
userManagerApi.search.waitForApi(userManager, { expect: managerSearchTotalItems + 14 })
]);
});

Expand Down Expand Up @@ -184,28 +175,4 @@ describe('Special permissions : ', () => {
sharedFilesTests();
});
});

describe('Collaborator', () => {
beforeAll(async () => {
await loginPage.loginWith(userCollaborator);
});

collaboratorTests(sitePrivate);
});

describe('File locked - user is lock owner', () => {
beforeAll(async () => {
await loginPage.loginWith(userDemoted);
});

filesLockedByCurrentUser(sitePrivate);
});

describe('File locked by other user - user is manager', () => {
beforeAll(async () => {
await loginPage.loginWith(userManager);
});

filesLockedByOtherUser(sitePrivate);
});
});

0 comments on commit ddf4c69

Please sign in to comment.