Browse Source

fix : fixed qr test case

pull/7181/head
musharaf-nocodb 12 months ago
parent
commit
2cf1c214c4
  1. 2
      packages/nc-gui/components/smartsheet/column/DateOptions.vue
  2. 2
      packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue
  3. 21
      tests/playwright/pages/Dashboard/Grid/Column/index.ts

2
packages/nc-gui/components/smartsheet/column/DateOptions.vue

@ -20,7 +20,7 @@ if (!vModel.value.meta?.date_format) {
<a-form-item :label="$t('labels.dateFormat')"> <a-form-item :label="$t('labels.dateFormat')">
<a-select v-model:value="vModel.meta.date_format" class="nc-date-select" dropdown-class-name="nc-dropdown-date-format"> <a-select v-model:value="vModel.meta.date_format" class="nc-date-select" dropdown-class-name="nc-dropdown-date-format">
<a-select-option v-for="(format, i) of [...dateFormats, ...dateMonthFormats]" :key="i" :value="format"> <a-select-option v-for="(format, i) of [...dateFormats, ...dateMonthFormats]" :key="i" :value="format">
<div class="flex gap-2 justify-between items-center" :data-testid="`${format}`"> <div class="flex gap-2 justify-between items-center" :data-testid="`nc-${format}`">
{{ format }} {{ format }}
<component <component
:is="iconMap.check" :is="iconMap.check"

2
packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue

@ -57,7 +57,7 @@ setAdditionalValidations({
@click.stop @click.stop
> >
<a-select-option v-for="opt of columnsAllowedAsQrValue" :key="opt" :value="opt.value"> <a-select-option v-for="opt of columnsAllowedAsQrValue" :key="opt" :value="opt.value">
<div class="flex gap-2 w-full truncate items-center"> <div class="flex gap-2 w-full truncate items-center" :data-testid="`nc-qr-${opt.label}`">
<NcTooltip show-on-truncate-only class="flex-1 truncate"> <NcTooltip show-on-truncate-only class="flex-1 truncate">
<template #title>{{ opt.label }}</template> <template #title>{{ opt.label }}</template>
{{ opt.label }} {{ opt.label }}

21
tests/playwright/pages/Dashboard/Grid/Column/index.ts

@ -104,18 +104,18 @@ export class ColumnPageObject extends BasePage {
.click(); .click();
} }
break; break;
case 'Date':
// Date Format
await this.get().locator('.nc-date-select').click();
await this.rootPage.locator('.ant-select-item').locator(`text="${dateFormat}"`).click();
break;
case 'DateTime': case 'DateTime':
// Date Format // Date Format
await this.get().locator('.nc-date-select').click(); await this.get().locator('.nc-date-select').click();
await this.rootPage.locator('.ant-select-item').locator(`text="${dateFormat}"`).click(); await this.rootPage.locator('.ant-select-item').locator(`[data-testid="nc-date-${dateFormat}"]`).click();
// Time Format // Time Format
await this.get().locator('.nc-time-select').click(); await this.get().locator('.nc-time-select').click();
await this.rootPage.locator('.ant-select-item').locator(`text="${timeFormat}"`).click(); await this.rootPage.locator('.ant-select-item').locator(`[data-testid="nc-time-${timeFormat}"]`).click();
break;
case 'Date':
// Date Format
await this.get().locator('.nc-date-select').click();
await this.rootPage.locator('.ant-select-item').locator(`[data-testid="nc-${dateFormat}"]`).click();
break; break;
case 'Formula': case 'Formula':
await this.get().locator('.nc-formula-input').fill(formula); await this.get().locator('.nc-formula-input').fill(formula);
@ -123,9 +123,8 @@ export class ColumnPageObject extends BasePage {
case 'QrCode': case 'QrCode':
await this.get().locator('.ant-select-single').nth(1).click(); await this.get().locator('.ant-select-single').nth(1).click();
await this.rootPage await this.rootPage
.locator(`.ant-select-item`, { .locator(`.ant-select-item`)
hasText: new RegExp(`^${qrCodeValueColumnTitle}$`), .locator(`[data-testid="nc-qr-${qrCodeValueColumnTitle}"]`)
})
.click(); .click();
break; break;
case 'Barcode': case 'Barcode':
@ -318,7 +317,7 @@ export class ColumnPageObject extends BasePage {
case 'Date': case 'Date':
// Date Format // Date Format
await this.get().locator('.nc-date-select').click(); await this.get().locator('.nc-date-select').click();
await this.rootPage.locator('.ant-select-item').locator(`[data-testid="${dateFormat}"]`).click(); await this.rootPage.locator('.ant-select-item').locator(`[data-testid="nc-${dateFormat}"]`).click();
break; break;
default: default:
break; break;

Loading…
Cancel
Save