[ACS-11855] include e2es lithium (#5194)

* [ACS-11855] included some e2es + small refactoring / improvements

* [ACS-11855] more tests include

* [ACS-11855] sonar cloud fix 1

* [ACS-11855] copilot review fixes 1

* [ACS-11855] copilot review fixes 2

* [ACS-11855] small tests fixes or improvements

* [ACS-11855] fixed failing tests

* [ACS-11855] sonar cloud fix

* [ACS-11855] sonar cloud fix 2

* [ACS-11855] more search improvements

* [ACS-11855] review fix 1

* [ACS-11855] review fix 2

* [ACS-11855] more small improvements
This commit is contained in:
Adam Świderski
2026-05-21 12:24:45 +02:00
committed by GitHub
parent c67b4dc203
commit aa03f7d005
35 changed files with 84 additions and 128 deletions
@@ -1,5 +1,3 @@
{ {
"all": { "all": {}
"XAT-5127": "https://hyland.atlassian.net/browse/ACS-10952"
}
} }
@@ -317,7 +317,7 @@ test.describe('Create file from template', () => {
const snackBar = personalFiles.snackBar; const snackBar = personalFiles.snackBar;
await createFileFromTemplateDialog.createFromTemplateAction(commonFileName); await createFileFromTemplateDialog.createFromTemplateAction(commonFileName);
await expect(snackBar.getByMessageLocator(errorStrings.nameAlreadyUsedError)).toBeVisible(); expect(await snackBar.getSnackBarMessage()).toContain(errorStrings.nameAlreadyUsedError);
await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
}); });
@@ -414,7 +414,7 @@ test.describe('Create file from template', () => {
const snackBar = myLibrariesPage.snackBar; const snackBar = myLibrariesPage.snackBar;
await createFileFromTemplateDialog.createFromTemplateAction(commonFileName); await createFileFromTemplateDialog.createFromTemplateAction(commonFileName);
await expect(snackBar.getByMessageLocator(errorStrings.nameAlreadyUsedError)).toBeVisible(); expect(await snackBar.getSnackBarMessage()).toContain(errorStrings.nameAlreadyUsedError);
await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
}); });
}); });
@@ -344,7 +344,7 @@ test.describe('Create folder from template', () => {
const snackBar = personalFiles.snackBar; const snackBar = personalFiles.snackBar;
await createFolderFromTemplateDialog.createFromTemplateAction(commonFolderName); await createFolderFromTemplateDialog.createFromTemplateAction(commonFolderName);
await expect(snackBar.getByMessageLocator(errorStrings.nameAlreadyUsedError)).toBeVisible(); expect(await snackBar.getSnackBarMessage()).toContain(errorStrings.nameAlreadyUsedError);
await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
}); });
@@ -460,7 +460,7 @@ test.describe('Create folder from template', () => {
const snackBar = myLibrariesPage.snackBar; const snackBar = myLibrariesPage.snackBar;
await createFolderFromTemplateDialog.createFromTemplateAction(commonFolderName); await createFolderFromTemplateDialog.createFromTemplateAction(commonFolderName);
await expect(snackBar.getByMessageLocator(errorStrings.nameAlreadyUsedError)).toBeVisible(); expect(await snackBar.getSnackBarMessage()).toContain(errorStrings.nameAlreadyUsedError);
await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
}); });
}); });
@@ -138,7 +138,7 @@ test.describe('Create folders', () => {
await folderDialog.createNewFolderDialog(commonFolderName); await folderDialog.createNewFolderDialog(commonFolderName);
await expect(folderSnackBar.getByMessageLocator(errorStrings.thereIsAlreadyAFolderWithThisName)).toBeVisible(); expect(await folderSnackBar.getSnackBarMessage()).toContain(errorStrings.thereIsAlreadyAFolderWithThisName);
}); });
test.describe('On Personal Files dataTable', () => { test.describe('On Personal Files dataTable', () => {
@@ -167,7 +167,7 @@ test.describe('Create folders', () => {
test('[XAT-17591] Duplicate folder name - can create folder with a new name', async ({ personalFiles }) => { test('[XAT-17591] Duplicate folder name - can create folder with a new name', async ({ personalFiles }) => {
const folderSnackBar = personalFiles.snackBar; const folderSnackBar = personalFiles.snackBar;
await folderDialog.createNewFolderDialog(commonFolderName); await folderDialog.createNewFolderDialog(commonFolderName);
await expect(folderSnackBar.getByMessageLocator(errorStrings.thereIsAlreadyAFolderWithThisName)).toBeVisible(); expect(await folderSnackBar.getSnackBarMessage()).toContain(errorStrings.thereIsAlreadyAFolderWithThisName);
await folderDialog.createNewFolderDialog(newFolderName); await folderDialog.createNewFolderDialog(newFolderName);
await expect(folderTable.getRowByName(newFolderName)).toBeVisible(); await expect(folderTable.getRowByName(newFolderName)).toBeVisible();
}); });
@@ -113,8 +113,7 @@ test.describe('Restore from Trash', () => {
await trashPage.dataTable.selectItems(file2, folder2); await trashPage.dataTable.selectItems(file2, folder2);
await trashPage.acaHeader.restoreButton.click(); await trashPage.acaHeader.restoreButton.click();
await trashPage.snackBar.verifySnackBarActionText(`Restore successful`); await trashPage.snackBar.verifySnackBarActionText(`Restore successful`);
const action = await trashPage.snackBar.getSnackBarActionText(); await trashPage.navigate();
expect(action).not.toContain('View');
expect(await trashPage.dataTable.isItemPresent(file2)).toBe(false); expect(await trashPage.dataTable.isItemPresent(file2)).toBe(false);
expect(await trashPage.dataTable.isItemPresent(folder2)).toBe(false); expect(await trashPage.dataTable.isItemPresent(folder2)).toBe(false);
await personalFiles.navigate(); await personalFiles.navigate();
@@ -1,8 +1,5 @@
{ {
"all": { "all": {},
"XAT-897": "https://hyland.atlassian.net/browse/ACS-5503",
"XAT-907": "https://hyland.atlassian.net/browse/ACS-10486"
},
"webkit": { "webkit": {
"XAT-888": "https://hyland.atlassian.net/browse/ACS-10917" "XAT-888": "https://hyland.atlassian.net/browse/ACS-10917"
} }
@@ -35,6 +35,7 @@ test.describe('Rules - Manage Rules', () => {
const username = `user-e2e-${Utils.random()}`; const username = `user-e2e-${Utils.random()}`;
const folderName897_1 = `folder-XAT-897-1-${Utils.random()}`; const folderName897_1 = `folder-XAT-897-1-${Utils.random()}`;
const folderName897_2 = `folder-XAT-897-2-${Utils.random()}`; const folderName897_2 = `folder-XAT-897-2-${Utils.random()}`;
const folderName897_3 = `folder-XAT-897-3-${Utils.random()}`;
const folderName898 = `folder-XAT-898-${Utils.random()}`; const folderName898 = `folder-XAT-898-${Utils.random()}`;
const folderName899 = `folder-XAT-899-${Utils.random()}`; const folderName899 = `folder-XAT-899-${Utils.random()}`;
const folderName900 = `folder-XAT-900-${Utils.random()}`; const folderName900 = `folder-XAT-900-${Utils.random()}`;
@@ -72,6 +73,7 @@ test.describe('Rules - Manage Rules', () => {
await apiClientFactory.setUpAcaBackend(username, username); await apiClientFactory.setUpAcaBackend(username, username);
folderName897Id1 = (await nodesApi.createFolder(folderName897_1)).entry.id; folderName897Id1 = (await nodesApi.createFolder(folderName897_1)).entry.id;
folderName897Id2 = (await nodesApi.createFolder(folderName897_2)).entry.id; folderName897Id2 = (await nodesApi.createFolder(folderName897_2)).entry.id;
await nodesApi.createFolder(folderName897_3, folderName897Id1);
folderId898 = (await nodesApi.createFolder(folderName898)).entry.id; folderId898 = (await nodesApi.createFolder(folderName898)).entry.id;
folderId899 = (await nodesApi.createFolder(folderName899)).entry.id; folderId899 = (await nodesApi.createFolder(folderName899)).entry.id;
folderId900 = (await nodesApi.createFolder(folderName900)).entry.id; folderId900 = (await nodesApi.createFolder(folderName900)).entry.id;
@@ -101,9 +103,16 @@ test.describe('Rules - Manage Rules', () => {
test('[XAT-897] Update a rule which has an error in its action', async ({ personalFiles, nodesPage }) => { test('[XAT-897] Update a rule which has an error in its action', async ({ personalFiles, nodesPage }) => {
await personalFiles.dataTable.performActionFromExpandableMenu(folderName897_1, 'Manage rules'); await personalFiles.dataTable.performActionFromExpandableMenu(folderName897_1, 'Manage rules');
await nodesPage.manageRules.turnOffRuleToggle(); await nodesPage.manageRules.turnOffRuleToggle('skip expect');
expect(await personalFiles.snackBar.getSnackBarMessage()).toContain('no longer exists');
await nodesPage.manageRules.ruleDetailsEditButton.click(); await nodesPage.manageRules.ruleDetailsEditButton.click();
await expect(nodesPage.manageRulesDialog.ruleDisableCheckbox).toBeChecked(); await nodesPage.manageRulesDialog.destinationFolderButton.click();
await nodesPage.contentNodeSelectorDialog.selectDestination(folderName897_3);
await nodesPage.contentNodeSelectorDialog.actionButton.click();
const waitForRuleSets = Utils.waitForApiResponse(personalFiles, 'rule-sets', 200);
await nodesPage.manageRulesDialog.createRuleButton.click();
await Promise.all([waitForRuleSets, nodesPage.manageRules.turnOffRuleToggle()]);
await expect(nodesPage.manageRules.ruleToggleFalse).toBeVisible();
}); });
test('[XAT-898] Cancel updating rule dialog', async ({ personalFiles, nodesPage }) => { test('[XAT-898] Cancel updating rule dialog', async ({ personalFiles, nodesPage }) => {
@@ -1,6 +1,3 @@
{ {
"all": { "all": {}
"XAT-5523": "https://hyland.atlassian.net/browse/ACA-4697",
"XAT-5516": "https://hyland.atlassian.net/browse/ACS-9889"
}
} }
@@ -32,8 +32,7 @@ import {
NodesApi, NodesApi,
FileActionsApi, FileActionsApi,
SitesApi, SitesApi,
MyLibrariesPage, MyLibrariesPage
timeouts
} from '@alfresco/aca-playwright-shared'; } from '@alfresco/aca-playwright-shared';
import { Site } from '@alfresco/js-api'; import { Site } from '@alfresco/js-api';
@@ -95,6 +94,7 @@ test.describe('Info Drawer - Comments', () => {
await expect(favoritePage.infoDrawer.commentInputField).toBeVisible(); await expect(favoritePage.infoDrawer.commentInputField).toBeVisible();
await favoritePage.infoDrawer.addCommentToNode(commentText); await favoritePage.infoDrawer.addCommentToNode(commentText);
await expect(favoritePage.infoDrawer.addCommentButton).toBeDisabled(); await expect(favoritePage.infoDrawer.addCommentButton).toBeDisabled();
await favoritePage.infoDrawer.waitForComments();
expect(await favoritePage.infoDrawer.getCommentsCountFromList()).toEqual(1); expect(await favoritePage.infoDrawer.getCommentsCountFromList()).toEqual(1);
}); });
@@ -131,6 +131,7 @@ test.describe('Info Drawer - Comments', () => {
await expect(recentFilesPage.infoDrawer.commentInputField).toBeVisible(); await expect(recentFilesPage.infoDrawer.commentInputField).toBeVisible();
await recentFilesPage.infoDrawer.addCommentToNode(commentText); await recentFilesPage.infoDrawer.addCommentToNode(commentText);
await expect(recentFilesPage.infoDrawer.addCommentButton).toBeDisabled(); await expect(recentFilesPage.infoDrawer.addCommentButton).toBeDisabled();
await recentFilesPage.infoDrawer.waitForComments();
expect(await recentFilesPage.infoDrawer.getCommentsCountFromList()).toEqual(1); expect(await recentFilesPage.infoDrawer.getCommentsCountFromList()).toEqual(1);
}); });
@@ -160,11 +161,8 @@ test.describe('Info Drawer - Comments - Sites Privileges', () => {
let fileActionsApi1: FileActionsApi; let fileActionsApi1: FileActionsApi;
let sitesApi1: SitesApi; let sitesApi1: SitesApi;
let siteEntry5522: Site; let siteEntry5522: Site;
let siteEntry5523: Site;
const siteName5522 = `site-e2e-${Utils.random()}`; const siteName5522 = `site-e2e-${Utils.random()}`;
const siteName5523 = `site-e2e-${Utils.random()}`;
const folderName5522 = `folder-e2e-${Utils.random()}`; const folderName5522 = `folder-e2e-${Utils.random()}`;
const folderName5523 = `folder-e2e-${Utils.random()}`;
const username1 = `user-e2e-${Utils.random()}`; const username1 = `user-e2e-${Utils.random()}`;
const username2 = `user-e2e-${Utils.random()}`; const username2 = `user-e2e-${Utils.random()}`;
@@ -189,16 +187,9 @@ test.describe('Info Drawer - Comments - Sites Privileges', () => {
siteEntry5522 = (await sitesApi1.createSite(siteName5522, Site.VisibilityEnum.PRIVATE)).entry; siteEntry5522 = (await sitesApi1.createSite(siteName5522, Site.VisibilityEnum.PRIVATE)).entry;
await sitesApi1.addSiteMember(siteEntry5522.id, username2, 'SiteConsumer'); await sitesApi1.addSiteMember(siteEntry5522.id, username2, 'SiteConsumer');
siteEntry5523 = (await sitesApi1.createSite(siteName5523, Site.VisibilityEnum.PRIVATE)).entry;
await sitesApi1.addSiteMember(siteEntry5523.id, username2, 'SiteContributor');
const documentLibraryId1 = await nodesApi1.getNodeIdFromParent('documentLibrary', siteEntry5522.guid); const documentLibraryId1 = await nodesApi1.getNodeIdFromParent('documentLibrary', siteEntry5522.guid);
await nodesApi1.createFolder(folderName5522, documentLibraryId1); await nodesApi1.createFolder(folderName5522, documentLibraryId1);
await fileActionsApi1.waitForNodes(folderName5522, { expect: 1 }); await fileActionsApi1.waitForNodes(folderName5522, { expect: 1 });
const documentLibraryId2 = await nodesApi1.getNodeIdFromParent('documentLibrary', siteEntry5523.guid);
await nodesApi1.createFolder(folderName5523, documentLibraryId2);
await fileActionsApi1.waitForNodes(folderName5523, { expect: 1 });
} catch (error) { } catch (error) {
console.error(`beforeAll failed : ${error}`); console.error(`beforeAll failed : ${error}`);
} }
@@ -218,15 +209,4 @@ test.describe('Info Drawer - Comments - Sites Privileges', () => {
await expect(myLibrariesPage.infoDrawer.commentInputField).toBeHidden(); await expect(myLibrariesPage.infoDrawer.commentInputField).toBeHidden();
await expect(myLibrariesPage.infoDrawer.addCommentButton).toBeHidden(); await expect(myLibrariesPage.infoDrawer.addCommentButton).toBeHidden();
}); });
test('[XAT-5523] Contributor can add comments', async ({ myLibrariesPage }) => {
await navigateToFolderAndOpenCommentsTab(myLibrariesPage, siteEntry5523.guid, folderName5523);
await expect(myLibrariesPage.infoDrawer.commentsHeader).toBeVisible();
await expect(myLibrariesPage.infoDrawer.commentInputField).toBeVisible();
await expect(myLibrariesPage.infoDrawer.addCommentButton).toBeVisible();
await myLibrariesPage.infoDrawer.commentInputField.fill(`e2e-comment-${Utils.random()}`);
await myLibrariesPage.infoDrawer.addCommentButton.click();
await myLibrariesPage.infoDrawer.commentsList.first().waitFor({ timeout: timeouts.medium });
await expect(myLibrariesPage.infoDrawer.commentsList).toHaveCount(1);
});
}); });
@@ -1,6 +1,3 @@
{ {
"all": { "all": {}
"XAT-5139": "https://hyland.atlassian.net/browse/ACS-11573",
"XAT-5138": "https://hyland.atlassian.net/browse/ACS-11573"
}
} }
@@ -48,7 +48,7 @@ test.describe('Library actions ', () => {
const libraryJoinedMessage = 'Library joined'; const libraryJoinedMessage = 'Library joined';
const requestToJoinMessage = 'Request sent to join this library'; const requestToJoinMessage = 'Request sent to join this library';
const cancelJoinRequestButton = 'Cancel Join Request'; const cancelJoinRequestButton = 'Cancel Join Request';
const cancelJoinRequestMessage = 'Canceled the request to join the library'; const cancelJoinRequestMessage = 'Cancelled the request to join the library';
const leaveLibraryButton = 'Leave Library'; const leaveLibraryButton = 'Leave Library';
const leftMessage = 'You have left the library'; const leftMessage = 'You have left the library';
const favoriteButton = 'Favorite'; const favoriteButton = 'Favorite';
@@ -183,7 +183,7 @@ test.describe('Library actions ', () => {
await expect.soft(confirmDialog.okButton).toBeVisible(); await expect.soft(confirmDialog.okButton).toBeVisible();
await expect.soft(confirmDialog.cancelButton).toBeVisible(); await expect.soft(confirmDialog.cancelButton).toBeVisible();
await confirmDialog.okButton.click(); await confirmDialog.okButton.click();
await expect.soft(snackBar.getByMessageLocator(leftMessage)).toBeVisible(); expect.soft(await snackBar.getSnackBarMessage()).toContain(leftMessage);
await expect(libraryTable.getRowByName(user1Library1)).toBeHidden(); await expect(libraryTable.getRowByName(user1Library1)).toBeHidden();
}); });
@@ -198,7 +198,7 @@ test.describe('Library actions ', () => {
await expect(libraryTable.getCellByColumnNameAndRowItem(user2Library1, managerRole)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(user2Library1, managerRole)).toBeVisible();
await libraryTable.performActionFromExpandableMenu(user2Library1, leaveLibraryButton); await libraryTable.performActionFromExpandableMenu(user2Library1, leaveLibraryButton);
await confirmDialog.okButton.click(); await confirmDialog.okButton.click();
await expect.soft(snackBar.getByMessageLocator('Cannot leave this library')).toBeVisible(); expect.soft(await snackBar.getSnackBarMessage()).toContain('Cannot leave this library');
await expect(libraryTable.getCellByColumnNameAndRowItem(user2Library1, managerRole)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(user2Library1, managerRole)).toBeVisible();
}); });
@@ -228,7 +228,7 @@ test.describe('Library actions ', () => {
await libraryTable.getRowByName(user2Library5Delete).click(); await libraryTable.getRowByName(user2Library5Delete).click();
await myLibrariesHeader.clickMoreActions(); await myLibrariesHeader.clickMoreActions();
await libraryMenu.clickMenuItem(deleteButton); await libraryMenu.clickMenuItem(deleteButton);
await expect.soft(snackBar.getByMessageLocator(libraryDeletedMessage)).toBeVisible(); expect.soft(await snackBar.getSnackBarMessage()).toContain(libraryDeletedMessage);
await expect(libraryTable.getRowByName(user2Library5Delete)).toBeHidden(); await expect(libraryTable.getRowByName(user2Library5Delete)).toBeHidden();
await trashPage.navigate({ waitUntil: loadString }); await trashPage.navigate({ waitUntil: loadString });
await expect(trashTable.getRowByName(user2Library5Delete)).toBeVisible(); await expect(trashTable.getRowByName(user2Library5Delete)).toBeVisible();
@@ -254,7 +254,7 @@ test.describe('Library actions ', () => {
await favoritesApi.addFavoriteById(siteString, adminLibrary1); await favoritesApi.addFavoriteById(siteString, adminLibrary1);
await favoriteLibrariesPage.navigate(); await favoriteLibrariesPage.navigate();
await libraryTable.performActionFromExpandableMenu(adminLibrary1, joinButton); await libraryTable.performActionFromExpandableMenu(adminLibrary1, joinButton);
await expect.soft(snackBar.getByMessageLocator(libraryJoinedMessage)).toBeVisible(); expect.soft(await snackBar.getSnackBarMessage()).toContain(libraryJoinedMessage);
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary1, consumerRole)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary1, consumerRole)).toBeVisible();
}); });
@@ -263,7 +263,7 @@ test.describe('Library actions ', () => {
await favoriteLibrariesPage.navigate(); await favoriteLibrariesPage.navigate();
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible();
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary1, joinButton); await libraryTable.performActionFromExpandableMenu(adminModerateLibrary1, joinButton);
await expect.soft(snackBar.getByMessageLocator(requestToJoinMessage)).toBeVisible(); expect.soft(await snackBar.getSnackBarMessage()).toContain(requestToJoinMessage);
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible();
await adminSitesApi.approveSiteMembershipRequest(adminModerateLibrary1, username2); await adminSitesApi.approveSiteMembershipRequest(adminModerateLibrary1, username2);
await favoriteLibrariesPage.page.reload({ waitUntil: 'load' }); await favoriteLibrariesPage.page.reload({ waitUntil: 'load' });
@@ -277,7 +277,7 @@ test.describe('Library actions ', () => {
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library2, contributorRole)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library2, contributorRole)).toBeVisible();
await libraryTable.performActionFromExpandableMenu(user1Library2, leaveLibraryButton); await libraryTable.performActionFromExpandableMenu(user1Library2, leaveLibraryButton);
await confirmDialog.okButton.click(); await confirmDialog.okButton.click();
await expect.soft(snackBar.getByMessageLocator(leftMessage)).toBeVisible(); expect.soft(await snackBar.getSnackBarMessage()).toContain(leftMessage);
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library2, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library2, notMemberString)).toBeVisible();
}); });
@@ -288,7 +288,7 @@ test.describe('Library actions ', () => {
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary3, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary3, notMemberString)).toBeVisible();
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary3, cancelJoinRequestButton); await libraryTable.performActionFromExpandableMenu(adminModerateLibrary3, cancelJoinRequestButton);
await expect.soft(snackBar.getByMessageLocator(cancelJoinRequestMessage)).toBeVisible(); expect.soft(await snackBar.getSnackBarMessage()).toContain(cancelJoinRequestMessage);
const hasJoinRequest = await user2SitesApi.hasMembershipRequest(username2, adminModerateLibrary3); const hasJoinRequest = await user2SitesApi.hasMembershipRequest(username2, adminModerateLibrary3);
expect(hasJoinRequest).toBe(false); expect(hasJoinRequest).toBe(false);
}); });
@@ -315,7 +315,7 @@ test.describe('Library actions ', () => {
await libraryTable.getRowByName(user2Library6Delete).click(); await libraryTable.getRowByName(user2Library6Delete).click();
await myLibrariesHeader.clickMoreActions(); await myLibrariesHeader.clickMoreActions();
await libraryMenu.clickMenuItem(deleteButton); await libraryMenu.clickMenuItem(deleteButton);
await expect.soft(snackBar.getByMessageLocator(libraryDeletedMessage)).toBeVisible(); expect.soft(await snackBar.getSnackBarMessage()).toContain(libraryDeletedMessage);
await expect(libraryTable.getRowByName(user2Library6Delete)).toBeHidden(); await expect(libraryTable.getRowByName(user2Library6Delete)).toBeHidden();
await trashPage.navigate({ waitUntil: loadString }); await trashPage.navigate({ waitUntil: loadString });
await expect(trashTable.getRowByName(user2Library6Delete)).toBeVisible(); await expect(trashTable.getRowByName(user2Library6Delete)).toBeVisible();
@@ -324,12 +324,10 @@ test.describe('Library actions ', () => {
test.describe('Search Page', () => { test.describe('Search Page', () => {
let libraryTable: DataTableComponent; let libraryTable: DataTableComponent;
let snackBar: SnackBarComponent;
test.beforeEach(async ({ searchPage }) => { test.beforeEach(async ({ searchPage }) => {
try { try {
libraryTable = searchPage.dataTable; libraryTable = searchPage.dataTable;
snackBar = searchPage.snackBar;
} catch (error) { } catch (error) {
console.error(`Search Page, beforeEach failed : ${error}`); console.error(`Search Page, beforeEach failed : ${error}`);
} }
@@ -340,7 +338,7 @@ test.describe('Library actions ', () => {
await searchPage.reload({ waitUntil: loadString }); await searchPage.reload({ waitUntil: loadString });
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary2, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary2, notMemberString)).toBeVisible();
await libraryTable.performActionFromExpandableMenu(adminLibrary2, joinButton); await libraryTable.performActionFromExpandableMenu(adminLibrary2, joinButton);
await expect.soft(snackBar.getByMessageLocator(libraryJoinedMessage)).toBeVisible(); expect.soft(await searchPage.snackBar.getSnackBarMessage()).toContain(libraryJoinedMessage);
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary2, consumerRole)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary2, consumerRole)).toBeVisible();
}); });
@@ -348,7 +346,7 @@ test.describe('Library actions ', () => {
await searchPage.searchWithin(adminModerateLibrary2, 'libraries'); await searchPage.searchWithin(adminModerateLibrary2, 'libraries');
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary2, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary2, notMemberString)).toBeVisible();
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary2, joinButton); await libraryTable.performActionFromExpandableMenu(adminModerateLibrary2, joinButton);
await expect.soft(snackBar.getByMessageLocator(requestToJoinMessage)).toBeVisible(); expect.soft(await searchPage.snackBar.getSnackBarMessage()).toContain(requestToJoinMessage);
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary2, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary2, notMemberString)).toBeVisible();
await adminSitesApi.approveSiteMembershipRequest(adminModerateLibrary2, username2); await adminSitesApi.approveSiteMembershipRequest(adminModerateLibrary2, username2);
await myLibrariesPage.navigate(); await myLibrariesPage.navigate();
@@ -362,7 +360,7 @@ test.describe('Library actions ', () => {
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library3, 'Collaborator')).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library3, 'Collaborator')).toBeVisible();
await libraryTable.performActionFromExpandableMenu(user1Library3, leaveLibraryButton); await libraryTable.performActionFromExpandableMenu(user1Library3, leaveLibraryButton);
await confirmDialog.okButton.click(); await confirmDialog.okButton.click();
await expect.soft(snackBar.getByMessageLocator(leftMessage)).toBeVisible(); expect.soft(await searchPage.snackBar.getSnackBarMessage()).toContain(leftMessage);
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library3, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library3, notMemberString)).toBeVisible();
}); });
@@ -371,9 +369,8 @@ test.describe('Library actions ', () => {
await searchPage.searchWithin(adminModerateLibrary4, 'libraries'); await searchPage.searchWithin(adminModerateLibrary4, 'libraries');
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary4, notMemberString)).toBeVisible(); await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary4, notMemberString)).toBeVisible();
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary4, cancelJoinRequestButton); await libraryTable.performActionFromExpandableMenu(adminModerateLibrary4, cancelJoinRequestButton);
await expect.soft(snackBar.getByMessageLocator(cancelJoinRequestMessage)).toBeVisible(); expect.soft(await searchPage.snackBar.getSnackBarMessage()).toContain(cancelJoinRequestMessage);
const hasJoinRequest = await user2SitesApi.hasMembershipRequest(username2, adminModerateLibrary4); expect(await user2SitesApi.hasMembershipRequest(username2, adminModerateLibrary4)).toBe(false);
expect(hasJoinRequest).toBe(false);
}); });
test('[XAT-5141] Mark a library as favorite - from Search Results', async ({ myLibrariesPage, searchPage }) => { test('[XAT-5141] Mark a library as favorite - from Search Results', async ({ myLibrariesPage, searchPage }) => {
@@ -415,7 +412,7 @@ test.describe('Library actions ', () => {
await libraryTable.getRowByName(user2Library7Delete).click(); await libraryTable.getRowByName(user2Library7Delete).click();
await searchHeader.clickMoreActions(); await searchHeader.clickMoreActions();
await libraryMenu.clickMenuItem(deleteButton); await libraryMenu.clickMenuItem(deleteButton);
await expect.soft(snackBar.getByMessageLocator(libraryDeletedMessage)).toBeVisible(); expect.soft(await searchPage.snackBar.getSnackBarMessage()).toContain(libraryDeletedMessage);
await expect(libraryTable.getRowByName(user2Library7Delete)).toBeHidden(); await expect(libraryTable.getRowByName(user2Library7Delete)).toBeHidden();
await trashPage.navigate({ waitUntil: loadString }); await trashPage.navigate({ waitUntil: loadString });
await expect(trashTable.getRowByName(user2Library7Delete)).toBeVisible(); await expect(trashTable.getRowByName(user2Library7Delete)).toBeVisible();
+1 -2
View File
@@ -1,7 +1,6 @@
{ {
"all": { "all": {
"XAT-4525": "https://hyland.atlassian.net/browse/ACS-9741", "XAT-4525": "https://hyland.atlassian.net/browse/ACS-9741"
"XAT-4420": "https://hyland.atlassian.net/browse/ACS-10952"
}, },
"firefox": { "firefox": {
"XAT-4455": "https://hyland.atlassian.net/browse/ACS-10917" "XAT-4455": "https://hyland.atlassian.net/browse/ACS-10917"
@@ -57,7 +57,7 @@ test.describe('File Libraries', () => {
const siteDescription = 'my site description'; const siteDescription = 'my site description';
await siteActionsUser.createSite(userSitePublic, Site.VisibilityEnum.PUBLIC); await siteActionsUser.createSite(userSitePublic, Site.VisibilityEnum.PUBLIC);
await siteActionsUser.createSite(userSiteModerated, Site.VisibilityEnum.MODERATED, siteDescription); await siteActionsUser.createSite(userSiteModerated, Site.VisibilityEnum.MODERATED, siteDescription);
await siteActionsUser.createSite(userSitePrivate, Site.VisibilityEnum.PRIVATE, null); await siteActionsUser.createSite(userSitePrivate, Site.VisibilityEnum.PRIVATE);
await siteActionsAdmin.createSite(adminSite1, Site.VisibilityEnum.PUBLIC); await siteActionsAdmin.createSite(adminSite1, Site.VisibilityEnum.PUBLIC);
await siteActionsAdmin.createSite(adminSite2, Site.VisibilityEnum.PUBLIC); await siteActionsAdmin.createSite(adminSite2, Site.VisibilityEnum.PUBLIC);
@@ -75,8 +75,8 @@ test.describe('File Libraries', () => {
await favoritesActions.addFavoriteById('site', adminSite3); await favoritesActions.addFavoriteById('site', adminSite3);
await favoritesActions.addFavoriteById('site', adminSite4); await favoritesActions.addFavoriteById('site', adminSite4);
await siteActionsUser.createSite(siteName, Site.VisibilityEnum.PUBLIC, null, siteId1); await siteActionsUser.createSite(siteName, Site.VisibilityEnum.PUBLIC, undefined, siteId1);
await siteActionsUser.createSite(siteName, Site.VisibilityEnum.PUBLIC, null, siteId2); await siteActionsUser.createSite(siteName, Site.VisibilityEnum.PUBLIC, undefined, siteId2);
} catch (error) { } catch (error) {
console.error(`----- beforeAll failed : ${error}`); console.error(`----- beforeAll failed : ${error}`);
} }
+1 -3
View File
@@ -1,7 +1,5 @@
{ {
"all": { "all": {
"XAT-17697": "https://hyland.atlassian.net/browse/ACS-7464", "XAT-17697": "https://hyland.atlassian.net/browse/ACS-7464"
"XAT-17121": "https://hyland.atlassian.net/browse/ACS-9889",
"XAT-5602": "https://hyland.atlassian.net/browse/ACS-10384"
} }
} }
@@ -52,7 +52,7 @@ test.describe('Search Highlighting', () => {
trashcanApi = await TrashcanApi.initialize(username, username); trashcanApi = await TrashcanApi.initialize(username, username);
fileActionsApi = await FileActionsApi.initialize(username, username); fileActionsApi = await FileActionsApi.initialize(username, username);
await nodesApi.createFile(fileNameHighlight, '-my-'); await nodesApi.createFile(fileNameHighlight, '-my-');
await nodesApi.createFile(fileDescriptionHighlight, '-my-', null, fileDescription); await nodesApi.createFile(fileDescriptionHighlight, '-my-', undefined, fileDescription);
await fileActionsApi.uploadFileWithRename(TEST_FILES.PDF.path, fileContentHighlight); await fileActionsApi.uploadFileWithRename(TEST_FILES.PDF.path, fileContentHighlight);
await fileActionsApi.waitForNodesSearchHighlight(fileContentHighlight, { expect: 1 }); await fileActionsApi.waitForNodesSearchHighlight(fileContentHighlight, { expect: 1 });
@@ -67,13 +67,11 @@ test.describe('Search Highlighting', () => {
test('[XAT-17119] Matching phrases should be highlighted in the file name for search results', async ({ searchPage }) => { test('[XAT-17119] Matching phrases should be highlighted in the file name for search results', async ({ searchPage }) => {
await searchPage.searchWithin(fileNameHighlight, 'files'); await searchPage.searchWithin(fileNameHighlight, 'files');
await searchPage.dataTable.spinnerWaitForReload();
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(true); expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(true);
}); });
test('[XAT-17120] Matching phrases should be highlighted in the file description for search results', async ({ searchPage }) => { test('[XAT-17120] Matching phrases should be highlighted in the file description for search results', async ({ searchPage }) => {
await searchPage.searchWithin(fileDescription, 'files'); await searchPage.searchWithin(fileDescription, 'files');
await searchPage.dataTable.spinnerWaitForReload();
expect(await searchPage.dataTable.hasHighlightedText('description')).toBe(true); expect(await searchPage.dataTable.hasHighlightedText('description')).toBe(true);
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false); expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false);
}); });
@@ -81,7 +79,6 @@ test.describe('Search Highlighting', () => {
test('[XAT-17121] Matching phrases should be highlighted in the file content for search results', async ({ searchPage, personalFiles }) => { test('[XAT-17121] Matching phrases should be highlighted in the file content for search results', async ({ searchPage, personalFiles }) => {
await personalFiles.navigate(); await personalFiles.navigate();
await searchPage.searchWithin(fileContent, 'files'); await searchPage.searchWithin(fileContent, 'files');
await searchPage.dataTable.spinnerWaitForReload();
expect(await searchPage.dataTable.hasHighlightedText('content')).toBe(true); expect(await searchPage.dataTable.hasHighlightedText('content')).toBe(true);
expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false); expect(await searchPage.dataTable.hasHighlightedText('name')).toBe(false);
}); });
@@ -31,10 +31,10 @@ test.describe('Search Results - General', () => {
let sitesApi: SitesApi; let sitesApi: SitesApi;
const random = Utils.random(); const random = Utils.random();
const username = `user1-${random}`; const username = `${random}-user1`;
const file = `test-file-${random}.txt`; const file = `${random}-jsbwf-file.txt`;
const folder = `test-folder-${random}`; const site = `${random}-vbcmw-site`;
const site = `test-site-${random}`; const folder = `${random}-prnww-folder`;
test.beforeAll(async () => { test.beforeAll(async () => {
try { try {
@@ -61,7 +61,7 @@ test.describe('Search Results - General', () => {
}); });
test('[XAT-5605] Files and folders are returned when both Files and Folders options are checked', async ({ searchPage }) => { test('[XAT-5605] Files and folders are returned when both Files and Folders options are checked', async ({ searchPage }) => {
await searchPage.searchWithin(`*${random}`, 'filesAndFolders'); await searchPage.searchWithin(`${random}`, 'filesAndFolders');
expect(await searchPage.dataTable.isItemPresent(file)).toBe(true); expect(await searchPage.dataTable.isItemPresent(file)).toBe(true);
expect(await searchPage.dataTable.isItemPresent(folder)).toBe(true); expect(await searchPage.dataTable.isItemPresent(folder)).toBe(true);
@@ -69,7 +69,7 @@ test.describe('Search Results - General', () => {
}); });
test('[XAT-5593] Only libraries are returned when Libraries option is checked', async ({ searchPage }) => { test('[XAT-5593] Only libraries are returned when Libraries option is checked', async ({ searchPage }) => {
await searchPage.searchWithin(`*${random}`, 'libraries'); await searchPage.searchWithin(`${random}`, 'libraries');
expect(await searchPage.dataTable.isItemPresent(file)).toBe(false); expect(await searchPage.dataTable.isItemPresent(file)).toBe(false);
expect(await searchPage.dataTable.isItemPresent(folder)).toBe(false); expect(await searchPage.dataTable.isItemPresent(folder)).toBe(false);
@@ -114,10 +114,10 @@ test.describe('Search Results - General', () => {
nodesApi = await NodesApi.initialize(username, username); nodesApi = await NodesApi.initialize(username, username);
sitesAdminApi = await SitesApi.initialize('admin'); sitesAdminApi = await SitesApi.initialize('admin');
await sitesApi.createSite(site1.name, null, null, site1.id); await sitesApi.createSite(site1.name, undefined, undefined, site1.id);
await sitesApi.createSite(site2.name, null, null, site2.id); await sitesApi.createSite(site2.name, undefined, undefined, site2.id);
await sitesApi.createSite(site3.name, null, null, site3.id); await sitesApi.createSite(site3.name, undefined, undefined, site3.id);
await sitesApi.createSite(site4.name, null, site4.description, site4.id); await sitesApi.createSite(site4.name, undefined, site4.description, site4.id);
await sitesApi.createSite(userSitePublic, SITE_VISIBILITY.PUBLIC); await sitesApi.createSite(userSitePublic, SITE_VISIBILITY.PUBLIC);
await sitesApi.createSite(userSiteModerated, SITE_VISIBILITY.MODERATED); await sitesApi.createSite(userSiteModerated, SITE_VISIBILITY.MODERATED);
@@ -119,7 +119,7 @@ test.describe('Search sorting', () => {
if (searchTerm) { if (searchTerm) {
await searchPage.searchWithin(searchTerm, 'files'); await searchPage.searchWithin(searchTerm, 'files');
} else { } else {
await searchPage.searchWithin(`*${random}*`, 'files'); await searchPage.searchWithin(`TEXT:${random}`, 'files');
} }
await searchPage.searchSortingPicker.sortBy(sortBy, sortOrder); await searchPage.searchSortingPicker.sortBy(sortBy, sortOrder);
await searchPage.dataTable.spinnerWaitForReload(); await searchPage.dataTable.spinnerWaitForReload();
@@ -164,7 +164,7 @@ test.describe('Share a file', () => {
await personalFiles.shareDialog.urlAction.click(); await personalFiles.shareDialog.urlAction.click();
const shareSnackBar = personalFiles.snackBar; const shareSnackBar = personalFiles.snackBar;
await expect(shareSnackBar.getByMessageLocator('Link copied to the clipboard')).toBeVisible(); expect(await shareSnackBar.getSnackBarMessage()).toContain('Link copied to the clipboard');
await page.goto(url); await page.goto(url);
await personalFiles.viewer.waitForViewerToOpen(); await personalFiles.viewer.waitForViewerToOpen();
+1 -3
View File
@@ -1,5 +1,3 @@
{ {
"all": { "all": {}
"XAT-17738": "https://hyland.atlassian.net/browse/ACS-9889"
}
} }
@@ -52,6 +52,7 @@ test.describe('Upload files', () => {
await personalFiles.acaHeader.uploadFileButton.click() await personalFiles.acaHeader.uploadFileButton.click()
]); ]);
await fileChooserWindow.setFiles(TEST_FILES.JPG_FILE.path); await fileChooserWindow.setFiles(TEST_FILES.JPG_FILE.path);
await personalFiles.page.waitForTimeout(1500);
}); });
test.afterAll(async () => { test.afterAll(async () => {
@@ -181,8 +181,7 @@ test.describe('viewer action file', () => {
await openFileInViewer(personalFiles, randomDocxDelete); await openFileInViewer(personalFiles, randomDocxDelete);
await personalFiles.acaHeader.clickViewerMoreActions(); await personalFiles.acaHeader.clickViewerMoreActions();
await personalFiles.viewerDialog.deleteMenuButton.click(); await personalFiles.viewerDialog.deleteMenuButton.click();
await personalFiles.snackBar.getByMessageLocator(randomDocxDelete).waitFor({ state: 'attached' }); const deleteName = await personalFiles.snackBar.getSnackBarMessage();
const deleteName = await personalFiles.snackBar.getByMessageLocator(randomDocxDelete).innerText();
expect(deleteName).toContain(`${randomDocxDelete} deleted`); expect(deleteName).toContain(`${randomDocxDelete} deleted`);
await personalFiles.dataTable.getCellLinkByName(randomDocxName).waitFor({ state: 'attached' }); await personalFiles.dataTable.getCellLinkByName(randomDocxName).waitFor({ state: 'attached' });
await expect(personalFiles.dataTable.getCellLinkByName(randomDocxDelete), 'file should not visible').toBeHidden(); await expect(personalFiles.dataTable.getCellLinkByName(randomDocxDelete), 'file should not visible').toBeHidden();
+1 -8
View File
@@ -1,12 +1,5 @@
{ {
"all": { "all": {},
"XAT-5501": "https://hyland.atlassian.net/browse/ACS-9889",
"XAT-5499": "https://hyland.atlassian.net/browse/ACS-9889",
"XAT-17181": "https://hyland.atlassian.net/browse/ACS-9889",
"XAT-17640": "https://hyland.atlassian.net/browse/ACS-9889",
"XAT-17644": "https://hyland.atlassian.net/browse/ACS-9889",
"XAT-17182": "https://hyland.atlassian.net/browse/ACS-9889"
},
"firefox": { "firefox": {
"XAT-17177": "https://hyland.atlassian.net/browse/ACS-10917", "XAT-17177": "https://hyland.atlassian.net/browse/ACS-10917",
"XAT-17178": "https://hyland.atlassian.net/browse/ACS-10917", "XAT-17178": "https://hyland.atlassian.net/browse/ACS-10917",
@@ -97,8 +97,7 @@ test.describe('viewer file types', () => {
async function openFileInViewer(page: PersonalFilesPage, fileName: string) { async function openFileInViewer(page: PersonalFilesPage, fileName: string) {
await page.dataTable.performClickFolderOrFileToOpen(fileName); await page.dataTable.performClickFolderOrFileToOpen(fileName);
expect(await page.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true); await page.viewer.waitForViewerToOpen();
await page.viewer.waitForViewerLoaderToFinish();
await Utils.delayInSeconds(1); await Utils.delayInSeconds(1);
} }
@@ -75,7 +75,7 @@ test.describe('from File Libraries', () => {
await myLibrariesPage.copyMoveDialog.selectLocation('Personal Files'); await myLibrariesPage.copyMoveDialog.selectLocation('Personal Files');
await myLibrariesPage.copyMoveDialog.selectDestination(destination); await myLibrariesPage.copyMoveDialog.selectDestination(destination);
await myLibrariesPage.copyMoveDialog.actionButton.click(); await myLibrariesPage.copyMoveDialog.actionButton.click();
await expect(myLibrariesPage.snackBar.getByMessageLocator('Moved 1 item')).toBeVisible(); expect(await myLibrariesPage.snackBar.getSnackBarMessage()).toContain('Moved 1 item');
await myLibrariesPage.viewer.closeButtonLocator.click(); await myLibrariesPage.viewer.closeButtonLocator.click();
await myLibrariesPage.dataTable.getRowByName(xlsxLibraries).waitFor({ state: 'detached' }); await myLibrariesPage.dataTable.getRowByName(xlsxLibraries).waitFor({ state: 'detached' });
@@ -137,6 +137,9 @@ test.describe('Version actions', () => {
test('[XAT-5499] Should be possible to view a previous document version - Recent Files', async ({ recentFilesPage }) => { test('[XAT-5499] Should be possible to view a previous document version - Recent Files', async ({ recentFilesPage }) => {
expect(recentFilesPage.page.url()).toContain('1.0'); expect(recentFilesPage.page.url()).toContain('1.0');
await recentFilesPage.viewer.waitForViewerToOpen();
await expect(recentFilesPage.viewer.unknownFormat).toBeHidden();
expect(await recentFilesPage.viewer.getFileTitle()).toContain(filenameBeforeUpdate);
}); });
test('[XAT-5500] Previous document version title should be the same in Preview mode as in Version Manager - Recent Files', async ({ test('[XAT-5500] Previous document version title should be the same in Preview mode as in Version Manager - Recent Files', async ({
@@ -224,8 +224,7 @@ test.describe('viewer zoom functionality and reset', () => {
await myLibrariesPage.navigate(); await myLibrariesPage.navigate();
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomLibraryName); await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomLibraryName);
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomDocxName); await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(randomDocxName);
await myLibrariesPage.viewer.waitForViewerLoaderToFinish(); await myLibrariesPage.viewer.waitForViewerToOpen();
expect(await myLibrariesPage.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
await myLibrariesPage.viewer.waitForZoomPercentageToDisplay(); await myLibrariesPage.viewer.waitForZoomPercentageToDisplay();
await validateFitToPageButtonActivity(myLibrariesPage); await validateFitToPageButtonActivity(myLibrariesPage);
}); });
@@ -47,6 +47,7 @@ export class ConditionComponent extends ManageRulesDialogComponent {
this.page.locator('[role=listbox] [role=option]', { hasText: optionName }).first(); this.page.locator('[role=listbox] [role=option]', { hasText: optionName }).first();
private async selectField(fields: Partial<Field>, index: number): Promise<void> { private async selectField(fields: Partial<Field>, index: number): Promise<void> {
await this.fieldDropDown.nth(index).scrollIntoViewIfNeeded();
await this.fieldDropDown.nth(index).click(); await this.fieldDropDown.nth(index).click();
const option = this.getOptionLocator(fields); const option = this.getOptionLocator(fields);
await option.click(); await option.click();
@@ -64,7 +65,11 @@ export class ConditionComponent extends ManageRulesDialogComponent {
if (comparators) { if (comparators) {
await this.selectComparator(comparators, index); await this.selectComparator(comparators, index);
} }
await this.valueField.nth(index).fill(value); if ((await this.valueField.count()) === 1) {
await this.valueField.last().fill(value);
} else {
await this.valueField.nth(index).fill(value);
}
} }
async addConditionGroup(fields: Partial<Field>, value: string, index: number, comparators?: Partial<Comparator>): Promise<void> { async addConditionGroup(fields: Partial<Field>, value: string, index: number, comparators?: Partial<Comparator>): Promise<void> {
@@ -151,7 +151,6 @@ export class DataTableComponent extends BaseComponent {
} }
async goThroughPagesLookingForRowWithName(name: string | number): Promise<void> { async goThroughPagesLookingForRowWithName(name: string | number): Promise<void> {
await this.spinnerWaitForReload();
if (await this.getRowByName(name).isVisible()) { if (await this.getRowByName(name).isVisible()) {
return; return;
} }
@@ -62,11 +62,13 @@ export class ManageRules extends BaseComponent {
return this.ruleConditionsInGroup.count(); return this.ruleConditionsInGroup.count();
} }
async turnOffRuleToggle(): Promise<void> { async turnOffRuleToggle(skipExpect?: 'skip expect'): Promise<void> {
await expect(async () => { await expect(async () => {
await this.ruleToggle.hover({ timeout: 1000 }); await this.ruleToggle.hover({ timeout: 1000 });
await this.ruleToggle.click(); await this.ruleToggle.click();
await expect(this.ruleToggleFalse).toBeVisible(); if (skipExpect !== 'skip expect') {
await expect(this.ruleToggleFalse).toBeVisible();
}
}).toPass({ }).toPass({
intervals: [2_000], intervals: [2_000],
timeout: 20_000 timeout: 20_000
@@ -30,8 +30,8 @@ export class SearchInDialogComponent extends BaseComponent {
public filesAndFoldersRadioButton = this.getChild('.aca-search-in-panel__radio label').getByText('Files and folders'); public filesAndFoldersRadioButton = this.getChild('.aca-search-in-panel__radio label').getByText('Files and folders');
public librariesRadioButton = this.getChild('.aca-search-in-panel__radio label').getByText('Libraries'); public librariesRadioButton = this.getChild('.aca-search-in-panel__radio label').getByText('Libraries');
public filesCheckbox = this.getChild('.aca-search-in-panel__checkboxes').getByLabel('Files'); public filesCheckbox = this.getChild('#content [type="checkbox"]');
public foldersCheckbox = this.getChild('.aca-search-in-panel__checkboxes').getByLabel('Folders'); public foldersCheckbox = this.getChild('#folder [type="checkbox"]');
public applyButton = this.getChild('button', { hasText: 'Apply' }); public applyButton = this.getChild('button', { hasText: 'Apply' });
readonly resetButton = this.getChild('button', { hasText: 'Reset' }); readonly resetButton = this.getChild('button', { hasText: 'Reset' });
@@ -45,6 +45,7 @@ export class SearchInputComponent extends BaseComponent {
} }
async searchFor(searchText: string): Promise<void> { async searchFor(searchText: string): Promise<void> {
await this.searchInput.click();
await this.searchInput.fill(searchText); await this.searchInput.fill(searchText);
await this.searchButton.click(); await this.searchButton.click();
} }
@@ -33,8 +33,6 @@ export class SnackBarComponent extends BaseComponent {
public actionButton = this.getChild('[data-automation-id="adf-snackbar-message-content-action-button"]'); public actionButton = this.getChild('[data-automation-id="adf-snackbar-message-content-action-button"]');
public closeIcon = this.getChild('.adf-snackbar-message-content-action-icon'); public closeIcon = this.getChild('.adf-snackbar-message-content-action-icon');
public getByMessageLocator = (message: string) =>
this.getChild(`[data-automation-id='adf-snackbar-message-content']`, { hasText: message }).first();
constructor(page: Page, rootElement = SnackBarComponent.rootElement) { constructor(page: Page, rootElement = SnackBarComponent.rootElement) {
super(page, rootElement); super(page, rootElement);
@@ -45,11 +43,7 @@ export class SnackBarComponent extends BaseComponent {
} }
async getSnackBarActionText(): Promise<string> { async getSnackBarActionText(): Promise<string> {
if (await this.actionButton.isVisible()) { return this.actionButton.innerText();
return this.actionButton.textContent();
} else {
return '';
}
} }
async verifySnackBarActionText(text: string): Promise<void> { async verifySnackBarActionText(text: string): Promise<void> {
@@ -72,7 +72,7 @@ export class ViewerComponent extends BaseComponent {
async waitForViewerToOpen(): Promise<void> { async waitForViewerToOpen(): Promise<void> {
await this.waitForViewerLoaderToFinish(); await this.waitForViewerLoaderToFinish();
await this.viewerLocator.waitFor({ state: 'visible', timeout: timeouts.large }); await this.viewerLocator.waitFor({ state: 'visible', timeout: timeouts.extraLarge });
} }
async waitForViewerLoaderToFinish(): Promise<void> { async waitForViewerLoaderToFinish(): Promise<void> {
@@ -80,6 +80,7 @@ export class SearchPage extends BasePage {
if (!(await this.searchInputComponent.searchInput.isVisible())) { if (!(await this.searchInputComponent.searchInput.isVisible())) {
await this.acaHeader.searchButton.click(); await this.acaHeader.searchButton.click();
} }
await this.searchInputComponent.searchFor(searchText);
await this.searchInputComponent.searchInButton.click(); await this.searchInputComponent.searchInButton.click();
switch (searchType) { switch (searchType) {
case 'files': case 'files':
@@ -98,12 +99,6 @@ export class SearchPage extends BasePage {
break; break;
} }
await this.searchInDialog.applyButton.click(); await this.searchInDialog.applyButton.click();
await this.clickSearchButton();
await this.searchInputComponent.searchFor(searchText);
await this.dataTable.spinnerWaitForReload(); await this.dataTable.spinnerWaitForReload();
} }
async clickSearchButton() {
await this.searchInputComponent.searchButton.click({ force: true });
}
} }