Browse Source

test: fix

pull/6360/head
DarkPhoenix2704 11 months 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"
:row="refRow"
:fields="fields"
data-testid="nc-child-list-item"
:attachment="attachmentCol"
:related-table-display-value-prop="relatedTableDisplayValueProp"
: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 }) {
const field = this.get().locator(`[data-testid="nc-expand-col-${columnTitle}"]`);
await field.hover();
switch (type) {
case 'text':
await field.locator('input').fill(value);
@ -93,12 +92,14 @@ export class ExpandedFormPage extends BasePage {
break;
}
case 'belongsTo':
await field.locator('.nc-virtual-cell').hover();
await field.locator('.nc-action-icon').click();
await this.dashboard.linkRecord.select(value);
break;
case 'hasMany':
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);
break;
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[]) {
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();
// DOM element validation
@ -39,11 +39,12 @@ export class LinkRecord extends BasePage {
async select(cardTitle: string) {
await this.rootPage.waitForTimeout(100);
await this.get().locator(`.ant-card:has-text("${cardTitle}"):visible`).click();
await this.close();
}
async close() {
await this.get().locator(`.nc-close-btn`).click();
await this.get().waitFor({ state: 'hidden' });
await this.get().locator('.nc-close-btn').last().click();
await this.get().last().waitFor({ state: 'hidden' });
}
get() {

Loading…
Cancel
Save