mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 06:25:29 +00:00
fix(nc-gui): view action menu test cases
This commit is contained in:
@@ -92,18 +92,24 @@ 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 CSV') {
|
||||
if (subMenu === 'CSV') {
|
||||
await this.verifyDownloadAsCSV({
|
||||
downloadLocator: this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last(),
|
||||
downloadLocator: this.rootPage
|
||||
.locator(`.ant-dropdown-menu-item.ant-dropdown-menu-item-only-child:has-text("${subMenu}")`)
|
||||
.last(),
|
||||
expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt',
|
||||
});
|
||||
} else if (subMenu === 'Download Excel') {
|
||||
} else if (subMenu === 'Excel') {
|
||||
await this.verifyDownloadAsXLSX({
|
||||
downloadLocator: this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last(),
|
||||
downloadLocator: this.rootPage
|
||||
.locator(`.ant-dropdown-menu-item.ant-dropdown-menu-item-only-child:has-text("${subMenu}")`)
|
||||
.last(),
|
||||
expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt',
|
||||
});
|
||||
} else {
|
||||
await this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last().click();
|
||||
const loacator = this.rootPage.getByTestId(`nc-view-action-lock-subaction-${subMenu}`).last();
|
||||
|
||||
await loacator.click();
|
||||
|
||||
if (['Collaborative', 'Locked'].includes(subMenu)) {
|
||||
await this.rootPage.locator(`.nc-lock-view-modal-wrapper`).waitFor({ state: 'visible' });
|
||||
@@ -112,12 +118,12 @@ export class ToolbarViewMenuPage extends BasePage {
|
||||
}
|
||||
|
||||
switch (subMenu) {
|
||||
case 'Download CSV':
|
||||
case 'CSV':
|
||||
await this.verifyToast({
|
||||
message: 'Successfully exported all table data',
|
||||
});
|
||||
break;
|
||||
case 'Download Excel':
|
||||
case 'Excel':
|
||||
await this.verifyToast({
|
||||
message: 'Successfully exported all table data',
|
||||
});
|
||||
|
||||
@@ -52,7 +52,7 @@ test.describe('Grid view locked', () => {
|
||||
|
||||
await dashboard.grid.toolbar.viewsMenu.click({
|
||||
menu: 'Download',
|
||||
subMenu: 'Download CSV',
|
||||
subMenu: '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 Excel',
|
||||
subMenu: 'Excel',
|
||||
verificationInfo: {
|
||||
verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user