From 833b9acfb53956e366b87af3e0cedebc5cc9a64c Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 10 Nov 2023 10:54:45 +0000 Subject: [PATCH] fix: Integrated Download CSV & Excel label rename to tests --- .../playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts | 8 ++++---- tests/playwright/pages/Dashboard/common/Toolbar/index.ts | 4 ++-- .../playwright/tests/db/columns/columnAttachments.spec.ts | 2 +- tests/playwright/tests/db/general/viewMenu.spec.ts | 4 ++-- tests/playwright/tests/db/views/viewGridShare.spec.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts b/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts index 4fb459ceef..477713a47a 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts +++ b/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts @@ -89,12 +89,12 @@ export class ToolbarViewMenuPage extends BasePage { await this.get().locator(`.ant-dropdown-menu-title-content:has-text("${menu}")`).first().click(); if (subMenu) { // for CSV download, pass locator instead of clicking it here - if (subMenu === 'Download as CSV') { + if (subMenu === 'Download CSV') { await this.verifyDownloadAsCSV({ downloadLocator: this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last(), expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt', }); - } else if (subMenu === 'Download as XLSX') { + } else if (subMenu === 'Download Excel') { await this.verifyDownloadAsXLSX({ downloadLocator: this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last(), expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt', @@ -104,12 +104,12 @@ export class ToolbarViewMenuPage extends BasePage { } switch (subMenu) { - case 'Download as CSV': + case 'Download CSV': await this.verifyToast({ message: 'Successfully exported all table data', }); break; - case 'Download as XLSX': + case 'Download Excel': await this.verifyToast({ message: 'Successfully exported all table data', }); diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/index.ts b/tests/playwright/pages/Dashboard/common/Toolbar/index.ts index 6886a871b3..ca4376fdb9 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/index.ts +++ b/tests/playwright/pages/Dashboard/common/Toolbar/index.ts @@ -206,8 +206,8 @@ export class ToolbarPage extends BasePage { const menuItems = { creator: ['Download', 'Upload'], editor: ['Download', 'Upload'], - commenter: ['Download as CSV', 'Download as XLSX'], - viewer: ['Download as CSV', 'Download as XLSX'], + commenter: ['Download CSV', 'Download Excel'], + viewer: ['Download CSV', 'Download Excel'], }; const vMenu = this.rootPage.locator('.nc-dropdown-actions-menu:visible'); for (const item of menuItems[param.role.toLowerCase()]) { diff --git a/tests/playwright/tests/db/columns/columnAttachments.spec.ts b/tests/playwright/tests/db/columns/columnAttachments.spec.ts index fac8ef6c4b..c7c95bbbbe 100644 --- a/tests/playwright/tests/db/columns/columnAttachments.spec.ts +++ b/tests/playwright/tests/db/columns/columnAttachments.spec.ts @@ -97,7 +97,7 @@ test.describe('Attachment column', () => { await dashboard.grid.toolbar.actions.click('Download'); const csvFileData: string = await dashboard.downloadAndGetFile({ - downloadUIAction: dashboard.grid.toolbar.actions.clickDownloadSubmenu('Download as CSV'), + downloadUIAction: dashboard.grid.toolbar.actions.clickDownloadSubmenu('Download CSV'), }); const csvArray = csvFileData.split('\r\n'); const columns = csvArray[0]; diff --git a/tests/playwright/tests/db/general/viewMenu.spec.ts b/tests/playwright/tests/db/general/viewMenu.spec.ts index 0abd1d316c..ca3ef4fbae 100644 --- a/tests/playwright/tests/db/general/viewMenu.spec.ts +++ b/tests/playwright/tests/db/general/viewMenu.spec.ts @@ -52,7 +52,7 @@ test.describe('Grid view locked', () => { await dashboard.grid.toolbar.viewsMenu.click({ menu: 'Download', - subMenu: 'Download as CSV', + subMenu: 'Download CSV', verificationInfo: { verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null, }, @@ -72,7 +72,7 @@ test.describe('Grid view locked', () => { await dashboard.grid.toolbar.viewsMenu.click({ menu: 'Download', - subMenu: 'Download as XLSX', + subMenu: 'Download Excel', verificationInfo: { verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null, }, diff --git a/tests/playwright/tests/db/views/viewGridShare.spec.ts b/tests/playwright/tests/db/views/viewGridShare.spec.ts index 8cb454c9bf..0b0f588837 100644 --- a/tests/playwright/tests/db/views/viewGridShare.spec.ts +++ b/tests/playwright/tests/db/views/viewGridShare.spec.ts @@ -247,7 +247,7 @@ test.describe('Shared view', () => { // verify download await sharedPage.grid.toolbar.clickDownload( - 'Download as CSV', + 'Download CSV', isSqlite(context) || isPg(context) ? 'expectedDataSqlite.txt' : 'expectedData.txt' ); });