diff --git a/packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue b/packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue index 16b866feea..810ab30866 100644 --- a/packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue +++ b/packages/nc-gui/components/smartsheet/column/BarcodeOptions.vue @@ -86,7 +86,7 @@ vModel.value.meta = { /> diff --git a/tests/playwright/pages/Dashboard/Grid/Column/index.ts b/tests/playwright/pages/Dashboard/Grid/Column/index.ts index f407293abd..8d9712e650 100644 --- a/tests/playwright/pages/Dashboard/Grid/Column/index.ts +++ b/tests/playwright/pages/Dashboard/Grid/Column/index.ts @@ -112,6 +112,12 @@ export class ColumnPageObject extends BasePage { hasText: new RegExp(`^${barcodeValueColumnTitle}$`), }) .click(); + // await this.get().locator('.ant-select-single').nth(2).click(); + // await this.rootPage + // .locator(`.ant-select-item`, { + // hasText: new RegExp(`^${barcodeFormat}$`), + // }) + // .click(); break; case 'Lookup': await this.get().locator('.ant-select-single').nth(1).click(); @@ -229,6 +235,17 @@ export class ColumnPageObject extends BasePage { await this.save(); } + async changeBarcodeFormat({ barcodeFormatName }: { barcodeFormatName: string }) { + await this.get().locator('.nc-barcode-format-select .ant-select-single').click(); + await this.rootPage + .locator(`.ant-select-item`, { + hasText: barcodeFormatName, + }) + .click(); + + await this.save(); + } + async delete({ title }: { title: string }) { await this.getColumnHeader(title).locator('svg.ant-dropdown-trigger').click(); // await this.rootPage.locator('li[role="menuitem"]:has-text("Delete")').waitFor(); @@ -268,6 +285,14 @@ export class ColumnPageObject extends BasePage { }) .click(); break; + // case 'Barcode': + // await this.get().locator('.ant-select-single').nth(1).click(); + // await this.rootPage + // .locator(`.ant-select-item`, { + // hasText: format, + // }) + // .click(); + // break; default: break; } diff --git a/tests/playwright/tests/columnBarcode.spec.ts b/tests/playwright/tests/columnBarcode.spec.ts index c963862241..85a1ea47e0 100644 --- a/tests/playwright/tests/columnBarcode.spec.ts +++ b/tests/playwright/tests/columnBarcode.spec.ts @@ -124,9 +124,54 @@ test.describe('Virtual Columns', () => { await dashboard.closeTab({ title: 'City' }); }); - test('deletion of the barcode column: directly and indirectly when the reference value column is deleted', async () => {}); + test('deletion of the barcode column: directly and indirectly when the reference value column is deleted', async () => { + await dashboard.closeTab({ title: 'Team & Auth' }); + + await dashboard.treeView.openTable({ title: 'City' }); + + await grid.column.create({ title: 'column_name_a' }); + await grid.column.verify({ title: 'column_name_a' }); + await grid.column.create({ + title: 'Barcode2', + type: 'Barcode', + barcodeValueColumnTitle: 'column_name_a', + }); + await grid.column.verify({ title: 'Barcode2', isVisible: true }); + await grid.column.delete({ title: 'Barcode2' }); + await grid.column.verify({ title: 'Barcode2', isVisible: false }); + + await grid.column.create({ + title: 'Barcode2', + type: 'Barcode', + barcodeValueColumnTitle: 'column_name_a', + }); + await grid.column.verify({ title: 'Barcode2', isVisible: true }); + await grid.column.delete({ title: 'column_name_a' }); + await grid.column.verify({ title: 'Barcode2', isVisible: false }); + + await dashboard.closeTab({ title: 'City' }); + }); + + test('changing the format of the Barcode is reflected in the change of the actual rendered barcode', async () => { + await dashboard.closeTab({ title: 'Team & Auth' }); + + await dashboard.treeView.openTable({ title: 'City' }); - test('changing the format of the Barcode is reflected in the change of the actual rendered barcode', async () => {}); + await grid.column.create({ title: 'column_name_b' }); + await grid.column.verify({ title: 'column_name_b' }); + await grid.column.create({ + title: 'Barcode3', + type: 'Barcode', + barcodeValueColumnTitle: 'column_name_b', + barcodeFormat: 'CODE128', + }); + await grid.column.openEdit({ + title: 'Barcode3', + type: 'Barcode', + }); + await grid.column.changeBarcodeFormat({ barcodeFormatName: 'CODE39' }); + + }); test('barcode cells with invalid input for the choosen barcode format are showing a replacement message', async () => {}); });