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.
35 lines
1.1 KiB
35 lines
1.1 KiB
2 years ago
|
import BasePage from '../../Base';
|
||
5 months ago
|
import { expect } from '@playwright/test';
|
||
4 months ago
|
import { DataSourcePage } from './DataSourcePage';
|
||
2 years ago
|
|
||
|
export class AclPage extends BasePage {
|
||
4 months ago
|
readonly dataSources: DataSourcePage;
|
||
2 years ago
|
|
||
4 months ago
|
constructor(dataSources: DataSourcePage) {
|
||
2 years ago
|
super(dataSources.rootPage);
|
||
|
this.dataSources = dataSources;
|
||
2 years ago
|
}
|
||
|
|
||
|
get() {
|
||
4 months ago
|
return this.dataSources.getDsDetailsModal();
|
||
2 years ago
|
}
|
||
|
|
||
|
async toggle({ table, role }: { table: string; role: string }) {
|
||
|
await this.get().locator(`.nc-acl-${table}-${role}-chkbox`).click();
|
||
|
}
|
||
|
|
||
5 months ago
|
async verify({ table, role, expectedValue }: { table: string; role: string; expectedValue: boolean }) {
|
||
|
const isChecked = await this.get().locator(`.nc-acl-${table}-${role}-chkbox`).isChecked();
|
||
|
expect(isChecked).toBe(expectedValue);
|
||
|
}
|
||
|
|
||
2 years ago
|
async save() {
|
||
2 years ago
|
await this.waitForResponse({
|
||
1 year ago
|
uiAction: async () => await this.get().locator(`button:has-text("Save")`).click(),
|
||
2 years ago
|
httpMethodsToMatch: ['POST'],
|
||
|
requestUrlPathToMatch: '/visibility-rules',
|
||
|
});
|
||
|
await this.verifyToast({ message: 'Updated UI ACL for tables successfully' });
|
||
2 years ago
|
}
|
||
|
}
|