Browse Source

test(playwright): corrections

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4547/head
Pranav C 2 years ago
parent
commit
d70b18f50b
  1. 12
      packages/nc-gui/components/smartsheet/header/Menu.vue
  2. 9
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  3. 2
      tests/playwright/pages/Dashboard/common/Cell/index.ts

12
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -225,14 +225,14 @@ const hideField = async () => {
<template v-if="column.uidt !== UITypes.LinkToAnotherRecord || column.colOptions.type !== RelationTypes.BELONGS_TO"> <template v-if="column.uidt !== UITypes.LinkToAnotherRecord || column.colOptions.type !== RelationTypes.BELONGS_TO">
<a-divider class="!my-0" /> <a-divider class="!my-0" />
<a-menu-item @click="sortByColumn('asc')"> <a-menu-item @click="sortByColumn('asc')">
<div v-e="['c:field:sort', { dir: 'asc' }]" class="nc-column-insert-after nc-header-menu-item"> <div v-e="['a:field:sort', { dir: 'asc' }]" class="nc-column-insert-after nc-header-menu-item">
<MdiSortAscending class="text-primary" /> <MdiSortAscending class="text-primary" />
<!-- Sort Ascending --> <!-- Sort Ascending -->
{{ $t('general.sortAsc') }} {{ $t('general.sortAsc') }}
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item @click="sortByColumn('desc')"> <a-menu-item @click="sortByColumn('desc')">
<div v-e="['c:field:sort', { dir: 'desc' }]" class="nc-column-insert-before nc-header-menu-item"> <div v-e="['a:field:sort', { dir: 'desc' }]" class="nc-column-insert-before nc-header-menu-item">
<MdiSortDescending class="text-primary" /> <MdiSortDescending class="text-primary" />
<!-- Sort Descending --> <!-- Sort Descending -->
{{ $t('general.sortDesc') }} {{ $t('general.sortDesc') }}
@ -241,7 +241,7 @@ const hideField = async () => {
</template> </template>
<a-divider class="!my-0" /> <a-divider class="!my-0" />
<a-menu-item @click="hideField"> <a-menu-item @click="hideField">
<div v-e="['c:field:hide']" class="nc-column-insert-before nc-header-menu-item"> <div v-e="['a:field:hide']" class="nc-column-insert-before nc-header-menu-item">
<MdiEyeOffOutline class="text-primary" /> <MdiEyeOffOutline class="text-primary" />
<!-- Hide Field --> <!-- Hide Field -->
{{ $t('general.hideField') }} {{ $t('general.hideField') }}
@ -254,21 +254,21 @@ const hideField = async () => {
v-if="column.uidt !== UITypes.LinkToAnotherRecord && column.uidt !== UITypes.Lookup && !column.pk" v-if="column.uidt !== UITypes.LinkToAnotherRecord && column.uidt !== UITypes.Lookup && !column.pk"
@click="duplicateColumn" @click="duplicateColumn"
> >
<div v-e="['c:field:duplicate']" class="nc-column-duplicate nc-header-menu-item"> <div v-e="['a:field:duplicate']" class="nc-column-duplicate nc-header-menu-item">
<MdiFileReplaceOutline class="text-primary" /> <MdiFileReplaceOutline class="text-primary" />
<!-- Duplicate --> <!-- Duplicate -->
{{ t('general.duplicate') }} {{ t('general.duplicate') }}
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item @click="addColumn()"> <a-menu-item @click="addColumn()">
<div v-e="['c:field:insert:after']" class="nc-column-insert-after nc-header-menu-item"> <div v-e="['a:field:insert:after']" class="nc-column-insert-after nc-header-menu-item">
<MdiTableColumnPlusAfter class="text-primary" /> <MdiTableColumnPlusAfter class="text-primary" />
<!-- Insert After --> <!-- Insert After -->
{{ t('general.insertAfter') }} {{ t('general.insertAfter') }}
</div> </div>
</a-menu-item> </a-menu-item>
<a-menu-item @click="addColumn(true)"> <a-menu-item @click="addColumn(true)">
<div v-e="['c:field:insert:before']" class="nc-column-insert-before nc-header-menu-item"> <div v-e="['a:field:insert:before']" class="nc-column-insert-before nc-header-menu-item">
<MdiTableColumnPlusBefore class="text-primary" /> <MdiTableColumnPlusBefore class="text-primary" />
<!-- Insert Before --> <!-- Insert Before -->
{{ t('general.insertBefore') }} {{ t('general.insertBefore') }}

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

@ -190,7 +190,7 @@ export class ColumnPageObject extends BasePage {
await this.get().locator('.ant-select-selection-search-input[aria-expanded="true"]').fill(type); await this.get().locator('.ant-select-selection-search-input[aria-expanded="true"]').fill(type);
// Select column type // Select column type
await this.rootPage.locator(`text=${type}:visible`).nth(1).click(); await this.rootPage.locator('.rc-virtual-list-holder-inner > div').locator(`text="${type}"`).click();
} }
async changeReferencedColumnForQrCode({ titleOfReferencedColumn }: { titleOfReferencedColumn: string }) { async changeReferencedColumnForQrCode({ titleOfReferencedColumn }: { titleOfReferencedColumn: string }) {
@ -258,7 +258,12 @@ export class ColumnPageObject extends BasePage {
async hideColumn({ title }: { title: string }) { async hideColumn({ title }: { title: string }) {
await this.grid.get().locator(`th[data-title="${title}"] .nc-ui-dt-dropdown`).click(); await this.grid.get().locator(`th[data-title="${title}"] .nc-ui-dt-dropdown`).click();
await this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field"):visible').click();
await this.waitForResponse({
uiAction: this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field"):visible').click(),
requestUrlPathToMatch: 'api/v1/db/meta/views',
httpMethodsToMatch: ['PATCH'],
});
await expect(this.grid.get().locator(`th[data-title="${title}"]`)).toHaveCount(0); await expect(this.grid.get().locator(`th[data-title="${title}"]`)).toHaveCount(0);
} }

2
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -193,6 +193,6 @@ export class CellPageObject extends BasePage {
) { ) {
await this.get({ index, columnHeader }).click(...clickOptions); await this.get({ index, columnHeader }).click(...clickOptions);
await this.get({ index, columnHeader }).press('Control+C'); await this.get({ index, columnHeader }).press((await this.isMacOs()) ? 'Meta+C' : 'Control+C');
} }
} }

Loading…
Cancel
Save