|
|
|
@ -64,7 +64,13 @@ export class GridPage extends BasePage {
|
|
|
|
|
index = 0, |
|
|
|
|
columnHeader = "Title", |
|
|
|
|
value, |
|
|
|
|
}: { index?: number; columnHeader?: string; value?: string } = {}) { |
|
|
|
|
networkValidation = true, |
|
|
|
|
}: { |
|
|
|
|
index?: number; |
|
|
|
|
columnHeader?: string; |
|
|
|
|
value?: string; |
|
|
|
|
networkValidation?: boolean; |
|
|
|
|
} = {}) { |
|
|
|
|
const rowValue = value ?? `Row ${index}`; |
|
|
|
|
const rowCount = await this.get().locator(".nc-grid-row").count(); |
|
|
|
|
await this.get().locator(".nc-grid-add-new-cell").click(); |
|
|
|
@ -80,22 +86,28 @@ export class GridPage extends BasePage {
|
|
|
|
|
.locator(`span[title="${columnHeader}"]`) |
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
if (networkValidation) { |
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: clickOnColumnHeaderToSave, |
|
|
|
|
requestUrlPathToMatch: "api/v1/db/data/noco", |
|
|
|
|
httpMethodsToMatch: ["POST"], |
|
|
|
|
responseJsonMatcher: (resJson) => resJson?.[columnHeader] === value, |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
await this.rootPage.waitForTimeout(300); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async editRow({ |
|
|
|
|
index = 0, |
|
|
|
|
columnHeader = "Title", |
|
|
|
|
value, |
|
|
|
|
networkValidation = true, |
|
|
|
|
}: { |
|
|
|
|
index?: number; |
|
|
|
|
columnHeader?: string; |
|
|
|
|
value: string; |
|
|
|
|
networkValidation?: boolean; |
|
|
|
|
}) { |
|
|
|
|
await this._fillRow({ index, columnHeader, value }); |
|
|
|
|
|
|
|
|
@ -104,12 +116,16 @@ export class GridPage extends BasePage {
|
|
|
|
|
.locator(`span[title="${columnHeader}"]`) |
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
if (networkValidation) { |
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: clickOnColumnHeaderToSave, |
|
|
|
|
requestUrlPathToMatch: "api/v1/db/data/noco", |
|
|
|
|
httpMethodsToMatch: ["PATCH"], |
|
|
|
|
responseJsonMatcher: (resJson) => resJson?.[columnHeader] === value, |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
await this.rootPage.waitForTimeout(300); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async verifyRow({ index }: { index: number }) { |
|
|
|
|