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.
34 lines
1.1 KiB
34 lines
1.1 KiB
import BasePage from '../../Base'; |
|
import { ProjectViewPage } from './index'; |
|
import { expect, Locator } from '@playwright/test'; |
|
|
|
export class TablesViewPage extends BasePage { |
|
readonly projectView: ProjectViewPage; |
|
|
|
readonly btn_addNewTable: Locator; |
|
readonly btn_importData: Locator; |
|
|
|
constructor(projectView: ProjectViewPage) { |
|
super(projectView.rootPage); |
|
this.projectView = projectView; |
|
|
|
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') { |
|
expect(await this.btn_addNewTable.isVisible()).toBeTruthy(); |
|
expect(await this.btn_importData.isVisible()).toBeTruthy(); |
|
} else { |
|
expect(await this.btn_addNewTable.isVisible()).toBeFalsy(); |
|
expect(await this.btn_importData.isVisible()).toBeFalsy(); |
|
} |
|
} |
|
}
|
|
|