[ACS-7451] playwright eslint plugin introduced (#3746)

This commit is contained in:
Adam Świderski
2024-03-29 11:42:58 +01:00
committed by GitHub
parent f30fcbf693
commit 132ce1f75e
23 changed files with 162 additions and 87 deletions

View File

@@ -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();

View File

@@ -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');

View File

@@ -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);
});

View File

@@ -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 }) => {