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.
76 lines
1.7 KiB
76 lines
1.7 KiB
2 years ago
|
import { expect } from '@playwright/test';
|
||
2 years ago
|
import { SettingsPage } from '.';
|
||
2 years ago
|
import BasePage from '../../Base';
|
||
2 years ago
|
|
||
2 years ago
|
export class AuditSettingsPage extends BasePage {
|
||
2 years ago
|
private readonly settings: SettingsPage;
|
||
|
|
||
|
constructor(settings: SettingsPage) {
|
||
2 years ago
|
super(settings.rootPage);
|
||
2 years ago
|
this.settings = settings;
|
||
|
}
|
||
|
|
||
2 years ago
|
get() {
|
||
2 years ago
|
return this.settings.get().locator(`[data-nc="nc-settings-subtab-Audit"]`);
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async verifyRow({
|
||
|
index,
|
||
|
opType,
|
||
|
opSubtype,
|
||
|
description,
|
||
|
user,
|
||
|
created,
|
||
|
}: {
|
||
|
index: number;
|
||
|
opType?: string;
|
||
|
opSubtype?: string;
|
||
|
description?: string;
|
||
|
user?: string;
|
||
|
created?: string;
|
||
|
}) {
|
||
2 years ago
|
const table = await this.get();
|
||
2 years ago
|
const row = table.locator(`tr.ant-table-row`).nth(index);
|
||
2 years ago
|
|
||
|
if (opType) {
|
||
|
await row
|
||
|
.locator(`td.ant-table-cell`)
|
||
|
.nth(0)
|
||
|
.textContent()
|
||
|
.then(async text => await expect(text).toContain(opType));
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
if (opSubtype) {
|
||
|
await row
|
||
|
.locator(`td.ant-table-cell`)
|
||
|
.nth(1)
|
||
|
.textContent()
|
||
|
.then(async text => await expect(text).toContain(opSubtype));
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
if (description) {
|
||
|
await row
|
||
|
.locator(`td.ant-table-cell`)
|
||
|
.nth(2)
|
||
|
.textContent()
|
||
|
.then(async text => await expect(text).toContain(description));
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
if (user) {
|
||
|
await row
|
||
|
.locator(`td.ant-table-cell`)
|
||
|
.nth(3)
|
||
|
.textContent()
|
||
|
.then(async text => await expect(text).toContain(user));
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
if (created) {
|
||
|
await row
|
||
|
.locator(`td.ant-table-cell`)
|
||
|
.nth(4)
|
||
|
.textContent()
|
||
|
.then(async text => await expect(text).toContain(created));
|
||
2 years ago
|
}
|
||
|
}
|
||
2 years ago
|
}
|