Browse Source

test: fix

pull/6360/head
DarkPhoenix2704 1 year ago
parent
commit
15b7d85c02
  1. 1
      packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
  2. 5
      tests/playwright/pages/Dashboard/ExpandedForm/index.ts
  3. 7
      tests/playwright/pages/Dashboard/Grid/Column/LTAR/LinkRecord.ts

1
packages/nc-gui/components/virtual-cell/components/ListChildItems.vue

@ -145,6 +145,7 @@ watch(expandedFormDlg, () => {
:key="id" :key="id"
:row="refRow" :row="refRow"
:fields="fields" :fields="fields"
data-testid="nc-child-list-item"
:attachment="attachmentCol" :attachment="attachmentCol"
:related-table-display-value-prop="relatedTableDisplayValueProp" :related-table-display-value-prop="relatedTableDisplayValueProp"
:is-linked="isChildrenListLinked[Number.parseInt(id)]" :is-linked="isChildrenListLinked[Number.parseInt(id)]"

5
tests/playwright/pages/Dashboard/ExpandedForm/index.ts

@ -79,7 +79,6 @@ export class ExpandedFormPage extends BasePage {
async fillField({ columnTitle, value, type = 'text' }: { columnTitle: string; value: string; type?: string }) { async fillField({ columnTitle, value, type = 'text' }: { columnTitle: string; value: string; type?: string }) {
const field = this.get().locator(`[data-testid="nc-expand-col-${columnTitle}"]`); const field = this.get().locator(`[data-testid="nc-expand-col-${columnTitle}"]`);
await field.hover();
switch (type) { switch (type) {
case 'text': case 'text':
await field.locator('input').fill(value); await field.locator('input').fill(value);
@ -93,12 +92,14 @@ export class ExpandedFormPage extends BasePage {
break; break;
} }
case 'belongsTo': case 'belongsTo':
await field.locator('.nc-virtual-cell').hover();
await field.locator('.nc-action-icon').click(); await field.locator('.nc-action-icon').click();
await this.dashboard.linkRecord.select(value); await this.dashboard.linkRecord.select(value);
break; break;
case 'hasMany': case 'hasMany':
case 'manyToMany': case 'manyToMany':
await field.locator(`[data-testid="nc-child-list-button-link-to"]`).click(); await field.locator('.nc-virtual-cell').hover();
await field.locator('.nc-action-icon').click();
await this.dashboard.linkRecord.select(value); await this.dashboard.linkRecord.select(value);
break; break;
case 'dateTime': case 'dateTime':

7
tests/playwright/pages/Dashboard/Grid/Column/LTAR/LinkRecord.ts

@ -11,7 +11,7 @@ export class LinkRecord extends BasePage {
} }
async verify(cardTitle?: string[]) { async verify(cardTitle?: string[]) {
await this.dashboard.get().locator('.nc-modal-link-record').waitFor(); await this.dashboard.get().locator('.nc-modal-link-record').last().waitFor();
const linkRecord = this.get(); const linkRecord = this.get();
// DOM element validation // DOM element validation
@ -39,11 +39,12 @@ export class LinkRecord extends BasePage {
async select(cardTitle: string) { async select(cardTitle: string) {
await this.rootPage.waitForTimeout(100); await this.rootPage.waitForTimeout(100);
await this.get().locator(`.ant-card:has-text("${cardTitle}"):visible`).click(); await this.get().locator(`.ant-card:has-text("${cardTitle}"):visible`).click();
await this.close();
} }
async close() { async close() {
await this.get().locator(`.nc-close-btn`).click(); await this.get().locator('.nc-close-btn').last().click();
await this.get().waitFor({ state: 'hidden' }); await this.get().last().waitFor({ state: 'hidden' });
} }
get() { get() {

Loading…
Cancel
Save