|
|
@ -77,9 +77,9 @@ export class CellPageObject extends BasePage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async inCellExpand({ index, columnHeader }: CellProps) { |
|
|
|
async inCellExpand({ index, columnHeader }: CellProps) { |
|
|
|
await this.get({ index, columnHeader }).hover(); |
|
|
|
// await this.get({ index, columnHeader }).hover();
|
|
|
|
await this.waitForResponse({ |
|
|
|
await this.waitForResponse({ |
|
|
|
uiAction: () => this.get({ index, columnHeader }).locator('.nc-action-icon >> nth=0').click(), |
|
|
|
uiAction: () => this.get({ index, columnHeader }).locator('.nc-datatype-link').click(), |
|
|
|
requestUrlPathToMatch: '/api/v1/db/data/noco/', |
|
|
|
requestUrlPathToMatch: '/api/v1/db/data/noco/', |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
}); |
|
|
|
}); |
|
|
@ -268,39 +268,47 @@ export class CellPageObject extends BasePage { |
|
|
|
async verifyVirtualCell({ |
|
|
|
async verifyVirtualCell({ |
|
|
|
index, |
|
|
|
index, |
|
|
|
columnHeader, |
|
|
|
columnHeader, |
|
|
|
|
|
|
|
type, |
|
|
|
count, |
|
|
|
count, |
|
|
|
value, |
|
|
|
value, |
|
|
|
verifyChildList = false, |
|
|
|
verifyChildList = false, |
|
|
|
}: CellProps & { |
|
|
|
}: CellProps & { |
|
|
|
count?: number; |
|
|
|
count?: number; |
|
|
|
|
|
|
|
type?: 'hm' | 'bt' | 'mm'; |
|
|
|
value: string[]; |
|
|
|
value: string[]; |
|
|
|
verifyChildList?: boolean; |
|
|
|
verifyChildList?: boolean; |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
// const count = value.length;
|
|
|
|
|
|
|
|
const cell = await this.get({ index, columnHeader }); |
|
|
|
const cell = await this.get({ index, columnHeader }); |
|
|
|
const chips = cell.locator('.chips > .chip'); |
|
|
|
const linkText = await cell.locator('.nc-datatype-link'); |
|
|
|
|
|
|
|
|
|
|
|
await this.get({ index, columnHeader }).scrollIntoViewIfNeeded(); |
|
|
|
await cell.scrollIntoViewIfNeeded(); |
|
|
|
|
|
|
|
|
|
|
|
// verify chip count & contents
|
|
|
|
if (type === 'bt') { |
|
|
|
if (count) await expect(chips).toHaveCount(count); |
|
|
|
const chips = cell.locator('.chips > .chip'); |
|
|
|
|
|
|
|
console.log('chips', await chips.count()); |
|
|
|
|
|
|
|
await expect(await chips.count()).toBe(count); |
|
|
|
|
|
|
|
|
|
|
|
// verify only the elements that are passed in
|
|
|
|
|
|
|
|
for (let i = 0; i < value.length; ++i) { |
|
|
|
for (let i = 0; i < value.length; ++i) { |
|
|
|
await chips.nth(i).locator('.name').waitFor({ state: 'visible' }); |
|
|
|
await chips.nth(i).locator('.name').waitFor({ state: 'visible' }); |
|
|
|
await chips.nth(i).locator('.name').scrollIntoViewIfNeeded(); |
|
|
|
await chips.nth(i).locator('.name').scrollIntoViewIfNeeded(); |
|
|
|
await expect(await chips.nth(i).locator('.name')).toHaveText(value[i]); |
|
|
|
await expect(await chips.nth(i).locator('.name')).toHaveText(value[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// verify chip count & contents
|
|
|
|
|
|
|
|
if (count) { |
|
|
|
|
|
|
|
await expect(await cell.innerText()).toContain(`${count} ${count === 1 ? 'Link' : 'Links'}`); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (verifyChildList) { |
|
|
|
if (verifyChildList) { |
|
|
|
// open child list
|
|
|
|
// open child list
|
|
|
|
await this.get({ index, columnHeader }).hover(); |
|
|
|
await this.get({ index, columnHeader }).hover(); |
|
|
|
const arrow_expand = await this.get({ index, columnHeader }).locator('.nc-arrow-expand'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// arrow expand doesn't exist for bt columns
|
|
|
|
// arrow expand doesn't exist for bt columns
|
|
|
|
if (await arrow_expand.count()) { |
|
|
|
if (await linkText.count()) { |
|
|
|
await this.waitForResponse({ |
|
|
|
await this.waitForResponse({ |
|
|
|
uiAction: () => arrow_expand.click(), |
|
|
|
uiAction: () => linkText.click(), |
|
|
|
requestUrlPathToMatch: '/api/v1/db', |
|
|
|
requestUrlPathToMatch: '/api/v1/db', |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
}); |
|
|
|
}); |
|
|
|