[ACS-8688] export playwright shared lib (#4068)

* [ACS-8688] export playwright shared lib

* [ACS-8688] changes name

* [ACS-8688] changes name

* [ACS-8688] add lint file and fix lint issue

* [ACS-8688] test fix

* added ng package file
This commit is contained in:
Akash Rathod 2024-09-03 14:16:02 +02:00 committed by GitHub
parent 14bb6b3155
commit 56c2c55daf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
66 changed files with 406 additions and 295 deletions

View File

@ -12,7 +12,8 @@ fi
export PROJECTS=(
'aca-content'
'aca-shared'
'aca-shared',
'aca-playwright-shared'
);
for PROJECT in ${PROJECTS[@]}

View File

@ -11,7 +11,8 @@ fi
export PROJECTS=(
'aca-content'
'aca-shared'
'aca-shared',
'aca-playwright-shared'
);
for PROJECT in ${PROJECTS[@]}

View File

@ -32,4 +32,4 @@ if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
void platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -7,7 +7,6 @@
"package.json"
],
"words": [
"Hyland",
"ADDFEATURES",
"afts",
"androidamw",
@ -20,6 +19,7 @@
"folderlink",
"formcontrolname",
"hruser",
"Hyland",
"iosamw",
"mobileapps",
"mysites",
@ -31,6 +31,7 @@
"qshare",
"repo",
"reportportal",
"sfdc",
"sharedlinks",
"sidenav",
"simpletask",
@ -38,7 +39,8 @@
"textitem",
"thumbnailed",
"versionable",
"sfdc"
"любимый",
"сайт"
],
"dictionaries": [
"html",

View File

@ -71,7 +71,9 @@ test.describe('Unshare a file from Search Results', () => {
await apiClientFactory.createUser({ username });
nodesApi = await NodesApi.initialize(username, username);
trashcanApi = await TrashcanApi.initialize(username, username);
sitesApi = await SitesApi.initialize(username, username);
sitesApi = await SitesApi.initialize('admin');
const nodesApiAdmin = await NodesApi.initialize('admin');
const shareApiAdmin = await SharedLinksApi.initialize('admin');
const shareApi = await SharedLinksApi.initialize(username, username);
const filesAction = await FileActionsApi.initialize(username, username);
parentId = (await nodesApi.createFolder(parent)).entry.id;
@ -84,13 +86,13 @@ test.describe('Unshare a file from Search Results', () => {
await sitesApi.createSite(sitePrivate, Site.VisibilityEnum.PRIVATE);
const docLibId = await sitesApi.getDocLibId(sitePrivate);
const fileSite1Id = (await nodesApi.createFile(fileSite1, docLibId)).entry.id;
fileSite2Id = (await nodesApi.createFile(fileSite2, docLibId)).entry.id;
const fileSite1Id = (await nodesApiAdmin.createFile(fileSite1, docLibId)).entry.id;
fileSite2Id = (await nodesApiAdmin.createFile(fileSite2, docLibId)).entry.id;
await sitesApi.addSiteMember(sitePrivate, username, Site.RoleEnum.SiteConsumer);
await shareApi.shareFilesByIds([fileSite1Id]);
await shareApi.waitForFilesToBeShared([fileSite1Id]);
await shareApiAdmin.shareFilesByIds([fileSite1Id]);
await shareApiAdmin.waitForFilesToBeShared([fileSite1Id]);
await shareApi.shareFilesByIds([file1Id, file2Id, file3Id, file4Id, fileSite2Id]);
await shareApi.waitForFilesToBeShared([file1Id, file2Id, file3Id, file4Id, fileSite2Id]);

View File

@ -0,0 +1,17 @@
const path = require('path');
module.exports = {
extends: '../../.eslintrc.json',
ignorePatterns: ['!**/*'],
overrides: [
{
files: ['*.ts'],
parserOptions: {
project: [path.join(__dirname, 'tsconfig.lib.json'), path.join(__dirname, 'tsconfig.spec.json')],
createDefaultProgram: true
},
rules: {
'no-console': ['error', {'allow': ['info', 'log', 'warn', 'error'] }]
}
}
]
};

View File

@ -0,0 +1,6 @@
{
"dest": "../../dist/@alfresco/aca-playwright-shared",
"lib": {
"entryFile": "src/index.ts"
}
}

View File

@ -1,5 +1,5 @@
{
"name": "aca-playwright-shared",
"name": "@alfresco/aca-playwright-shared",
"version": "3.0.0",
"license": "LGPL-3.0",
"main": "src/index.ts",

View File

@ -1,7 +1,28 @@
{
"name": "playwright-shared",
"name": "aca-playwright-shared",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/aca-playwright-shared/src",
"projectType": "library",
"prefix": "lib"
"prefix": "lib",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/aca-playwright-shared/tsconfig.lib.json",
"project": "projects/aca-playwright-shared/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/aca-playwright-shared/tsconfig.lib.prod.json"
}
},
"defaultConfiguration": "production",
"outputs": [
"{workspaceRoot}/dist/@alfresco/aca-playwright-shared"
]
},
"lint": {
"executor": "@angular-eslint/builder:lint"
}
}
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
@ -40,7 +40,7 @@ export class CategoriesApi {
async createCategory(categoryId: string, categoryBodyCreate: CategoryBody[], opts?: CategoryQuery): Promise<CategoryPaging | CategoryEntry> {
try {
return await this.apiService.categoriesApi.createSubcategories(categoryId, categoryBodyCreate, opts);
return this.apiService.categoriesApi.createSubcategories(categoryId, categoryBodyCreate, opts);
} catch (error) {
console.error(error);
return null;
@ -49,7 +49,7 @@ export class CategoriesApi {
async deleteCategory(categoryId: string): Promise<void> {
if (categoryId === null) {
console.log('categoryId is null, skipping deletion');
console.error('categoryId is null, skipping deletion');
return;
}
@ -66,7 +66,7 @@ export class CategoriesApi {
opts?: CategoryQuery
): Promise<CategoryPaging | CategoryEntry> {
try {
return await this.apiService.categoriesApi.linkNodeToCategory(nodeId, categoryLinkBodyCreate, opts);
return this.apiService.categoriesApi.linkNodeToCategory(nodeId, categoryLinkBodyCreate, opts);
} catch (error) {
console.error(`${this.constructor.name} ${this.linkNodeToCategory.name}: ${error}`);
return null;

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
@ -38,7 +38,7 @@ export class FavoritesPageApi {
return classObj;
}
async addFavoriteById(nodeType: 'file' | 'folder' | 'site', id: string): Promise<FavoriteEntry> {
let guid = nodeType === 'site' ? (await this.apiService.sites.getSite(id)).entry.guid : id;
const guid = nodeType === 'site' ? (await this.apiService.sites.getSite(id)).entry.guid : id;
const data = {
target: {
[nodeType]: {
@ -46,7 +46,7 @@ export class FavoritesPageApi {
}
}
};
return await this.apiService.favorites.createFavorite('-me-', data);
return this.apiService.favorites.createFavorite('-me-', data);
}
async addFavoritesByIds(nodeType: 'file' | 'folder' | 'site', ids: string[]): Promise<FavoriteEntry[]> {
@ -64,7 +64,7 @@ export class FavoritesPageApi {
private async getFavorites(username: string): Promise<FavoritePaging> {
try {
return await this.apiService.favorites.listFavorites(username);
return this.apiService.favorites.listFavorites(username);
} catch {
return new FavoritePaging();
}
@ -89,7 +89,7 @@ export class FavoritesPageApi {
return Promise.resolve(isFavorite);
}
};
return await Utils.retryCall(favorite);
return Utils.retryCall(favorite);
} catch (error) {}
return isFavorite;
}
@ -112,7 +112,7 @@ export class FavoritesPageApi {
return Promise.resolve(totalItems);
}
};
return await Utils.retryCall(favoriteFiles);
return Utils.retryCall(favoriteFiles);
} catch {}
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import * as fs from 'fs';
@ -43,7 +43,7 @@ export class FileActionsApi {
async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise<NodeEntry> {
const file = fs.createReadStream(fileLocation);
return await this.apiService.upload.uploadFile(file, '', parentFolderId, null, {
return this.apiService.upload.uploadFile(file, '', parentFolderId, null, {
name: fileName,
nodeType: 'cm:content',
renditions: 'doclib'
@ -71,7 +71,7 @@ export class FileActionsApi {
};
try {
return await this.apiService.upload.uploadFile(file, '', parentId, nodeProps, opts);
return this.apiService.upload.uploadFile(file, '', parentId, nodeProps, opts);
} catch (error) {
return Promise.reject(error);
}
@ -87,7 +87,7 @@ export class FileActionsApi {
async getNodeById(id: string): Promise<NodeEntry | null> {
try {
return await this.apiService.nodes.getNode(id);
return this.apiService.nodes.getNode(id);
} catch {
return null;
}
@ -126,7 +126,7 @@ export class FileActionsApi {
return Promise.resolve(isLocked);
}
};
return await Utils.retryCall(locked, data.retry);
return Utils.retryCall(locked, data.retry);
} catch {}
return isLocked;
}
@ -141,7 +141,7 @@ export class FileActionsApi {
};
try {
return await this.apiService.search.search(data);
return this.apiService.search.search(data);
} catch {
return new ResultSetPaging();
}
@ -172,7 +172,7 @@ export class FileActionsApi {
comment: comment,
name: newName
};
return await this.apiService.nodes.updateNodeContent(nodeId, content, opts);
return this.apiService.nodes.updateNodeContent(nodeId, content, opts);
} catch (error) {
console.error(`${this.constructor.name} ${this.updateNodeContent.name}`, error);
return Promise.reject(error);

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { NodeBodyCreate } from '@alfresco/js-api';
@ -41,9 +41,8 @@ export function flattenNodeContentTree(content: NodeContentTree, relativePath: s
const { name, files, folders, title, description } = content;
const aspectNames: string[] = ['cm:versionable'];
let data: NodeBodyCreate[] = [];
let properties: any;
properties = {
const properties = {
[NODE_TITLE]: title,
[NODE_DESCRIPTION]: description
};

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
@ -48,7 +48,7 @@ export class NodesApi {
aspectNames: string[] = null
): Promise<NodeEntry | null> {
try {
return await this.createNode('cm:folder', name, parentId, title, description, null, author, null, aspectNames);
return this.createNode('cm:folder', name, parentId, title, description, null, author, null, aspectNames);
} catch (error) {
console.error(`${this.constructor.name} ${this.createFolder.name}`, error);
return null;
@ -65,7 +65,7 @@ export class NodesApi {
aspectNames: string[] = null
): Promise<NodeEntry> {
try {
return await this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion, aspectNames);
return this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion, aspectNames);
} catch (error) {
console.error(`${this.constructor.name} ${this.createFile.name}`, error);
return null;
@ -74,7 +74,7 @@ export class NodesApi {
async createFiles(names: string[], relativePath = '/'): Promise<NodePaging> {
try {
return await this.createContent({ files: names }, relativePath);
return this.createContent({ files: names }, relativePath);
} catch (error) {
console.error(`${this.constructor.name} ${this.createFiles.name}: ${error}`);
return null;
@ -83,7 +83,7 @@ export class NodesApi {
async createFolders(names: string[], relativePath = '/'): Promise<NodePaging> {
try {
return await this.createContent({ folders: names }, relativePath);
return this.createContent({ folders: names }, relativePath);
} catch (error) {
console.error(`${this.constructor.name} ${this.createFolders.name}: ${error}`);
return null;
@ -128,7 +128,7 @@ export class NodesApi {
}
try {
return await this.apiService.nodes.createNode(parentId, nodeBody, {
return this.apiService.nodes.createNode(parentId, nodeBody, {
majorVersion
});
} catch (error) {
@ -139,7 +139,7 @@ export class NodesApi {
async renameNode(nodeId: string, newName: string): Promise<NodeEntry | null> {
try {
return await this.apiService.nodes.updateNode(nodeId, { name: newName });
return this.apiService.nodes.updateNode(nodeId, { name: newName });
} catch (error) {
console.error(`${this.constructor.name} ${this.renameNode.name}`, error);
return null;
@ -195,7 +195,7 @@ export class NodesApi {
async createContent(content: NodeContentTree, relativePath: string = '/'): Promise<NodePaging> {
try {
return await this.apiService.nodes.createNode('-my-', flattenNodeContentTree(content, relativePath) as any);
return this.apiService.nodes.createNode('-my-', flattenNodeContentTree(content, relativePath) as any);
} catch (error) {
console.error(`${this.constructor.name} ${this.createContent.name}`, error);
return null;
@ -204,7 +204,7 @@ export class NodesApi {
async getNodeById(id: string): Promise<NodeEntry | null> {
try {
return await this.apiService.nodes.getNode(id);
return this.apiService.nodes.getNode(id);
} catch (error) {
console.error(`${this.constructor.name} ${this.getNodeById.name}`, error);
return null;
@ -226,7 +226,7 @@ export class NodesApi {
const opts = {
include: ['properties']
};
return await this.apiService.nodes.listNodeChildren(nodeId, opts);
return this.apiService.nodes.listNodeChildren(nodeId, opts);
} catch (error) {
console.error(`${this.constructor.name} ${this.getNodeChildren.name}`, error);
return null;
@ -304,7 +304,7 @@ export class NodesApi {
};
try {
return await this.apiService.nodes.updateNode(nodeId, data);
return this.apiService.nodes.updateNode(nodeId, data);
} catch (error) {
console.error(`${this.constructor.name} ${this.setGranularPermission.name}`, error);
return null;
@ -343,7 +343,7 @@ export class NodesApi {
};
try {
return await this.apiService.nodes.updateNode(nodeId, data);
return this.apiService.nodes.updateNode(nodeId, data);
} catch (error) {
console.error(`${this.constructor.name} ${this.setInheritPermissions.name}`, error);
return null;
@ -352,7 +352,7 @@ export class NodesApi {
private async addAspects(nodeId: string, aspectNames: string[]): Promise<NodeEntry> {
try {
return await this.apiService.nodes.updateNode(nodeId, { aspectNames });
return this.apiService.nodes.updateNode(nodeId, { aspectNames });
} catch (error) {
console.error(`${this.constructor.name} ${this.addAspects.name}`, error);
return null;

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
export interface PersonModel {

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { FindQuery } from '@alfresco/js-api';
@ -50,7 +50,7 @@ export class QueriesApi {
}
};
return await Utils.retryCall(sites);
return Utils.retryCall(sites);
} catch (error) {
console.error(`QueriesApi waitForSites : catch : `);
console.error(`\tExpected: ${data.expect} items, but found ${error}`);

View File

@ -53,7 +53,7 @@ export class RulesApi {
async createRandomRule(folderId: string, ruleName: string): Promise<Rule> {
const randomActionsIndex = crypto.randomInt(0, ActionTypes.actions.length);
const randomAction = ActionTypes.actions[randomActionsIndex];
return await this.createRule(folderId, {
return this.createRule(folderId, {
name: ruleName,
isEnabled: true,
actions: [randomAction]
@ -66,13 +66,13 @@ export class RulesApi {
}
const randomActionsIndex = crypto.randomInt(0, ActionTypes.actions.length);
const randomAction = ActionTypes.actions[randomActionsIndex];
let conditionsArray = [];
const conditionsArray = [];
for (let i = 0; i < numOfConditions; i++) {
const randomIndex = crypto.randomInt(0, ConditionsTypes.conditions.length);
const randomCondition = ConditionsTypes.conditions[randomIndex];
conditionsArray.push(randomCondition);
}
return await this.createRule(folderId, {
return this.createRule(folderId, {
name: ruleName,
isEnabled: true,
actions: [randomAction],
@ -88,24 +88,30 @@ export class RulesApi {
if (numOfActions > ActionTypes.actions.length) {
numOfActions = ActionTypes.actions.length;
}
let actionsArray = [];
const actionsArray = [];
for (let i = 0; i < numOfActions; i++) {
const randomIndex = crypto.randomInt(0, ActionTypes.actions.length);
const randomAction = ActionTypes.actions[randomIndex];
actionsArray.push(randomAction);
}
return await this.createRule(folderId, {
return this.createRule(folderId, {
name: ruleName,
isEnabled: true,
actions: actionsArray
});
}
async createRandomComplexRule(folderId: string, ruleName: string, numOfConditions: number, numOfActions: number, ruleDescription?: string): Promise<Rule> {
async createRandomComplexRule(
folderId: string,
ruleName: string,
numOfConditions: number,
numOfActions: number,
ruleDescription?: string
): Promise<Rule> {
if (numOfConditions > ConditionsTypes.conditions.length) {
numOfConditions = ConditionsTypes.conditions.length;
}
let conditionsArray = [];
const conditionsArray = [];
for (let i = 0; i < numOfConditions; i++) {
const randomIndex = crypto.randomInt(0, ConditionsTypes.conditions.length);
const randomCondition = ConditionsTypes.conditions[randomIndex];
@ -114,13 +120,13 @@ export class RulesApi {
if (numOfActions > ActionTypes.actions.length) {
numOfActions = ActionTypes.actions.length;
}
let actionsArray = [];
const actionsArray = [];
for (let i = 0; i < numOfActions; i++) {
const randomIndex = crypto.randomInt(0, ActionTypes.actions.length);
const randomAction = ActionTypes.actions[randomIndex];
actionsArray.push(randomAction);
}
return await this.createRule(folderId, {
return this.createRule(folderId, {
name: ruleName,
description: ruleDescription,
isEnabled: true,
@ -134,7 +140,7 @@ export class RulesApi {
}
async createRuleWithRandomAspects(folderId: string, ruleName: string): Promise<Rule> {
return await this.createRule(folderId, {
return this.createRule(folderId, {
name: ruleName,
isEnabled: true,
actions: [
@ -166,7 +172,7 @@ export class RulesApi {
actionType: 'move' | 'copy' | 'import',
destinationFolderId: string
): Promise<Rule> {
return await this.createRule(folderId, {
return this.createRule(folderId, {
name: ruleName,
isEnabled: true,
actions: [

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
@ -52,7 +52,7 @@ export class SearchPageApi {
};
try {
return await this.apiService.search.search(data);
return this.apiService.search.search(data);
} catch {
return new ResultSetPaging();
}
@ -73,7 +73,7 @@ export class SearchPageApi {
}
};
return await Utils.retryCall(searchFiles);
return Utils.retryCall(searchFiles);
} catch {}
}
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
@ -44,7 +44,7 @@ export class SharedLinksApi {
nodeId: id,
expiresAt: expireDate
};
return await this.apiService.share.createSharedLink(data);
return this.apiService.share.createSharedLink(data);
} catch (error) {
return null;
}
@ -70,7 +70,7 @@ export class SharedLinksApi {
const opts = {
maxItems
};
return await this.apiService.share.listSharedLinks(opts);
return this.apiService.share.listSharedLinks(opts);
} catch (error) {
console.error(`SharedLinksApi getSharedLinks : catch : `, error);
return new SharedLinkPaging();
@ -89,7 +89,7 @@ export class SharedLinksApi {
}
};
return await Utils.retryCall(sharedFile);
return Utils.retryCall(sharedFile);
} catch (error) {
console.error(`SharedLinksApi waitForFilesToBeShared : catch : ${error}`);
console.error(`\tWait timeout reached waiting for files to be shared`);
@ -110,7 +110,7 @@ export class SharedLinksApi {
async unshareFileById(fileId: string): Promise<void> {
try {
const sharedId = await this.getSharedIdOfNode(fileId);
return await this.apiService.share.deleteSharedLink(sharedId);
return this.apiService.share.deleteSharedLink(sharedId);
} catch (error) {
console.error(`SharedLinksApi unshareFileById : catch : `, error);
}
@ -132,7 +132,7 @@ export class SharedLinksApi {
}
};
return await Utils.retryCall(sharedFile);
return Utils.retryCall(sharedFile);
} catch (error) {
console.error(`SharedLinksApi waitForFilesToNotBeShared : catch : ${error}`);
console.error(`\tWait timeout reached waiting for files to no longer be shared`);

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
@ -55,7 +55,7 @@ export class SitesApi {
} as SiteBodyCreate;
try {
return await this.apiService.sites.createSite(site);
return this.apiService.sites.createSite(site);
} catch (error) {
console.error(`SitesApi createSite : catch : `, error);
return null;
@ -94,7 +94,7 @@ export class SitesApi {
} as SiteMembershipBodyUpdate;
try {
return await this.apiService.sites.updateSiteMembership(siteId, userId, siteRole);
return this.apiService.sites.updateSiteMembership(siteId, userId, siteRole);
} catch (error) {
console.error(`SitesApi updateSiteMember : catch : `, error);
return new SiteMemberEntry();
@ -108,7 +108,7 @@ export class SitesApi {
} as SiteMembershipBodyCreate;
try {
return await this.apiService.sites.createSiteMembership(siteId, memberBody);
return this.apiService.sites.createSiteMembership(siteId, memberBody);
} catch (error) {
if (error.status === 409) {
return this.updateSiteMember(siteId, userId, role);
@ -125,7 +125,7 @@ export class SitesApi {
} as SiteMembershipRequestBodyCreate;
try {
return await this.apiService.sites.createSiteMembershipRequestForPerson(personId, body);
return this.apiService.sites.createSiteMembershipRequestForPerson(personId, body);
} catch (error) {
console.error(`SitesApi createSiteMembershipRequestForPerson : catch : `, error);
return null;
@ -134,7 +134,7 @@ export class SitesApi {
async approveSiteMembershipRequest(siteId: string, inviteeId: string): Promise<SiteMemberEntry> {
try {
return await this.apiService.sites.approveSiteMembershipRequest(siteId, inviteeId);
return this.apiService.sites.approveSiteMembershipRequest(siteId, inviteeId);
} catch (error) {
console.error(`SitesApi approveSiteMembershipRequest : catch : `, error);
return null;
@ -153,7 +153,7 @@ export class SitesApi {
async deleteSiteMember(siteId: string, userId: string) {
try {
return await this.apiService.sites.deleteSiteMembership(siteId, userId);
return this.apiService.sites.deleteSiteMembership(siteId, userId);
} catch (error) {
console.error(`SitesApi deleteSiteMember : catch : `, error);
}
@ -161,7 +161,7 @@ export class SitesApi {
async getSite(siteId: string): Promise<SiteEntry> {
try {
return await this.apiService.sites.getSite(siteId);
return this.apiService.sites.getSite(siteId);
} catch (error) {
console.error(`SitesApi getSite : catch : `, error);
return null;

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { TagBody, TagEntry } from '@alfresco/js-api';
@ -40,7 +40,7 @@ export class TagsApi {
async createTags(tags: TagBody[]): Promise<TagEntry[]> {
try {
return await this.apiService.tagsApi.createTags(tags);
return this.apiService.tagsApi.createTags(tags);
} catch (error) {
console.error(error);
return null;
@ -49,7 +49,7 @@ export class TagsApi {
async assignTagToNode(nodeId: string, tag: TagBody): Promise<TagEntry> {
try {
return await this.apiService.tagsApi.assignTagToNode(nodeId, tag);
return this.apiService.tagsApi.assignTagToNode(nodeId, tag);
} catch (error) {
console.error(error);
return null;
@ -58,7 +58,7 @@ export class TagsApi {
async deleteTag(tagId: string): Promise<void> {
try {
return await this.apiService.tagsApi.deleteTag(tagId);
return this.apiService.tagsApi.deleteTag(tagId);
} catch (error) {
console.error(error);
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ApiClientFactory } from './api-client-factory';
@ -53,5 +53,4 @@ export class TrashcanApi {
console.error('User Actions - emptyTrashcan failed : ', error);
}
}
}

View File

@ -42,10 +42,13 @@ async function globalSetup(config: FullConfig<CustomConfig>) {
const page = await browser.newPage();
const loginPage = new LoginPage(page);
await page.goto(use.baseURL);
await loginPage.loginUser({ username: users[user].username, password: users[user].password }, {
await loginPage.loginUser(
{ username: users[user].username, password: users[user].password },
{
withNavigation: false,
waitForLoading: true
});
}
);
await page.context().storageState({ path: `${paths.userStates}/${user}UserState.json` });
await browser.close();
} else {

View File

@ -56,7 +56,7 @@ export const getGlobalConfig: PlaywrightTestConfig = {
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: env.PLAYWRIGHT_E2E_HOST,
headless: !!env.PLAYWRIGHT_HEADLESS ? (env.PLAYWRIGHT_HEADLESS === 'true') : !!env.CI,
headless: env.PLAYWRIGHT_HEADLESS === 'true' || !!env.CI,
ignoreHTTPSErrors: true,
bypassCSP: true,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
@ -77,5 +77,5 @@ export const getGlobalConfig: PlaywrightTestConfig = {
...devices['Desktop Chrome']
}
}
],
]
};

View File

@ -1,9 +1,25 @@
/*
/*!
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* License rights for this program may be obtained from Hyland Software, Inc.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* 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 { ReporterDescription } from '@playwright/test';
@ -36,6 +52,4 @@ export const getReportPortalConfig = () => {
};
export const getReporter = (): ReporterDescription[] =>
env.CI
? [['@reportportal/agent-js-playwright', getReportPortalConfig()], ['github']]
: [['html']];
env.CI ? [['@reportportal/agent-js-playwright', getReportPortalConfig()], ['github']] : [['html']];

View File

@ -67,8 +67,8 @@ export class AcaHeader extends BaseComponent {
}
async verifyToolbarPrimaryActions(expectedToolbarPrimary: string[]): Promise<void> {
let buttons = await this.page.$$('aca-toolbar button');
let actualPrimaryActions: string[] = await Promise.all(
const buttons = await this.page.$$('aca-toolbar button');
const actualPrimaryActions: string[] = await Promise.all(
buttons.map(async (button) => {
const title = await button.getAttribute('title');
return title || '';

View File

@ -52,7 +52,8 @@ export enum ActionType {
export class ActionsDropdownComponent extends BaseComponent {
private static rootElement = 'aca-edit-rule-dialog aca-rule-action-list';
private getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName }).first();
private getOptionLocator = (optionName: string): Locator =>
this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName }).first();
private ruleActionLocator = this.getChild('aca-rule-action');
private addActionButtonLocator = this.getChild('[data-automation-id="rule-action-list-add-action-button"]');
private actionDropdownLocator = this.getChild('[data-automation-id="rule-action-select"]');

View File

@ -32,7 +32,8 @@ export class AdfInfoDrawerComponent extends BaseComponent {
super(page, AdfInfoDrawerComponent.rootElement);
}
public getNameField = (labelText: string) => this.getChild(`[data-automation-id="library-name-properties-wrapper"] input[placeholder='${labelText}']`);
public getNameField = (labelText: string) =>
this.getChild(`[data-automation-id="library-name-properties-wrapper"] input[placeholder='${labelText}']`);
public getIdField = (labelText: string) => this.getChild(`[data-automation-id="library-id-properties-wrapper"] input[placeholder='${labelText}']`);
public getVisibilityField = (labelText: string) =>
this.getChild(`[data-automation-id="library-visibility-properties-wrapper"] mat-select[ng-reflect-placeholder='${labelText}']`);
@ -66,7 +67,7 @@ export class AdfInfoDrawerComponent extends BaseComponent {
async checkCommentsHeaderCount(): Promise<number> {
const commentsCountTextContent = await this.commentsHeader.textContent();
const commentsCountString = commentsCountTextContent.match(/\d+/g)[0];
return parseInt(commentsCountString);
return parseInt(commentsCountString, 10);
}
async verifyCommentsCountFromList(expectedNumber: number): Promise<void> {

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { BaseComponent } from '.././base.component';

View File

@ -56,8 +56,8 @@ export class DataTableComponent extends BaseComponent {
sitesName = this.page.locator('.adf-datatable-body [data-automation-id*="datatable-row"] [aria-label="Name"]');
sitesRole = this.page.locator('.adf-datatable-body [data-automation-id*="datatable-row"] [aria-label="My Role"]');
lockOwner = this.page.locator('.aca-locked-by--name');
uncheckedChecbox = this.page.locator('.mat-mdc-checkbox');
checkedChecbox = this.page.locator('.mat-mdc-checkbox-checked');
uncheckedCheckbox = this.page.locator('.mat-mdc-checkbox');
checkedCheckbox = this.page.locator('.mat-mdc-checkbox-checked');
/** Locator for row (or rows) */
getRowLocator = this.page.getByRole('rowgroup').nth(1).locator('adf-datatable-row');
@ -244,17 +244,17 @@ export class DataTableComponent extends BaseComponent {
for (const name of names) {
const isSelected = await this.isRowSelected(name);
if (!isSelected) {
let row = this.getRowByName(name);
const row = this.getRowByName(name);
await row.hover();
await row.locator(this.uncheckedChecbox).click();
await row.locator(this.checkedChecbox).waitFor({ state: 'attached' });
await row.locator(this.uncheckedCheckbox).click();
await row.locator(this.checkedCheckbox).waitFor({ state: 'attached' });
}
}
}
async isRowSelected(itemName: string): Promise<boolean> {
const row = this.getRowByName(itemName);
return await row.locator(this.checkedChecbox).isVisible();
return row.locator(this.checkedCheckbox).isVisible();
}
async getColumnHeaders(): Promise<Array<string>> {
@ -341,7 +341,7 @@ export class DataTableComponent extends BaseComponent {
*/
async getSitesNameAndVisibility(): Promise<{ [siteName: string]: string }> {
const rowsCount = await this.sitesName.count();
let sitesInfo: { [siteName: string]: string } = {};
const sitesInfo: { [siteName: string]: string } = {};
for (let i = 0; i < rowsCount; i++) {
let siteVisibilityText = await this.sitesVisibility.nth(i).textContent();
let siteNameText = await this.sitesName.nth(i).textContent();
@ -359,7 +359,7 @@ export class DataTableComponent extends BaseComponent {
*/
async getSitesNameAndRole(): Promise<{ [siteName: string]: string }> {
const rowsCount = await this.sitesName.count();
let sitesInfo: { [siteName: string]: string } = {};
const sitesInfo: { [siteName: string]: string } = {};
for (let i = 0; i < rowsCount; i++) {
let siteNameText = await this.sitesName.nth(i).textContent();
let siteRoleText = await this.sitesRole.nth(i).textContent();

View File

@ -56,13 +56,13 @@ export class MatMenuComponent extends BaseComponent {
async isMenuItemVisible(menuItem: string): Promise<boolean> {
const menuElement = this.getButtonByText(menuItem);
await menuElement.waitFor({ state: 'attached' });
return await menuElement.isVisible();
return menuElement.isVisible();
}
async verifyActualMoreActions(expectedToolbarMore: string[]): Promise<void> {
await this.page.locator('.mat-mdc-menu-content').waitFor({ state: 'attached' });
let menus = await this.page.$$('.mat-mdc-menu-content .mat-mdc-menu-item');
let actualMoreActions: string[] = await Promise.all(
const menus = await this.page.$$('.mat-mdc-menu-content .mat-mdc-menu-item');
const actualMoreActions: string[] = await Promise.all(
menus.map(async (button) => {
const title = await (await button.$('.mdc-list-item__primary-text span')).innerText();
return title || '';

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@ -51,8 +51,12 @@ export class AdfFolderDialogComponent extends BaseComponent {
*/
async createNewFolderDialog(nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
await this.folderNameInputLocator.fill(nameInput);
if (titleInput) { await this.folderTitleInput.fill(titleInput); }
if (descriptionInput) { await this.folderDescriptionInput.fill(descriptionInput); }
if (titleInput) {
await this.folderTitleInput.fill(titleInput);
}
if (descriptionInput) {
await this.folderDescriptionInput.fill(descriptionInput);
}
await this.createButton.click();
}
}

View File

@ -53,14 +53,18 @@ export class AdfLibraryDialogComponent extends BaseComponent {
await this.getLabelText('Name').fill(nameInput);
await this.getLabelText('Library ID').clear();
await this.getLabelText('Library ID').fill(libraryIdInput);
if (descriptionInput) { await this.getLabelText('Description').fill(descriptionInput); }
if (visibility) { await this.getLabelText(visibility).click(); }
if (descriptionInput) {
await this.getLabelText('Description').fill(descriptionInput);
}
if (visibility) {
await this.getLabelText(visibility).click();
}
await this.createButton.click();
await this.spinnerWaitForReload();
}
async isErrorMessageDisplayed(errorText: string): Promise<boolean> {
await this.getErrorByText(errorText).waitFor({ state: 'visible', timeout: timeouts.large });
return await this.getErrorByText(errorText).isVisible();
return this.getErrorByText(errorText).isVisible();
}
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Locator, Page, expect } from '@playwright/test';
@ -36,7 +36,8 @@ export class ContentNodeSelectorDialog extends BaseComponent {
public actionButton = this.getChild('[data-automation-id="content-node-selector-actions-choose"]');
public locationDropDown = this.getChild('[id="site-dropdown-container"] mat-form-field');
private selectedRow = this.getChild('.adf-is-selected');
getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName });
getOptionLocator = (optionName: string): Locator =>
this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName });
private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
getDialogTitle = (text: string) => this.getChild('[data-automation-id="content-node-selector-title"]', { hasText: text });
getBreadcrumb = (text: string) => this.getChild('[data-automation-id="current-folder"]', { hasText: text });

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Locator, Page } from '@playwright/test';
@ -39,10 +39,9 @@ export class CreateFromTemplateDialogComponent extends BaseComponent {
getDialogLabel = (text: string) => this.getChild('label', { hasText: text });
getErrorByText = (text: string): Locator => this.page.locator('mat-error', { hasText: text });
async isErrorMessageDisplayed(errorText: string): Promise<boolean> {
await this.getErrorByText(errorText).waitFor({ state: 'visible', timeout: timeouts.large });
return await this.getErrorByText(errorText).isVisible();
return this.getErrorByText(errorText).isVisible();
}
/**
@ -50,8 +49,12 @@ export class CreateFromTemplateDialogComponent extends BaseComponent {
*/
async createFromTemplateAction(nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
await this.getDialogLabel('Name *').fill(nameInput);
if (titleInput) { await this.getDialogLabel('Title').fill(titleInput); }
if (descriptionInput) { await this.getDialogLabel('Description').fill(descriptionInput); }
if (titleInput) {
await this.getDialogLabel('Title').fill(titleInput);
}
if (descriptionInput) {
await this.getDialogLabel('Description').fill(descriptionInput);
}
await this.createButton.click();
}
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Locator, Page, expect } from '@playwright/test';
@ -35,7 +35,8 @@ export class LinkRulesDialog extends BaseComponent {
cancelButton = this.getChild('[data-automation-id="content-node-selector-actions-cancel"]');
selectFolderButton = this.getChild('button', { hasText: ' Select folder ' });
emptyLinkRules = this.getChild('.adf-empty-content__title');
getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName });
getOptionLocator = (optionName: string): Locator =>
this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName });
private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
getDialogTitle = (text: string) => this.getChild('[data-automation-id="content-node-selector-title"]', { hasText: text });
getBreadcrumb = (text: string) => this.getChild('[data-automation-id="current-folder"]', { hasText: text });

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@ -50,24 +50,24 @@ export class PasswordOverlayDialogComponent extends BaseComponent {
async isDialogOpen(): Promise<boolean> {
await this.waitForDialogToOpen();
return await this.passwordInput.isVisible();
return this.passwordInput.isVisible();
}
async isCloseVisible(): Promise<boolean> {
return await this.closeButton.isVisible();
return this.closeButton.isVisible();
}
async isSubmitHidden(): Promise<boolean> {
return await this.submitButton.isHidden();
return this.submitButton.isHidden();
}
async isPasswordInputDisplayed(): Promise<boolean> {
return await this.passwordInput.isVisible();
return this.passwordInput.isVisible();
}
async isErrorDisplayed(): Promise<boolean> {
await this.errorMessage.waitFor({ state: 'visible', timeout: timeouts.short });
return await this.errorMessage.isVisible();
return this.errorMessage.isVisible();
}
async getErrorMessage(): Promise<string> {

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ElementHandle, Locator, Page } from '@playwright/test';
@ -51,19 +51,19 @@ export class ShareDialogComponent extends BaseComponent {
getErrorByText = (text: string): Locator => this.page.locator('mat-error', { hasText: text });
async getLabels(): Promise<Array<string>> {
return await this.page.$$eval('.adf-share-link__label', (elements) => elements.map((element) => element.textContent));
return this.page.$$eval('.adf-share-link__label', (elements) => elements.map((element) => element.textContent));
}
async getDialogTitle(): Promise<string> {
return await this.dialogTitle.innerText();
return this.dialogTitle.innerText();
}
async getInfoText(): Promise<string> {
return await this.infoText.innerText();
return this.infoText.innerText();
}
async getLinkUrl(): Promise<string> {
return await this.url.first().inputValue();
return this.url.first().inputValue();
}
async isUrlReadOnly(): Promise<boolean> {
@ -72,7 +72,7 @@ export class ShareDialogComponent extends BaseComponent {
}
async isCloseEnabled(): Promise<boolean> {
return await this.closeButton.isEnabled();
return this.closeButton.isEnabled();
}
async clickClose(): Promise<void> {
@ -96,6 +96,6 @@ export class ShareDialogComponent extends BaseComponent {
}
async getExpireDate(): Promise<string> {
return await this.expireInput.inputValue();
return this.expireInput.inputValue();
}
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';

View File

@ -57,11 +57,13 @@ export class ManageRulesDialogComponent extends BaseComponent {
for (let i = 0; i < noActions; i++) {
await this.actionsEllipsisButtons.first().click();
await this.actionsEllipsisDelete.click();
}}
}
}
async deleteConditions(noConditions: number): Promise<void> {
for (let i = 0; i < noConditions; i++) {
await this.conditionsEllipsisButtons.first().click();
await this.conditionsEllipsisDelete.click();
}}
}
}
}

View File

@ -53,7 +53,7 @@ export class ManageRules extends BaseComponent {
}
async checkIfRuleListEmpty(): Promise<boolean> {
return await this.rulesEmptyListTitle.isVisible();
return this.rulesEmptyListTitle.isVisible();
}
async checkIfRuleIsOnTheList(ruleName: string): Promise<void> {
@ -61,7 +61,7 @@ export class ManageRules extends BaseComponent {
}
async countConditionsInGroup(): Promise<number> {
return await this.ruleConditionsInGroup.count();
return this.ruleConditionsInGroup.count();
}
async turnOffRuleToggle(): Promise<void> {

View File

@ -152,7 +152,7 @@ export class PaginationComponent extends BaseComponent {
}
async getItemsCount(): Promise<number> {
return await this.page.getByRole('menuitem').count();
return this.page.getByRole('menuitem').count();
}
async clickNthItem(nth: number): Promise<void> {

View File

@ -89,17 +89,7 @@ export class SearchFiltersDate extends BaseComponent {
* @param endDay end day for time-frame search. DD-MMMM-YY
*/
async filterFilesByDate(params: FilterFilesByDateParams) {
const {
searchPage,
filterType,
dateFilterTab,
searchPhrase,
searchType,
expectSearchResults,
inTheLastInputValue,
startDay,
endDay
} = params;
const { searchPage, filterType, dateFilterTab, searchPhrase, searchType, expectSearchResults, inTheLastInputValue, startDay, endDay } = params;
await searchPage.searchWithin(searchPhrase, searchType);
await searchPage.searchFilters.dateFilter.click();

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { Page } from '@playwright/test';
@ -58,10 +58,10 @@ export class SearchSortingPicker extends BaseComponent {
}
async getSortByOptionsList(): Promise<string[]> {
let sortOptionsCount = await this.sortByList.count();
let sortByOptions: string[] = [];
const sortOptionsCount = await this.sortByList.count();
const sortByOptions: string[] = [];
for (let i = 1; i < sortOptionsCount; i++) {
let textContent = (await this.sortByList.nth(i).textContent()).trim();
const textContent = (await this.sortByList.nth(i).textContent()).trim();
sortByOptions.push(textContent);
}
sortByOptions.sort((a, b) => a.localeCompare(b));
@ -76,7 +76,7 @@ export class SearchSortingPicker extends BaseComponent {
await this.clickSortByDropdown();
}
const elem = this.sortByList.getByText(option);
const optionId = await elem.locator("..").getAttribute('id');
const optionId = await elem.locator('..').getAttribute('id');
await elem.click();
const directionSortElement = this.page.locator(`[id="${optionId}-${direction.toLocaleLowerCase()}"]`);
await directionSortElement.click();

View File

@ -59,17 +59,17 @@ export class ViewerComponent extends BaseComponent {
async isViewerOpened(): Promise<boolean> {
await this.waitForViewerToOpen();
return await this.viewerLocator.isVisible();
return this.viewerLocator.isVisible();
}
async isCloseButtonDisplayed(): Promise<boolean> {
await this.closeButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal });
return await this.closeButtonLocator.isEnabled({ timeout: timeouts.normal });
return this.closeButtonLocator.isEnabled({ timeout: timeouts.normal });
}
async isFileTitleDisplayed(): Promise<boolean> {
await this.fileTitleButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal });
return await this.fileTitleButtonLocator.isVisible();
return this.fileTitleButtonLocator.isVisible();
}
async getFileTitle(): Promise<string> {
@ -79,14 +79,14 @@ export class ViewerComponent extends BaseComponent {
async getCloseButtonTooltip(): Promise<string> {
await this.closeButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal });
return await this.closeButtonLocator.getAttribute('title');
return this.closeButtonLocator.getAttribute('title');
}
async verifyViewerPrimaryActions(expectedToolbarPrimary: string[]): Promise<void> {
const toRemove = ['Close', 'Previous File', 'Next File', 'View details'];
const removeClosePreviousNextOldInfo = (actions: string[]): string[] => actions.filter((elem) => !toRemove.includes(elem));
let buttons = await this.page.$$('adf-viewer button');
const buttons = await this.page.$$('adf-viewer button');
let actualPrimaryActions: string[] = await Promise.all(
buttons.map(async (button) => {
const title = await button.getAttribute('title');

View File

@ -24,7 +24,15 @@
import { Page } from '@playwright/test';
import { BasePage } from './base.page';
import { DataTableComponent, MatMenuComponent, ViewerComponent, SidenavComponent, PaginationComponent, Breadcrumb, AdfInfoDrawerComponent } from '../components';
import {
DataTableComponent,
MatMenuComponent,
ViewerComponent,
SidenavComponent,
PaginationComponent,
Breadcrumb,
AdfInfoDrawerComponent
} from '../components';
import { AcaHeader } from '../components/aca-header.component';
import { AdfFolderDialogComponent, ViewerOverlayDialogComponent, ManageVersionsDialog } from '../components/dialogs';

View File

@ -68,8 +68,8 @@ export class LoginPage extends BasePage {
}
async verifyUserLogin(): Promise<void> {
if (this.username.isVisible()) {
await this.page.reload({ waitUntil:"load" });
if (await this.username.isVisible()) {
await this.page.reload({ waitUntil: 'load' });
}
}
}

View File

@ -45,5 +45,4 @@ export class SharedPage extends BasePage {
public breadcrumb = new Breadcrumb(this.page);
public infoDrawer = new AdfInfoDrawerComponent(this.page);
public manageVersionsDialog = new ManageVersionsDialog(this.page);
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
export type ApiResultPredicate<T> = (result: T) => boolean;
@ -40,7 +40,12 @@ export async function waitForApi<T>(apiCall: ApiCall<T>, predicate: ApiResultPre
function retryCall(fn: () => Promise<any>, retry: number = 30, delay: number = 1000): Promise<string> {
const pause = (duration) => new Promise((res) => setTimeout(res, duration));
const run = (retries) => fn().catch((err) => (retries > 1 ? pause(delay).then(() => run(retries - 1)) : Promise.reject(new Error(`API call did not satisfy predicate: ${JSON.stringify(err)}`))));
const run = (retries) =>
fn().catch((err) =>
retries > 1
? pause(delay).then(() => run(retries - 1))
: Promise.reject(new Error(`API call did not satisfy predicate: ${JSON.stringify(err)}`))
);
return run(retry);
}

View File

@ -19,7 +19,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
export const APP_ROUTES = {

View File

@ -23,7 +23,6 @@
*/
export const errorStrings = {
errorMessageNotPresent: 'Error message is not displayed',
nameIsRequiredError: 'Name is required',
nameWithSpecialCharactersError: `Name can't contain these characters * " < > \\ / ? : |`,
@ -38,4 +37,4 @@ export const errorStrings = {
folderNameCantContainTheseCharacters: `Folder name can't contain these characters`,
folderNameCantContainOnlySpaces: `Folder name can't contain only spaces`,
thereIsAlreadyAFolderWithThisName: `There's already a folder with this name. Try a different name.`
}
};

View File

@ -1,9 +1,25 @@
/*
* Copyright © 2005 - 2021 Alfresco Software, Ltd. All rights reserved.
/*!
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* 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/>.
*/
export const getExcludedTestsRegExpArray = (excludedJson: any, projectName: string) => {

View File

@ -24,6 +24,6 @@
export const libraryErrors = {
libraryIdIsNotAvailable: "This Library ID isn't available. Try a different Library ID.",
libraryIdIsAlreadyUsed: "This Library ID is already used. Check the trashcan.",
useNumbersAndLettersOnly: "Use numbers and letters only"
}
libraryIdIsAlreadyUsed: 'This Library ID is already used. Check the trashcan.',
useNumbersAndLettersOnly: 'Use numbers and letters only'
};

View File

@ -29,5 +29,5 @@ export const paths = {
allData: `${rootFolder}/playwright-data`,
files: `${rootFolder}/playwright-data/downloads`,
report: `${rootFolder}/playwright-data/report`,
userStates: `${rootFolder}/playwright-data/user-states`,
userStates: `${rootFolder}/playwright-data/user-states`
};

View File

@ -22,7 +22,6 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { resolve } from 'path';
import { paths } from '.';
import { users } from '../base-config';

View File

@ -0,0 +1,9 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}

View File

@ -36,7 +36,6 @@
"@alfresco/aca-shared/store": ["projects/aca-shared/store/src/public-api.ts"],
"@alfresco/aca-shared/rules": ["projects/aca-shared/rules/src/public-api.ts"],
"@alfresco/aca-content/ms-office": ["projects/aca-content/ms-office/src/public-api.ts"],
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared/src/index.ts"],
"@alfresco/aca-content/about": ["projects/aca-content/about/src/public-api.ts"],
"@alfresco/aca-content/folder-rules": ["projects/aca-content/folder-rules/src/public-api.ts"],
"@alfresco/aca-content": ["projects/aca-content/src/public-api.ts"],

View File

@ -30,7 +30,6 @@
"@alfresco/aca-shared": ["projects/aca-shared/src/public-api.ts"],
"@alfresco/aca-shared/rules": ["projects/aca-shared/rules/src/public-api.ts"],
"@alfresco/aca-shared/store": ["projects/aca-shared/store/src/public-api.ts"],
"@alfresco/aca-testing-shared": ["projects/aca-testing-shared/src/index.ts"],
"@alfresco/playwright-shared": ["projects/aca-playwright-shared/src/index.ts"],
"package.json": ["package.json"]
}