mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
802 B
33 lines
802 B
2 years ago
|
import { expect, Page } from '@playwright/test';
|
||
2 years ago
|
import BasePage from '../Base';
|
||
|
import { CellPageObject } from '../Dashboard/common/Cell';
|
||
2 years ago
|
|
||
|
export class SharedFormPage extends BasePage {
|
||
|
readonly cell: CellPageObject;
|
||
|
|
||
|
constructor(rootPage: Page) {
|
||
|
super(rootPage);
|
||
|
this.cell = new CellPageObject(this);
|
||
|
}
|
||
|
|
||
|
get() {
|
||
2 years ago
|
return this.rootPage.locator('html');
|
||
2 years ago
|
}
|
||
|
|
||
|
async submit() {
|
||
2 years ago
|
await this.waitForResponse({
|
||
2 years ago
|
uiAction: this.get().locator('[data-testid="shared-form-submit-button"]').click(),
|
||
2 years ago
|
httpMethodsToMatch: ['POST'],
|
||
|
requestUrlPathToMatch: '/rows',
|
||
2 years ago
|
});
|
||
|
}
|
||
|
|
||
|
async verifySuccessMessage() {
|
||
2 years ago
|
await expect(
|
||
|
await this.get().locator('.ant-alert-success', {
|
||
|
hasText: 'Successfully submitted form data',
|
||
|
})
|
||
|
).toBeVisible();
|
||
2 years ago
|
}
|
||
|
}
|