Browse Source

test: shortcuts, scroll cell into view for tests

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
temp-5c4a2f8331a3f36534606c6dcdb34a67f95aea6d
Raju Udava 1 year ago
parent
commit
38e2e2a918
  1. 1
      tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts
  2. 1
      tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts
  3. 1
      tests/playwright/pages/Dashboard/common/Cell/index.ts

1
tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts

@ -25,6 +25,7 @@ export class AttachmentCellPageObject extends BasePage {
const attachFileAction = this.get({ index, columnHeader })
.locator('[data-testid="attachment-cell-file-picker-button"]')
.click();
await this.get({ index, columnHeader }).scrollIntoViewIfNeeded();
return await this.attachFile({ filePickUIAction: attachFileAction, filePath });
}

1
tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts

@ -23,6 +23,7 @@ export class RatingCellPageObject extends BasePage {
}
async verify({ index, columnHeader, rating }: { index?: number; columnHeader: string; rating: number }) {
await this.get({ index, columnHeader }).scrollIntoViewIfNeeded();
await expect(await this.get({ index, columnHeader }).locator(`div[role="radio"][aria-checked="true"]`)).toHaveCount(
rating
);

1
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -322,6 +322,7 @@ export class CellPageObject extends BasePage {
}
async copyToClipboard({ index, columnHeader }: CellProps, ...clickOptions: Parameters<Locator['click']>) {
await this.get({ index, columnHeader }).scrollIntoViewIfNeeded();
await this.get({ index, columnHeader }).click(...clickOptions);
await (await this.get({ index, columnHeader }).elementHandle()).waitForElementState('stable');

Loading…
Cancel
Save