Files
nocodb/tests/playwright/pages/Dashboard/ProjectView/TablesViewPage.ts
Pranav C e790abdbaf refactor: rename project and base
- Rename `Project`  => `Base`
- Rename `Base` => `Source`
- Remove `db` from data/meta api endpoints
- Add backward compatibility for old apis
- Migrations for renaming table and columns

Signed-off-by: Pranav C <pranavxc@gmail.com>
2023-10-02 23:52:18 +05:30

35 lines
1.1 KiB
TypeScript

import BasePage from '../../Base';
import { ProjectViewPage } from './index';
import { expect, Locator } from '@playwright/test';
export class TablesViewPage extends BasePage {
readonly baseView: ProjectViewPage;
readonly btn_addNewTable: Locator;
readonly btn_importData: Locator;
constructor(baseView: ProjectViewPage) {
super(baseView.rootPage);
this.baseView = baseView;
this.btn_addNewTable = this.get().locator('[data-testid="proj-view-btn__add-new-table"]');
this.btn_importData = this.get().locator('[data-testid="proj-view-btn__import-data"]');
}
get() {
return this.rootPage.locator('.nc-all-tables-view');
}
async verifyAccess(role: string) {
await this.get().waitFor({ state: 'visible' });
if (role.toLowerCase() === 'creator' || role.toLowerCase() === 'owner') {
await expect(this.btn_addNewTable).toBeVisible();
await expect(this.btn_importData).toBeVisible();
} else {
await expect(this.btn_addNewTable).toHaveCount(0);
await expect(this.btn_importData).toHaveCount(0);
}
}
}