mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 14:56:51 +00:00
* chore(nocodb): add fk_parent_column_id in filter schema * feat(nocodb): form view field level filter support * fix(nc-gui): add migration for `fk_parent_column_id` filter property * fix: add support to fetch all view filters * fix(nc-gui): filter castType issue * fix(nc-gui): form field title autofocus issue * fix(nc-gui): small changes * fix(nc-gui): update local form view filter on updating filter * fix(nc-gui): add validate field visibility function * fix(nc-gui): toggle eye icon based on field conditional visibility * fix(nc-gui): show tooltip on hover form field visibility icon * fix(nc-gui): show unique errors * fix(nc-gui): sort form view field issue * fix(nc-gui): add error handleling in form conditional field * fix(nc-gui): validate field on reorder * fix(nc-gui): disable add new filter if form field is first * fix(nc-gui): disable undo redo filters in form view * fix(nc-gui): move form filter class to ee * fix(nc-gui): prevent unwanted api call on form field select * fix(nc-gui): remove unwanted console * feat(nc-gui): shared form view conditional fields * fix(nc-gui): form filter cache issue * fix(nc-gui): delete form filters by fk_parent_col_id * fix(nc-gui): form view duplicate filters * fix(nc-gui): column meta copy issue while duplicating form view * fix(nc-gui): review changes * docs: show on conditions * fix(nc-gui): remove merge conflict code part * fix(nc-gui): show first validation error in visible form columns on hover over config error * fix(nc-gui): form view filter validate link field issue * fix(nc-gui): duplicate form column filters on duplicating table * fix(nc-gui): rename form field filters label to conditions * fix(nc-gui): minor changes * chore(nc-gui): lint * fix(nocodb): migration conflict issue * fix(nc-gui): currency field ui issue in filter input * fix(nc-gui): rating field overflow issue in filter menu * fix(nc-gui): form conditional field oss visibility issue * test(nc-gui): form conditional field test * fix(nc-gui): typo error * chore(nc-gui): lint * fix(nc-gui): filter input width issue * fix: pw test fail issue * fix(nc-gui): update pw test * fix(nc-gui): show field field config error in form field list * fix(nc-gui): grayed out form field list icon color * fix(nc-gui): give precedence to hidden pre-filled fields over conditional fields * fix(nocodb): use string type instead of any * fix(nocodb): typo mistake * fix(nocodb): use stringifyMetaProp instead of JSON.stringify * fix(nc-gui): remove lazy loading from child components of form field settings * fix(nc-gui): increase gap between plus & delete btn from group filter menu * fix(nc-gui): max callstack issue after adding group filter from form view * fix(nc-gui): increase min width of filter dropdown in form view * chore(nc-gui): lint * fix(nc-gui): required virtual field validation issue in shared form * fix(nc-gui): delete conditionally hidden field data while submiting form * fix(nc-gui): handle bt or oo cell conditional field validation issue * chore(nc-gui): lint * fix(nc-gui): new is utils file function name conflicts * fix(nc-gui): remove console --------- Co-authored-by: Raju Udava <86527202+dstala@users.noreply.github.com>
121 lines
3.8 KiB
TypeScript
121 lines
3.8 KiB
TypeScript
import { expect, Page } from '@playwright/test';
|
|
import BasePage from '../Base';
|
|
import { CellPageObject } from '../Dashboard/common/Cell';
|
|
|
|
export class SharedFormPage extends BasePage {
|
|
readonly cell: CellPageObject;
|
|
|
|
constructor(rootPage: Page) {
|
|
super(rootPage);
|
|
this.cell = new CellPageObject(this);
|
|
}
|
|
|
|
get() {
|
|
return this.rootPage.locator('html');
|
|
}
|
|
|
|
async submit() {
|
|
await this.waitForResponse({
|
|
uiAction: async () => await this.get().getByTestId('shared-form-submit-button').first().click(),
|
|
httpMethodsToMatch: ['POST'],
|
|
requestUrlPathToMatch: '/rows',
|
|
});
|
|
|
|
await this.rootPage.waitForTimeout(200);
|
|
}
|
|
|
|
async verifySuccessMessage() {
|
|
await this.rootPage.locator('.nc-shared-form-success-msg').waitFor({ state: 'visible', timeout: 10000 });
|
|
await expect(
|
|
this.get().locator('.ant-alert-success', {
|
|
hasText: 'Successfully submitted form data',
|
|
})
|
|
).toBeVisible();
|
|
}
|
|
|
|
async clickLinkToChildList() {
|
|
await this.get().locator('.nc-virtual-cell').hover();
|
|
await this.get().locator('.nc-action-icon').click({ force: true });
|
|
//await this.get().locator('button[data-testid="nc-child-list-button-link-to"]').click();
|
|
}
|
|
|
|
async closeLinkToChildList() {
|
|
// await this.get().locator('.nc-close-btn').click();
|
|
await this.rootPage.keyboard.press('Escape');
|
|
}
|
|
|
|
async verifyChildList(cardTitle?: string[]) {
|
|
await this.get().locator('.nc-modal-link-record').waitFor();
|
|
const linkRecord = this.get();
|
|
|
|
// DOM element validation
|
|
// title: Link Record
|
|
// button: Add new record
|
|
// icon: reload
|
|
//await expect(this.get().locator(`.ant-modal-title`)).toHaveText(`Link record`);
|
|
|
|
// add new record option is not available for shared form
|
|
expect(await linkRecord.locator(`button:has-text("Link more records")`).isVisible()).toBeFalsy();
|
|
|
|
// placeholder: Filter query
|
|
expect(await linkRecord.locator('.nc-excluded-search').isVisible()).toBeTruthy();
|
|
|
|
{
|
|
const childList = linkRecord.locator(`.ant-card`);
|
|
await expect.poll(() => linkRecord.locator(`.ant-card`).count()).toBe(cardTitle.length);
|
|
for (let i = 0; i < cardTitle.length; i++) {
|
|
expect(await childList.nth(i).textContent()).toContain(cardTitle[i]);
|
|
}
|
|
}
|
|
}
|
|
|
|
async selectChildList(cardTitle: string) {
|
|
await this.get()
|
|
.locator(`.ant-card:has-text("${cardTitle}"):visible`)
|
|
.locator('.nc-list-item-link-unlink-btn')
|
|
.click();
|
|
}
|
|
|
|
fieldLabel({ title }: { title: string }) {
|
|
return this.get()
|
|
.getByTestId(`nc-shared-form-item-${title.replace(' ', '')}`)
|
|
.locator('.nc-form-column-label');
|
|
}
|
|
|
|
async getFormFieldErrors({ title }: { title: string }) {
|
|
const field = this.get().getByTestId(`nc-shared-form-item-${title.replace(' ', '')}`);
|
|
await field.scrollIntoViewIfNeeded();
|
|
const fieldErrorEl = field.locator('.ant-form-item-explain');
|
|
return {
|
|
locator: fieldErrorEl,
|
|
verify: async ({ hasError, hasErrorMsg }: { hasError?: boolean; hasErrorMsg?: string | RegExp }) => {
|
|
if (hasError !== undefined) {
|
|
if (hasError) {
|
|
await fieldErrorEl.waitFor({ state: 'visible' });
|
|
|
|
await expect(fieldErrorEl).toBeVisible();
|
|
} else {
|
|
await expect(fieldErrorEl).not.toBeVisible();
|
|
}
|
|
}
|
|
|
|
if (hasErrorMsg !== undefined) {
|
|
await fieldErrorEl.waitFor({ state: 'visible' });
|
|
|
|
await expect(fieldErrorEl.locator('> div').filter({ hasText: hasErrorMsg }).first()).toHaveText(hasErrorMsg);
|
|
}
|
|
},
|
|
};
|
|
}
|
|
|
|
async verifyField({ title, isVisible }: { title: string; isVisible: boolean }) {
|
|
const field = this.fieldLabel({ title });
|
|
|
|
if (isVisible) {
|
|
await expect(field).toBeVisible();
|
|
} else {
|
|
await expect(field).not.toBeVisible();
|
|
}
|
|
}
|
|
}
|