Skip to content

Commit

Permalink
Created a separate test suit for share-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kritagya09 committed Dec 27, 2023
1 parent 0c39a21 commit 0e0c59e
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ jobs:
id: 2
- name: "viewer,infoDrawer,extensions"
id: 3
- name: "shareActions"
id: 4
- name: "copyMoveActions"
id: 6
- name: "deleteActions"
Expand Down Expand Up @@ -176,6 +174,8 @@ jobs:
id: 7
- name: "list-views"
id: 8
- name: "share-action"
id: 9
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
26 changes: 26 additions & 0 deletions e2e/playwright/share-action/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "../../../.eslintrc.json",
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"e2e/playwright/share-action/tsconfig.e2e.json"
],
"createDefaultProgram": true
},
"plugins": [
"rxjs",
"unicorn"
],
"rules": {
"@typescript-eslint/no-floating-promises": "off"
}
}
]
}
1 change: 1 addition & 0 deletions e2e/playwright/share-action/exclude.tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
44 changes: 44 additions & 0 deletions e2e/playwright/share-action/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*!
* 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 { PlaywrightTestConfig } from '@playwright/test';
import { CustomConfig, getGlobalConfig, getExcludedTestsRegExpArray } from '@alfresco/playwright-shared';
import EXCLUDED_JSON from './exclude.tests.json';

const config: PlaywrightTestConfig<CustomConfig> = {
...getGlobalConfig,

grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Share Action'),
projects: [
{
name: 'Share Action',
testDir: './src/tests',
use: {
users: ['hruser']
}
}
]
};

export default config;
22 changes: 22 additions & 0 deletions e2e/playwright/share-action/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "share-action-e2e",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/playwright/share-action/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": ["npx playwright test --config=e2e/playwright/share-action/playwright.config.ts"]
},
"configurations": {
"production": {
"devServerTarget": "content-ce:serve:production"
}
}
},
"lint": {
"executor": "@angular-eslint/builder:lint"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Site } from '@alfresco/js-api';
import { ApiClientFactory, FileActionsApi, NodesApi, SharedLinksApi, SitesApi, Utils, test, timeouts } from '@alfresco/playwright-shared';
import { expect } from '@playwright/test';

test.describe('Unshare a file from Search Results', () => {
test.describe.only('Unshare a file from Search Results', () => {
const random = Utils.random();

const username = `user-${random}`;
Expand All @@ -46,7 +46,6 @@ test.describe('Unshare a file from Search Results', () => {

const sitePrivate = `site-private-${random}`;

let fileSite1Id: string;
let fileSite2Id: string;
const fileSite1 = `search-file-${searchRandom}-Site1.txt`;
const fileSite2 = `search-file-${searchRandom}-Site2.txt`;
Expand All @@ -72,7 +71,7 @@ test.describe('Unshare a file from Search Results', () => {
await sitesApi.createSite(sitePrivate, Site.VisibilityEnum.PRIVATE);
const docLibId = await sitesApi.getDocLibId(sitePrivate);

fileSite1Id = (await nodesApi.createFile(fileSite1, docLibId)).entry.id;
const fileSite1Id = (await nodesApi.createFile(fileSite1, docLibId)).entry.id;
fileSite2Id = (await nodesApi.createFile(fileSite2, docLibId)).entry.id;

await sitesApi.addSiteMember(sitePrivate, username, Site.RoleEnum.SiteConsumer);
Expand Down
15 changes: 15 additions & 0 deletions e2e/playwright/share-action/tsconfig.e2e.adf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../../tsconfig.adf.json",
"compilerOptions": {
"outDir": "../../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node"],
"skipLibCheck": true,
"paths": {
"@alfresco/playwright-shared": ["../../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
15 changes: 15 additions & 0 deletions e2e/playwright/share-action/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
"skipLibCheck": true,
"paths": {
"@alfresco/playwright-shared": ["../../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion projects/aca-playwright-shared/src/utils/timeouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ export const timeouts = {
globalTest: 45 * 1000,
extendedTest: 150 * 1000,
webServer: 240 * 1000,
globalSpec: 60 * 20 * 1000
globalSpec: 60 * 10 * 1000
};

0 comments on commit 0e0c59e

Please sign in to comment.