Browse Source

fix: Integrated Download CSV & Excel label rename to tests

pull/6888/head
Muhammed Mustafa 1 year ago
parent
commit
833b9acfb5
  1. 8
      tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts
  2. 4
      tests/playwright/pages/Dashboard/common/Toolbar/index.ts
  3. 2
      tests/playwright/tests/db/columns/columnAttachments.spec.ts
  4. 4
      tests/playwright/tests/db/general/viewMenu.spec.ts
  5. 2
      tests/playwright/tests/db/views/viewGridShare.spec.ts

8
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(); await this.get().locator(`.ant-dropdown-menu-title-content:has-text("${menu}")`).first().click();
if (subMenu) { if (subMenu) {
// for CSV download, pass locator instead of clicking it here // for CSV download, pass locator instead of clicking it here
if (subMenu === 'Download as CSV') { if (subMenu === 'Download CSV') {
await this.verifyDownloadAsCSV({ await this.verifyDownloadAsCSV({
downloadLocator: this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last(), downloadLocator: this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last(),
expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt', expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt',
}); });
} else if (subMenu === 'Download as XLSX') { } else if (subMenu === 'Download Excel') {
await this.verifyDownloadAsXLSX({ await this.verifyDownloadAsXLSX({
downloadLocator: this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last(), downloadLocator: this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last(),
expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt', expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt',
@ -104,12 +104,12 @@ export class ToolbarViewMenuPage extends BasePage {
} }
switch (subMenu) { switch (subMenu) {
case 'Download as CSV': case 'Download CSV':
await this.verifyToast({ await this.verifyToast({
message: 'Successfully exported all table data', message: 'Successfully exported all table data',
}); });
break; break;
case 'Download as XLSX': case 'Download Excel':
await this.verifyToast({ await this.verifyToast({
message: 'Successfully exported all table data', message: 'Successfully exported all table data',
}); });

4
tests/playwright/pages/Dashboard/common/Toolbar/index.ts

@ -206,8 +206,8 @@ export class ToolbarPage extends BasePage {
const menuItems = { const menuItems = {
creator: ['Download', 'Upload'], creator: ['Download', 'Upload'],
editor: ['Download', 'Upload'], editor: ['Download', 'Upload'],
commenter: ['Download as CSV', 'Download as XLSX'], commenter: ['Download CSV', 'Download Excel'],
viewer: ['Download as CSV', 'Download as XLSX'], viewer: ['Download CSV', 'Download Excel'],
}; };
const vMenu = this.rootPage.locator('.nc-dropdown-actions-menu:visible'); const vMenu = this.rootPage.locator('.nc-dropdown-actions-menu:visible');
for (const item of menuItems[param.role.toLowerCase()]) { for (const item of menuItems[param.role.toLowerCase()]) {

2
tests/playwright/tests/db/columns/columnAttachments.spec.ts

@ -97,7 +97,7 @@ test.describe('Attachment column', () => {
await dashboard.grid.toolbar.actions.click('Download'); await dashboard.grid.toolbar.actions.click('Download');
const csvFileData: string = await dashboard.downloadAndGetFile({ 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 csvArray = csvFileData.split('\r\n');
const columns = csvArray[0]; const columns = csvArray[0];

4
tests/playwright/tests/db/general/viewMenu.spec.ts

@ -52,7 +52,7 @@ test.describe('Grid view locked', () => {
await dashboard.grid.toolbar.viewsMenu.click({ await dashboard.grid.toolbar.viewsMenu.click({
menu: 'Download', menu: 'Download',
subMenu: 'Download as CSV', subMenu: 'Download CSV',
verificationInfo: { verificationInfo: {
verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null, verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null,
}, },
@ -72,7 +72,7 @@ test.describe('Grid view locked', () => {
await dashboard.grid.toolbar.viewsMenu.click({ await dashboard.grid.toolbar.viewsMenu.click({
menu: 'Download', menu: 'Download',
subMenu: 'Download as XLSX', subMenu: 'Download Excel',
verificationInfo: { verificationInfo: {
verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null, verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null,
}, },

2
tests/playwright/tests/db/views/viewGridShare.spec.ts

@ -247,7 +247,7 @@ test.describe('Shared view', () => {
// verify download // verify download
await sharedPage.grid.toolbar.clickDownload( await sharedPage.grid.toolbar.clickDownload(
'Download as CSV', 'Download CSV',
isSqlite(context) || isPg(context) ? 'expectedDataSqlite.txt' : 'expectedData.txt' isSqlite(context) || isPg(context) ? 'expectedDataSqlite.txt' : 'expectedData.txt'
); );
}); });

Loading…
Cancel
Save