Browse Source

fix : fixed datetime test locator

pull/7181/head
musharaf-nocodb 1 year ago
parent
commit
1215d9de95
  1. 4
      packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue
  2. 6
      tests/playwright/pages/Dashboard/Grid/Column/index.ts

4
packages/nc-gui/components/smartsheet/column/DateTimeOptions.vue

@ -25,7 +25,7 @@ if (!vModel.value.meta?.time_format) {
<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-option v-for="(format, i) of dateFormats" :key="i" :value="format">
<div class="flex gap-2 w-full justify-between items-center">
<div class="flex gap-2 w-full justify-between items-center" :data-testid="`nc-date-${format}`">
{{ format }}
<component
:is="iconMap.check"
@ -40,7 +40,7 @@ if (!vModel.value.meta?.time_format) {
<a-form-item :label="$t('labels.timeFormat')">
<a-select v-model:value="vModel.meta.time_format" class="nc-time-select" dropdown-class-name="nc-dropdown-time-format">
<a-select-option v-for="(format, i) of timeFormats" :key="i" :value="format">
<div class="flex gap-2 w-full justify-between items-center">
<div class="flex gap-2 w-full justify-between items-center" :data-testid="`nc-time-${format}`">
{{ format }}
<component
:is="iconMap.check"

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

@ -310,15 +310,15 @@ export class ColumnPageObject extends BasePage {
case 'DateTime':
// Date Format
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-date-${dateFormat}"]`).click();
// Time Format
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(`text="${dateFormat}"`).click();
await this.rootPage.locator('.ant-select-item').locator(`[data-testid="${dateFormat}"]`).click();
break;
default:
break;

Loading…
Cancel
Save