|
|
@ -3,6 +3,7 @@ import { GridPage } from '..'; |
|
|
|
import BasePage from '../../../Base'; |
|
|
|
import BasePage from '../../../Base'; |
|
|
|
import { SelectOptionColumnPageObject } from './SelectOptionColumn'; |
|
|
|
import { SelectOptionColumnPageObject } from './SelectOptionColumn'; |
|
|
|
import { AttachmentColumnPageObject } from './Attachment'; |
|
|
|
import { AttachmentColumnPageObject } from './Attachment'; |
|
|
|
|
|
|
|
import { getTextExcludeIconText } from '../../../../tests/utils/general'; |
|
|
|
|
|
|
|
|
|
|
|
export class ColumnPageObject extends BasePage { |
|
|
|
export class ColumnPageObject extends BasePage { |
|
|
|
readonly grid: GridPage; |
|
|
|
readonly grid: GridPage; |
|
|
@ -183,14 +184,15 @@ export class ColumnPageObject extends BasePage { |
|
|
|
|
|
|
|
|
|
|
|
// verify column inserted after the target column
|
|
|
|
// verify column inserted after the target column
|
|
|
|
if (insertAfterColumnTitle) { |
|
|
|
if (insertAfterColumnTitle) { |
|
|
|
const headersText = await this.grid.get().locator(`th`).allTextContents(); |
|
|
|
const headersText = []; |
|
|
|
|
|
|
|
const locator = this.grid.get().locator(`th`); |
|
|
|
await expect( |
|
|
|
const count = await locator.count(); |
|
|
|
this.grid |
|
|
|
for (let i = 0; i < count; i++) { |
|
|
|
.get() |
|
|
|
const header = locator.nth(i); |
|
|
|
.locator(`th`) |
|
|
|
const text = await getTextExcludeIconText(header); |
|
|
|
.nth(headersText.findIndex(title => title.startsWith(insertAfterColumnTitle)) + 1) |
|
|
|
headersText.push(text); |
|
|
|
).toHaveText(title); |
|
|
|
} |
|
|
|
|
|
|
|
expect(headersText[headersText.findIndex(title => title.startsWith(insertAfterColumnTitle)) + 1]).toBe(title); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// verify column inserted before the target column
|
|
|
|
// verify column inserted before the target column
|
|
|
|