mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-7451] playwright eslint plugin introduced (#3746)
This commit is contained in:
@@ -53,9 +53,9 @@ test.describe('Create folders', () => {
|
||||
await folderDialog.createButton.click();
|
||||
await personalFiles.page.keyboard.press('Escape');
|
||||
await personalFiles.snackBar.message.waitFor({ state: 'attached' });
|
||||
expect(await personalFiles.snackBar.message.innerText()).toEqual('The action was unsuccessful. Try again or contact your IT Team.');
|
||||
await expect(personalFiles.snackBar.message).toHaveText('The action was unsuccessful. Try again or contact your IT Team.');
|
||||
expect(await personalFiles.page.title()).toContain('Sign in');
|
||||
await personalFiles.snackBar.message.waitFor({ state: 'detached' });
|
||||
expect(await personalFiles.snackBar.message.isVisible(), 'dialog should not be visible').toBe(false);
|
||||
await expect(personalFiles.snackBar.message, 'dialog should not be visible').toBeHidden();
|
||||
});
|
||||
});
|
||||
|
@@ -61,9 +61,9 @@ test.describe('viewer file', () => {
|
||||
test.describe('general tests', () => {
|
||||
test('[C213089] login page layout', async ({ loginPage }) => {
|
||||
await loginPage.navigate();
|
||||
expect(await loginPage.username.isEnabled(), 'username input is not enabled').toBe(true);
|
||||
expect(await loginPage.password.isEnabled(), 'password input is not enabled').toBe(true);
|
||||
expect(await loginPage.submitButton.isEnabled(), 'SIGN IN button is enabled').toBe(false);
|
||||
await expect(loginPage.username, 'username input is not enabled').toBeEnabled();
|
||||
await expect(loginPage.password, 'password input is not enabled').toBeEnabled();
|
||||
await expect(loginPage.submitButton, 'SIGN IN button is enabled').toBeDisabled();
|
||||
await loginPage.password.fill('text');
|
||||
expect(await loginPage.isPasswordDisplayed(), 'Password is not hidden by default').toBe(false);
|
||||
await loginPage.passwordVisibility.click();
|
||||
@@ -82,7 +82,7 @@ test.describe('viewer file', () => {
|
||||
test('[C213097] logs in with user with non-latin characters', async ({ loginPage }) => {
|
||||
await loginPage.navigate();
|
||||
await loginPage.loginUser({ username: otherLanguageUser.username, password: otherLanguageUser.password });
|
||||
expect(await loginPage.page.url()).toContain('personal-files');
|
||||
expect(loginPage.page.url()).toContain('personal-files');
|
||||
});
|
||||
|
||||
test('[C213107] redirects to Home Page when navigating to the Login page while already logged in', async ({ loginPage }) => {
|
||||
|
@@ -83,20 +83,20 @@ test.describe('Copy Move actions', () => {
|
||||
await loginPage.loginUser({ username: consumerUser, password: consumerUser }, { withNavigation: true, waitForLoading: true });
|
||||
await myLibrariesPage.navigate();
|
||||
await copyContentInMyLibraries(myLibrariesPage);
|
||||
expect(await myLibrariesPage.contentNodeSelector.actionButton.isEnabled()).toBe(false);
|
||||
await expect(myLibrariesPage.contentNodeSelector.actionButton).toBeDisabled();
|
||||
});
|
||||
|
||||
test('[C263877] Contributor user can select the folder as destination', async ({ loginPage, myLibrariesPage }) => {
|
||||
await loginPage.loginUser({ username: contributorUser, password: contributorUser }, { withNavigation: true, waitForLoading: true });
|
||||
await myLibrariesPage.navigate();
|
||||
await copyContentInMyLibraries(myLibrariesPage);
|
||||
expect(await myLibrariesPage.contentNodeSelector.actionButton.isEnabled()).toBe(true);
|
||||
await expect(myLibrariesPage.contentNodeSelector.actionButton).toBeEnabled();
|
||||
});
|
||||
|
||||
test('[C263878] Collaborator user can select the folder as destination', async ({ loginPage, myLibrariesPage }) => {
|
||||
await loginPage.loginUser({ username: collaboratorUser, password: collaboratorUser }, { withNavigation: true, waitForLoading: true });
|
||||
await myLibrariesPage.navigate();
|
||||
await copyContentInMyLibraries(myLibrariesPage);
|
||||
expect(await myLibrariesPage.contentNodeSelector.actionButton.isEnabled()).toBe(true);
|
||||
await expect(myLibrariesPage.contentNodeSelector.actionButton).toBeEnabled();
|
||||
});
|
||||
});
|
||||
|
@@ -151,8 +151,8 @@ test.describe('Create file from template', () => {
|
||||
|
||||
test(`[C325044] Templates don't appear if user doesn't have permissions to see them`, async () => {
|
||||
await expect(selectFileTemplateDialog.getDialogTitle(selectDialogTitle)).toBeVisible();
|
||||
await expect(dataTable.getRowByName(restrictedTemplateFolder)).not.toBeVisible();
|
||||
await expect(dataTable.getRowByName(templateInRestrictedFolder)).not.toBeVisible();
|
||||
await expect(dataTable.getRowByName(restrictedTemplateFolder)).toBeHidden();
|
||||
await expect(dataTable.getRowByName(templateInRestrictedFolder)).toBeHidden();
|
||||
});
|
||||
|
||||
test(`[C325045] Navigate through the templates list with folder hierarchy`, async () => {
|
||||
@@ -191,7 +191,7 @@ test.describe('Create file from template', () => {
|
||||
test('[C325050] Links to files are not displayed', async () => {
|
||||
await expect(dataTable.getRowByName(template1InRoot)).toBeVisible();
|
||||
await expect(dataTable.getRowByName(template2InRoot)).toBeVisible();
|
||||
await expect(dataTable.getRowByName(fileLink)).not.toBeVisible();
|
||||
await expect(dataTable.getRowByName(fileLink)).toBeHidden();
|
||||
});
|
||||
|
||||
test('[C325048] Cancel the Select template dialog', async () => {
|
||||
@@ -324,7 +324,7 @@ test.describe('Create file from template', () => {
|
||||
test('[C325027] Cancel file creation', async () => {
|
||||
await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
|
||||
await createFileFromTemplateDialog.cancelButton.click();
|
||||
await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).not.toBeVisible();
|
||||
await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeHidden();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -406,8 +406,8 @@ test.describe('Create file from template', () => {
|
||||
test('[C325024] Cancel file creation in a library', async () => {
|
||||
await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
|
||||
await createFileFromTemplateDialog.cancelButton.click();
|
||||
await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).not.toBeVisible();
|
||||
await expect(dataTable.getRowByName(randomFileName)).not.toBeVisible();
|
||||
await expect(createFileFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeHidden();
|
||||
await expect(dataTable.getRowByName(randomFileName)).toBeHidden();
|
||||
});
|
||||
|
||||
test('[C325025] Create a file with a duplicate name in a library', async ({ myLibrariesPage }) => {
|
||||
|
@@ -178,7 +178,7 @@ test.describe('Create folder from template', () => {
|
||||
|
||||
test(`[C325148] Templates don't appear if user doesn't have permissions to see them`, async () => {
|
||||
await expect(selectFolderTemplateDialog.getDialogTitle(selectDialogTitle)).toBeVisible();
|
||||
await expect(dataTable.getRowByName(restrictedTemplateFolder)).not.toBeVisible();
|
||||
await expect(dataTable.getRowByName(restrictedTemplateFolder)).toBeHidden();
|
||||
});
|
||||
|
||||
test(`[C325149] Navigate through the templates list with folder hierarchy`, async () => {
|
||||
@@ -214,7 +214,7 @@ test.describe('Create folder from template', () => {
|
||||
|
||||
test('[C325153] Links to folders are not displayed', async () => {
|
||||
await expect(dataTable.getRowByName(templateFolder1)).toBeVisible();
|
||||
await expect(dataTable.getRowByName(folderLink)).not.toBeVisible();
|
||||
await expect(dataTable.getRowByName(folderLink)).toBeHidden();
|
||||
});
|
||||
|
||||
test('[C325151] Cancel the Select template dialog', async () => {
|
||||
@@ -351,7 +351,7 @@ test.describe('Create folder from template', () => {
|
||||
test('[C325155] Cancel folder creation', async () => {
|
||||
await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
|
||||
await createFolderFromTemplateDialog.cancelButton.click();
|
||||
await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).not.toBeVisible();
|
||||
await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeHidden();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -452,8 +452,8 @@ test.describe('Create folder from template', () => {
|
||||
test('[C325162] Cancel folder creation in a library', async () => {
|
||||
await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
|
||||
await createFolderFromTemplateDialog.cancelButton.click();
|
||||
await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).not.toBeVisible();
|
||||
await expect(dataTable.getRowByName(randomFolderName)).not.toBeVisible();
|
||||
await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeHidden();
|
||||
await expect(dataTable.getRowByName(randomFolderName)).toBeHidden();
|
||||
});
|
||||
|
||||
test('[C325163] Create a folder with a duplicate name in a library', async ({ myLibrariesPage }) => {
|
||||
|
@@ -157,10 +157,10 @@ test.describe('Create Libraries ', () => {
|
||||
await expect(libraryTable.getCellLinkByName(randomLibraryName).and(myLibrariesPage.page.getByTitle(randomLibraryDescription))).toBeVisible();
|
||||
await libraryTable.getRowByName(randomLibraryName).click();
|
||||
await libraryViewDetails.click();
|
||||
expect(await libraryDetails.getNameField('Name').locator('input').inputValue()).toBe(randomLibraryName);
|
||||
expect(await libraryDetails.getIdField('Library ID').locator('input').inputValue()).toBe(randomLibraryId);
|
||||
await expect(libraryDetails.getNameField('Name').locator('input')).toHaveValue(randomLibraryName);
|
||||
await expect(libraryDetails.getIdField('Library ID').locator('input')).toHaveValue(randomLibraryId);
|
||||
await expect(libraryDetails.getVisibilityField('Visibility').locator('.mat-select-value').getByText(publicVisibility)).toBeVisible();
|
||||
expect(await libraryDetails.getDescriptionField.inputValue()).toBe(randomLibraryDescription);
|
||||
await expect(libraryDetails.getDescriptionField).toHaveValue(randomLibraryDescription);
|
||||
|
||||
createdLibrariesIds.push(randomLibraryId);
|
||||
});
|
||||
|
@@ -105,8 +105,8 @@ test.describe('Info Drawer - Comments', () => {
|
||||
await sharedPage.infoDrawer.commentsTab.click();
|
||||
await sharedPage.infoDrawer.waitForComments();
|
||||
expect(await sharedPage.infoDrawer.checkCommentsHeaderCount()).toEqual(2);
|
||||
expect(await sharedPage.infoDrawer.commentTextContent.nth(0).textContent()).toEqual(e2eCommentSecond);
|
||||
expect(await sharedPage.infoDrawer.commentTextContent.nth(1).textContent()).toEqual(e2eCommentFirst);
|
||||
await expect(sharedPage.infoDrawer.commentTextContent.nth(0)).toHaveText(e2eCommentSecond);
|
||||
await expect(sharedPage.infoDrawer.commentTextContent.nth(1)).toHaveText(e2eCommentFirst);
|
||||
});
|
||||
|
||||
test('[C299195] from Recent Files - Add a comment on a file', async ({ recentFilesPage }) => {
|
||||
@@ -140,8 +140,8 @@ test.describe('Info Drawer - Comments', () => {
|
||||
await favoritePage.infoDrawer.commentsTab.click();
|
||||
await favoritePage.infoDrawer.waitForComments();
|
||||
expect(await favoritePage.infoDrawer.checkCommentsHeaderCount()).toEqual(1);
|
||||
expect(await favoritePage.infoDrawer.commentTextContent.nth(0).textContent()).toEqual(e2eCommentFirst);
|
||||
expect(await favoritePage.infoDrawer.commentTimestamp.nth(0).textContent()).toEqual('less than a minute ago');
|
||||
expect(await favoritePage.infoDrawer.commentUsername.nth(0).textContent()).toEqual('Administrator');
|
||||
await expect(favoritePage.infoDrawer.commentTextContent.nth(0)).toHaveText(e2eCommentFirst);
|
||||
await expect(favoritePage.infoDrawer.commentTimestamp.nth(0)).toHaveText('less than a minute ago');
|
||||
await expect(favoritePage.infoDrawer.commentUsername.nth(0)).toHaveText('Administrator');
|
||||
});
|
||||
});
|
||||
|
@@ -71,12 +71,12 @@ test.describe('Info Drawer - General', () => {
|
||||
await expect(personalFiles.infoDrawer.infoDrawerPanel).toBeVisible();
|
||||
|
||||
await personalFiles.reload({ waitUntil: 'load' });
|
||||
await expect(personalFiles.infoDrawer.infoDrawerPanel).not.toBeVisible();
|
||||
await expect(personalFiles.infoDrawer.infoDrawerPanel).toBeHidden();
|
||||
await personalFiles.dataTable.selectItem(file1);
|
||||
await personalFiles.acaHeader.viewDetails.click();
|
||||
await expect(personalFiles.infoDrawer.infoDrawerPanel).toBeVisible();
|
||||
|
||||
await personalFiles.reload({ waitUntil: 'load' });
|
||||
await expect(personalFiles.infoDrawer.infoDrawerPanel).not.toBeVisible();
|
||||
await expect(personalFiles.infoDrawer.infoDrawerPanel).toBeHidden();
|
||||
});
|
||||
});
|
||||
|
@@ -73,17 +73,17 @@ test.describe('Library properties', () => {
|
||||
await myLibrariesPage.acaHeader.viewDetails.click();
|
||||
|
||||
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible();
|
||||
expect(await myLibrariesPage.libraryDetails.headerTitle.textContent()).toEqual(site.name);
|
||||
await expect(myLibrariesPage.libraryDetails.headerTitle).toHaveText(site.name);
|
||||
await expect(myLibrariesPage.libraryDetails.propertiesTab).toBeVisible();
|
||||
await expect(myLibrariesPage.libraryDetails.nameField).toBeVisible();
|
||||
await expect(myLibrariesPage.libraryDetails.idField).toBeVisible();
|
||||
await expect(myLibrariesPage.libraryDetails.visibilityField).toBeVisible();
|
||||
await expect(myLibrariesPage.libraryDetails.descriptionField).toBeVisible();
|
||||
|
||||
expect(await myLibrariesPage.libraryDetails.nameField.inputValue()).toEqual(site.name);
|
||||
expect(await myLibrariesPage.libraryDetails.idField.inputValue()).toEqual(site.id);
|
||||
await expect(myLibrariesPage.libraryDetails.nameField).toHaveValue(site.name);
|
||||
await expect(myLibrariesPage.libraryDetails.idField).toHaveValue(site.id);
|
||||
expect((await myLibrariesPage.libraryDetails.visibilityField.textContent()).toUpperCase()).toEqual(site.visibility);
|
||||
expect(await myLibrariesPage.libraryDetails.descriptionField.inputValue()).toEqual(site.description);
|
||||
await expect(myLibrariesPage.libraryDetails.descriptionField).toHaveValue(site.description);
|
||||
await expect(myLibrariesPage.libraryDetails.editButton).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -124,9 +124,9 @@ test.describe('Library properties', () => {
|
||||
await expect(myLibrariesPage.libraryDetails.updateButton).toBeEnabled();
|
||||
|
||||
await myLibrariesPage.libraryDetails.updateButton.click();
|
||||
expect(await myLibrariesPage.snackBar.message.innerText()).toEqual('Library properties updated');
|
||||
await expect(myLibrariesPage.snackBar.message).toHaveText('Library properties updated');
|
||||
expect(await myLibrariesPage.dataTable.isItemPresent(siteUpdated.name)).toBe(true);
|
||||
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).not.toBeVisible();
|
||||
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeHidden();
|
||||
expect((await sitesApi.getSite(siteForUpdate.id)).entry.title).toEqual(siteUpdated.name);
|
||||
expect((await sitesApi.getSite(siteForUpdate.id)).entry.description).toEqual(siteUpdated.description);
|
||||
expect((await sitesApi.getSite(siteForUpdate.id)).entry.visibility).toEqual(siteUpdated.visibility);
|
||||
@@ -166,7 +166,7 @@ test.describe('Library properties', () => {
|
||||
await myLibrariesPage.libraryDetails.editButton.click();
|
||||
await myLibrariesPage.libraryDetails.nameField.fill(site.name);
|
||||
await expect(myLibrariesPage.libraryDetails.hintMessage).toBeVisible();
|
||||
expect(await myLibrariesPage.libraryDetails.hintMessage.textContent()).toEqual('Library name already in use');
|
||||
await expect(myLibrariesPage.libraryDetails.hintMessage).toHaveText('Library name already in use');
|
||||
});
|
||||
|
||||
test('[C289342] Site name too long', async ({ myLibrariesPage }) => {
|
||||
@@ -234,7 +234,7 @@ test.describe('Non manager', () => {
|
||||
await myLibrariesPage.navigate();
|
||||
|
||||
await myLibrariesPage.dataTable.getRowByName(site.name).click();
|
||||
await expect(myLibrariesPage.acaHeader.viewDetails).not.toBeVisible();
|
||||
await expect(myLibrariesPage.acaHeader.viewDetails).toBeHidden();
|
||||
});
|
||||
|
||||
test('[C289344] Error notification when editing with no rights', async ({ loginPage, myLibrariesPage }) => {
|
||||
@@ -248,6 +248,6 @@ test.describe('Non manager', () => {
|
||||
await myLibrariesPage.libraryDetails.descriptionField.fill('new description');
|
||||
await myLibrariesPage.libraryDetails.updateButton.click();
|
||||
|
||||
expect(await myLibrariesPage.snackBar.message.textContent()).toEqual('There was an error updating library properties');
|
||||
await expect(myLibrariesPage.snackBar.message).toHaveText('There was an error updating library properties');
|
||||
});
|
||||
});
|
||||
|
@@ -184,7 +184,7 @@ test.describe('Library actions ', () => {
|
||||
await expect.soft(confirmDialog.cancelButton).toBeVisible();
|
||||
await confirmDialog.okButton.click();
|
||||
await expect.soft(snackBar.getByMessageLocator(leftMessage)).toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user1Library1)).not.toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user1Library1)).toBeHidden();
|
||||
});
|
||||
|
||||
test('[C290111] Cancel Leave Library', async ({ myLibrariesPage }) => {
|
||||
@@ -235,7 +235,7 @@ test.describe('Library actions ', () => {
|
||||
await myLibrariesHeader.clickMoreActions();
|
||||
await libraryMenu.clickMenuItem(deleteButton);
|
||||
await expect.soft(snackBar.getByMessageLocator(libraryDeletedMessage)).toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user2Library5Delete)).not.toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user2Library5Delete)).toBeHidden();
|
||||
await trashPage.navigate({ waitUntil: loadString });
|
||||
await expect(trashTable.getRowByName(user2Library5Delete)).toBeVisible();
|
||||
});
|
||||
@@ -313,7 +313,7 @@ test.describe('Library actions ', () => {
|
||||
await libraryTable.getRowByName(user2Library3).click();
|
||||
await myLibrariesHeader.clickMoreActions();
|
||||
await libraryMenu.clickMenuItem(removeFavoriteButton);
|
||||
await expect(libraryTable.getRowByName(user2Library3)).not.toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user2Library3)).toBeHidden();
|
||||
});
|
||||
|
||||
test('[C289991] Delete a library from Favorite Libraries', async ({ favoriteLibrariesPage, trashPage }) => {
|
||||
@@ -328,7 +328,7 @@ test.describe('Library actions ', () => {
|
||||
await myLibrariesHeader.clickMoreActions();
|
||||
await libraryMenu.clickMenuItem(deleteButton);
|
||||
await expect.soft(snackBar.getByMessageLocator(libraryDeletedMessage)).toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user2Library6Delete)).not.toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user2Library6Delete)).toBeHidden();
|
||||
await trashPage.navigate({ waitUntil: loadString });
|
||||
await expect(trashTable.getRowByName(user2Library6Delete)).toBeVisible();
|
||||
});
|
||||
@@ -442,7 +442,7 @@ test.describe('Library actions ', () => {
|
||||
await searchHeader.clickMoreActions();
|
||||
await libraryMenu.clickMenuItem(deleteButton);
|
||||
await expect.soft(snackBar.getByMessageLocator(libraryDeletedMessage)).toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user2Library7Delete)).not.toBeVisible();
|
||||
await expect(libraryTable.getRowByName(user2Library7Delete)).toBeHidden();
|
||||
await trashPage.navigate({ waitUntil: loadString });
|
||||
await expect(trashTable.getRowByName(user2Library7Delete)).toBeVisible();
|
||||
});
|
||||
|
@@ -135,7 +135,7 @@ test.describe('Favorites Files', () => {
|
||||
test('[C213230] Navigate into folder from Favorites', async ({ favoritePage }) => {
|
||||
await favoritePage.dataTable.performClickFolderOrFileToOpen(favFolderName);
|
||||
await favoritePage.dataTable.spinnerWaitForReload();
|
||||
expect(await favoritePage.breadcrumb.currentItem.innerText()).toBe(favFolderName);
|
||||
await expect(favoritePage.breadcrumb.currentItem).toHaveText(favFolderName);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -67,7 +67,7 @@ test.describe('Generic errors', () => {
|
||||
await actionUser.deleteNodeById(file1Id, false);
|
||||
await personalFiles.navigate({ remoteUrl: `#/personal-files/${file1Id}` });
|
||||
|
||||
expect(await personalFiles.errorDialog.genericError.isVisible(), 'Generic error page not displayed').toBe(true);
|
||||
await expect(personalFiles.errorDialog.genericError, 'Generic error page not displayed').toBeVisible();
|
||||
expect(await personalFiles.errorDialog.genericErrorTitle.innerText()).toContain(
|
||||
`This item no longer exists or you don't have permission to view it.`
|
||||
);
|
||||
@@ -84,7 +84,7 @@ test.describe('Generic errors', () => {
|
||||
);
|
||||
await personalFiles.navigate({ remoteUrl: `#/personal-files/${file2Id}` });
|
||||
|
||||
expect(await personalFiles.errorDialog.genericError.isVisible(), 'Generic error page not displayed').toBe(true);
|
||||
await expect(personalFiles.errorDialog.genericError, 'Generic error page not displayed').toBeVisible();
|
||||
expect(await personalFiles.errorDialog.genericErrorTitle.innerText()).toContain(
|
||||
`This item no longer exists or you don't have permission to view it.`
|
||||
);
|
||||
|
@@ -91,7 +91,7 @@ test.describe('viewer action file', () => {
|
||||
test('[C260964] Personal Files breadcrumb main node', async ({ personalFiles }) => {
|
||||
await personalFiles.navigate({ remoteUrl: `#/personal-files/` });
|
||||
expect(await personalFiles.breadcrumb.items.count(), 'Breadcrumb has incorrect number of items').toEqual(1);
|
||||
expect(await personalFiles.breadcrumb.currentItem.innerText()).toBe('Personal Files');
|
||||
await expect(personalFiles.breadcrumb.currentItem).toHaveText('Personal Files');
|
||||
});
|
||||
|
||||
test('[C260965] Personal Files breadcrumb for a folder hierarchy', async ({ personalFiles }) => {
|
||||
@@ -126,7 +126,7 @@ test.describe('viewer action file', () => {
|
||||
await personalFiles.navigate({ remoteUrl: `#/personal-files/${folder1Id}` });
|
||||
await personalFiles.page.reload();
|
||||
await personalFiles.dataTable.spinnerWaitForReload();
|
||||
expect(await personalFiles.breadcrumb.currentItem.innerText()).toEqual(folder1Renamed);
|
||||
await expect(personalFiles.breadcrumb.currentItem).toHaveText(folder1Renamed);
|
||||
});
|
||||
|
||||
test('[C213240] Browser back navigates to previous location regardless of breadcrumb steps', async ({ personalFiles, trashPage }) => {
|
||||
|
@@ -65,8 +65,8 @@ test.describe('Single click on item name', () => {
|
||||
|
||||
test('[C284899] Hyperlink does not appear for items in the Trash', async ({ trashPage }) => {
|
||||
await trashPage.navigate();
|
||||
expect(await trashPage.dataTable.getCellLinkByName(deletedFile1).isVisible(), 'Link on name is present').toBe(false);
|
||||
expect(await trashPage.dataTable.getCellLinkByName(deletedFolder1).isVisible(), 'Link on name is present').toBe(false);
|
||||
await expect(trashPage.dataTable.getCellLinkByName(deletedFile1), 'Link on name is present').toBeHidden();
|
||||
await expect(trashPage.dataTable.getCellLinkByName(deletedFolder1), 'Link on name is present').toBeHidden();
|
||||
});
|
||||
|
||||
test('[C280034] Navigate inside the folder when clicking the hyperlink on Personal Files', async ({ personalFiles }) => {
|
||||
@@ -77,7 +77,7 @@ test.describe('Single click on item name', () => {
|
||||
while ((await personalFiles.breadcrumb.currentItem.innerText()) === 'Personal Files') {
|
||||
await personalFiles.breadcrumb.currentItem.innerText();
|
||||
}
|
||||
expect(await personalFiles.breadcrumb.currentItem.innerText()).toBe(folder1);
|
||||
await expect(personalFiles.breadcrumb.currentItem).toHaveText(folder1);
|
||||
});
|
||||
|
||||
test('[C284902] Navigate inside the library when clicking the hyperlink on File Libraries', async ({ myLibrariesPage }) => {
|
||||
@@ -85,7 +85,7 @@ test.describe('Single click on item name', () => {
|
||||
await myLibrariesPage.dataTable.goThroughPagesLookingForRowWithName(siteName);
|
||||
await myLibrariesPage.dataTable.getCellLinkByName(siteName).click();
|
||||
await myLibrariesPage.dataTable.spinnerWaitForReload();
|
||||
expect(await myLibrariesPage.breadcrumb.currentItem.innerText()).toBe(siteName);
|
||||
expect(await myLibrariesPage.dataTable.getCellLinkByName(fileSite).isVisible(), `${fileSite} not displayed`).toBe(true);
|
||||
await expect(myLibrariesPage.breadcrumb.currentItem).toHaveText(siteName);
|
||||
await expect(myLibrariesPage.dataTable.getCellLinkByName(fileSite), `${fileSite} not displayed`).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
@@ -68,7 +68,7 @@ test.describe('Search - Input', () => {
|
||||
|
||||
await searchPage.searchOverlay.searchFilesOption.click();
|
||||
await expect(searchPage.searchOverlay.searchFoldersOption).toBeEnabled();
|
||||
await expect(searchPage.searchOverlay.searchLibrariesOption).not.toBeEnabled();
|
||||
await expect(searchPage.searchOverlay.searchLibrariesOption).toBeDisabled();
|
||||
|
||||
await searchPage.searchOverlay.searchFilesOption.click();
|
||||
await expect(searchPage.searchOverlay.searchFoldersOption).toBeEnabled();
|
||||
@@ -76,15 +76,15 @@ test.describe('Search - Input', () => {
|
||||
|
||||
await searchPage.searchOverlay.searchFoldersOption.click();
|
||||
await expect(searchPage.searchOverlay.searchFilesOption).toBeEnabled();
|
||||
await expect(searchPage.searchOverlay.searchLibrariesOption).not.toBeEnabled();
|
||||
await expect(searchPage.searchOverlay.searchLibrariesOption).toBeDisabled();
|
||||
|
||||
await searchPage.searchOverlay.searchFoldersOption.click();
|
||||
await expect(searchPage.searchOverlay.searchFilesOption).toBeEnabled();
|
||||
await expect(searchPage.searchOverlay.searchLibrariesOption).toBeEnabled();
|
||||
|
||||
await searchPage.searchOverlay.searchLibrariesOption.click();
|
||||
await expect(searchPage.searchOverlay.searchFilesOption).not.toBeEnabled();
|
||||
await expect(searchPage.searchOverlay.searchFoldersOption).not.toBeEnabled();
|
||||
await expect(searchPage.searchOverlay.searchFilesOption).toBeDisabled();
|
||||
await expect(searchPage.searchOverlay.searchFoldersOption).toBeDisabled();
|
||||
|
||||
await searchPage.searchOverlay.searchLibrariesOption.click();
|
||||
await expect(searchPage.searchOverlay.searchFilesOption).toBeEnabled();
|
||||
|
@@ -112,12 +112,12 @@ test.describe('Unshare a file from Search Results', () => {
|
||||
expect(await personalFiles.shareDialog.isShareToggleChecked()).toBe(true);
|
||||
await personalFiles.shareDialog.shareToggle.click();
|
||||
|
||||
expect(personalFiles.confirmDialog.getDialogTitle('Remove this shared link')).toBeVisible();
|
||||
expect(
|
||||
await expect(personalFiles.confirmDialog.getDialogTitle('Remove this shared link')).toBeVisible();
|
||||
await expect(
|
||||
personalFiles.confirmDialog.getDialogContent('This link will be deleted and a new link will be created next time this file is shared')
|
||||
).toBeVisible();
|
||||
expect(personalFiles.confirmDialog.okButton).toBeEnabled();
|
||||
expect(personalFiles.confirmDialog.cancelButton).toBeEnabled();
|
||||
await expect(personalFiles.confirmDialog.okButton).toBeEnabled();
|
||||
await expect(personalFiles.confirmDialog.cancelButton).toBeEnabled();
|
||||
});
|
||||
|
||||
test('[C306996] Unshare a file', async ({ personalFiles, searchPage, nodesApiAction, page }) => {
|
||||
@@ -135,7 +135,7 @@ test.describe('Unshare a file from Search Results', () => {
|
||||
|
||||
await page.goto(url);
|
||||
await personalFiles.viewer.waitForViewerToOpen();
|
||||
expect(await personalFiles.viewer.fileTitleButtonLocator.innerText()).not.toEqual(file2);
|
||||
await expect(personalFiles.viewer.fileTitleButtonLocator).not.toHaveText(file2);
|
||||
expect(await nodesApiAction.isFileShared(file2Id)).toBe(false);
|
||||
});
|
||||
|
||||
|
@@ -100,7 +100,7 @@ test.describe('viewer action file', () => {
|
||||
const deleteName = await personalFiles.snackBar.getByMessageLocator(randomDocxDelete).innerText();
|
||||
expect(deleteName).toContain(`${randomDocxDelete} deleted`);
|
||||
await personalFiles.dataTable.getCellLinkByName(randomDocxName).waitFor({ state: 'attached' });
|
||||
expect(await personalFiles.dataTable.getCellLinkByName(randomDocxDelete).isVisible(), 'file should not visible').toBe(false);
|
||||
await expect(personalFiles.dataTable.getCellLinkByName(randomDocxDelete), 'file should not visible').toBeHidden();
|
||||
await trashPage.navigate({ waitUntil: 'domcontentloaded' });
|
||||
expect(await trashPage.dataTable.isItemPresent(randomDocxDelete), 'Item should be present in Trash').toBe(true);
|
||||
});
|
||||
@@ -160,7 +160,7 @@ test.describe('viewer action file', () => {
|
||||
|
||||
await sharedPage.acaHeader.clickViewerMoreActions();
|
||||
await favoritePage.viewerDialog.removeFavoriteMenuButton.waitFor({ state: 'attached', timeout: timeouts.normal });
|
||||
expect(await sharedPage.viewerDialog.removeFavoriteMenuButton.isVisible(), 'Item should be remove favorite').toBe(true);
|
||||
await expect(sharedPage.viewerDialog.removeFavoriteMenuButton, 'Item should be remove favorite').toBeVisible();
|
||||
await sharedPage.page.keyboard.press('Escape');
|
||||
await favoritePage.navigate({ waitUntil: 'domcontentloaded' });
|
||||
expect(await favoritePage.dataTable.isItemPresent(randomDocxNameShare), 'Item is not present in Favorites list').toBe(true);
|
||||
@@ -173,10 +173,10 @@ test.describe('viewer action file', () => {
|
||||
await favoritePage.viewer.shareButton.waitFor({ state: 'attached', timeout: timeouts.normal });
|
||||
await favoritePage.viewer.shareButton.click();
|
||||
await favoritePage.viewerDialog.shareDialogTitle.waitFor({ state: 'attached', timeout: timeouts.normal });
|
||||
expect(await favoritePage.viewerDialog.shareDialogTitle.isVisible(), 'Share dialog should be open').toBe(true);
|
||||
await expect(favoritePage.viewerDialog.shareDialogTitle, 'Share dialog should be open').toBeVisible();
|
||||
await favoritePage.viewerDialog.shareDialogClose.click();
|
||||
await favoritePage.viewerDialog.shareDialogClose.waitFor({ state: 'detached', timeout: timeouts.large });
|
||||
expect(await favoritePage.viewerDialog.shareDialogTitle.isVisible(), 'Share dialog should be open').toBe(false);
|
||||
await expect(favoritePage.viewerDialog.shareDialogTitle, 'Share dialog should be open').toBeHidden();
|
||||
});
|
||||
|
||||
test('[C297586] Upload new version action', async ({ personalFiles, nodesApiAction }) => {
|
||||
@@ -208,8 +208,8 @@ test.describe('viewer action file', () => {
|
||||
expect(await personalFiles.viewer.fileTitleButtonLocator.innerText()).toContain(docxFile);
|
||||
|
||||
await personalFiles.acaHeader.clickViewerMoreActions();
|
||||
expect(await personalFiles.matMenu.cancelEditingAction.isVisible(), `'Cancel Editing' button shouldn't be shown`).toBe(false);
|
||||
expect(await personalFiles.matMenu.editOfflineAction.isVisible(), `'Edit Offline' should be shown`).toBe(true);
|
||||
await expect(personalFiles.matMenu.cancelEditingAction, `'Cancel Editing' button shouldn't be shown`).toBeHidden();
|
||||
await expect(personalFiles.matMenu.editOfflineAction, `'Edit Offline' should be shown`).toBeVisible();
|
||||
});
|
||||
|
||||
test('[C286384] Copy action from Recent Files', async ({ recentFilesPage, personalFiles }) => {
|
||||
@@ -219,7 +219,7 @@ test.describe('viewer action file', () => {
|
||||
|
||||
await recentFilesPage.acaHeader.clickViewerMoreActions();
|
||||
await recentFilesPage.matMenu.clickMenuItem('Copy');
|
||||
expect(await recentFilesPage.contentNodeSelector.actionButton.isVisible(), 'Dialog is not open').toBe(true);
|
||||
await expect(recentFilesPage.contentNodeSelector.actionButton, 'Dialog is not open').toBeVisible();
|
||||
await recentFilesPage.contentNodeSelector.selectLocation('Personal Files');
|
||||
await recentFilesPage.contentNodeSelector.selectDestination(destination);
|
||||
await recentFilesPage.contentNodeSelector.actionButton.click();
|
||||
|
@@ -55,14 +55,14 @@ test.describe('viewer file', () => {
|
||||
test('[C268958] Password dialog appears when opening a protected file', async ({ personalFiles }) => {
|
||||
expect(await personalFiles.passwordDialog.isDialogOpen(), 'Password dialog not open').toBe(true);
|
||||
expect(await personalFiles.passwordDialog.isPasswordInputDisplayed(), 'Password input not displayed').toBe(true);
|
||||
expect(await personalFiles.passwordDialog.submitButton.isHidden(), 'Submit button not disabled').toBe(false);
|
||||
await expect(personalFiles.passwordDialog.submitButton, 'Submit button not disabled').toBeVisible();
|
||||
expect(await personalFiles.passwordDialog.isCloseVisible(), 'Close button not enabled').toBe(true);
|
||||
expect(await personalFiles.viewer.pdfViewerContentPages.isVisible(), 'Viewer did not close').toBe(false);
|
||||
await expect(personalFiles.viewer.pdfViewerContentPages, 'Viewer did not close').toBeHidden();
|
||||
});
|
||||
|
||||
test('[C268959] File content is displayed when entering the correct password', async ({ personalFiles }) => {
|
||||
await personalFiles.passwordDialog.enterPassword(TEST_FILES.PDF_PROTECTED.password);
|
||||
expect(await personalFiles.passwordDialog.submitButton.isVisible(), 'Submit button not enabled').toBe(true);
|
||||
await expect(personalFiles.passwordDialog.submitButton, 'Submit button not enabled').toBeVisible();
|
||||
|
||||
await personalFiles.passwordDialog.submitButton.click();
|
||||
await personalFiles.passwordDialog.waitForDialogToClose();
|
||||
@@ -72,7 +72,7 @@ test.describe('viewer file', () => {
|
||||
|
||||
test('[C268960] Error appears when entering an incorrect password', async ({ personalFiles }) => {
|
||||
await personalFiles.passwordDialog.enterPassword('incorrect');
|
||||
expect(await personalFiles.passwordDialog.submitButton.isVisible(), 'Submit button not enabled').toBe(true);
|
||||
await expect(personalFiles.passwordDialog.submitButton, 'Submit button not enabled').toBeVisible();
|
||||
await personalFiles.passwordDialog.submitButton.click();
|
||||
|
||||
expect(await personalFiles.passwordDialog.getErrorMessage()).toBe('Password is wrong');
|
||||
|
@@ -87,7 +87,7 @@ test.describe('from File Libraries', () => {
|
||||
|
||||
await myLibrariesPage.viewer.closeButtonLocator.click();
|
||||
await myLibrariesPage.dataTable.getRowByName(xlsxLibraries).waitFor({ state: 'detached' });
|
||||
expect(await myLibrariesPage.dataTable.getRowByName(xlsxLibraries).isVisible(), 'Item was not moved').toBe(false);
|
||||
await expect(myLibrariesPage.dataTable.getRowByName(xlsxLibraries), 'Item was not moved').toBeHidden();
|
||||
await personalFiles.navigate({ remoteUrl: `#/personal-files/${destinationId}` });
|
||||
expect(await personalFiles.dataTable.isItemPresent(xlsxLibraries), 'Item is not present in destination').toBe(true);
|
||||
});
|
||||
|
@@ -130,7 +130,7 @@ test.describe('viewer file', () => {
|
||||
expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||
expect(await personalFiles.viewer.getCloseButtonTooltip()).toEqual('Close');
|
||||
await personalFiles.viewer.closeButtonLocator.click();
|
||||
expect(await personalFiles.dataTable.getCellLinkByName(randomDocxName).isVisible(), 'Viewer did not close').toBe(true);
|
||||
await expect(personalFiles.dataTable.getCellLinkByName(randomDocxName), 'Viewer did not close').toBeVisible();
|
||||
});
|
||||
|
||||
test('[C284636] Viewer opens for a file from Recent Files', async ({ personalFiles, recentFilesPage }) => {
|
||||
@@ -162,7 +162,7 @@ test.describe('viewer file', () => {
|
||||
await personalFiles.navigate({ remoteUrl: previewURL });
|
||||
await personalFiles.dataTable.spinnerWaitForReload();
|
||||
expect(await personalFiles.viewer.isViewerOpened(), 'Viewer is not opened').toBe(true);
|
||||
expect(await personalFiles.viewer.fileTitleButtonLocator.innerText()).toEqual(randomDocxName);
|
||||
await expect(personalFiles.viewer.fileTitleButtonLocator).toHaveText(randomDocxName);
|
||||
});
|
||||
|
||||
test('[C284635] Viewer opens for a file from Shared Files', async ({ sharedPage }) => {
|
||||
@@ -187,7 +187,7 @@ test.describe('viewer file', () => {
|
||||
test('[C279287] Viewer does not open when accessing the preview URL for a file without permissions', async ({ personalFiles }) => {
|
||||
const previewURL = `#/libraries/${docLibId}/(viewer:view/${fileAdminId})`;
|
||||
await personalFiles.navigate({ remoteUrl: `${previewURL}` });
|
||||
expect(await personalFiles.viewer.viewerLocator.isVisible(), 'Viewer should not be opened!').toBe(false);
|
||||
await expect(personalFiles.viewer.viewerLocator, 'Viewer should not be opened!').toBeHidden();
|
||||
});
|
||||
|
||||
test('[C284633] Viewer opens for a file from File Libraries', async ({ myLibrariesPage }) => {
|
||||
|
Reference in New Issue
Block a user