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.
32 lines
1.1 KiB
32 lines
1.1 KiB
2 years ago
|
import { expect } from '@playwright/test';
|
||
|
import { CellPageObject } from '.';
|
||
|
import BasePage from '../../../Base';
|
||
2 years ago
|
|
||
|
export class AttachmentCellPageObject extends BasePage {
|
||
|
readonly cell: CellPageObject;
|
||
|
|
||
|
constructor(cell: CellPageObject) {
|
||
|
super(cell.rootPage);
|
||
|
this.cell = cell;
|
||
|
}
|
||
|
|
||
2 years ago
|
get({ index, columnHeader }: { index?: number; columnHeader: string }) {
|
||
|
return this.cell.get({ index, columnHeader });
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
clickFilePicker({ index, columnHeader }: { index?: number; columnHeader: string }) {
|
||
2 years ago
|
return this.get({ index, columnHeader }).locator('[data-nc="attachment-cell-file-picker-button"]').click();
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async addFile({ index, columnHeader, filePath }: { index?: number; columnHeader: string; filePath: string }) {
|
||
|
const attachFileAction = this.get({ index, columnHeader })
|
||
2 years ago
|
.locator('[data-nc="attachment-cell-file-picker-button"]')
|
||
2 years ago
|
.click();
|
||
|
return await this.attachFile({ filePickUIAction: attachFileAction, filePath });
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async verifyFile({ index, columnHeader }: { index: number; columnHeader: string }) {
|
||
|
await expect(await this.get({ index, columnHeader }).locator('.nc-attachment')).toBeVisible();
|
||
2 years ago
|
}
|
||
2 years ago
|
}
|