mirror of https://github.com/nocodb/nocodb
Raju Udava
2 years ago
4 changed files with 69 additions and 2 deletions
@ -0,0 +1,35 @@ |
|||||||
|
import BasePage from '../Base'; |
||||||
|
import { AccountPage } from './index'; |
||||||
|
|
||||||
|
export class AccountLicensePage extends BasePage { |
||||||
|
private accountPage: AccountPage; |
||||||
|
|
||||||
|
constructor(accountPage: AccountPage) { |
||||||
|
super(accountPage.rootPage); |
||||||
|
this.accountPage = accountPage; |
||||||
|
} |
||||||
|
|
||||||
|
async goto() { |
||||||
|
await this.rootPage.goto('/#/account/license', { waitUntil: 'networkidle' }); |
||||||
|
} |
||||||
|
|
||||||
|
async waitUntilContentLoads() { |
||||||
|
return this.rootPage.waitForResponse(resp => resp.url().includes('api/v1/license') && resp.status() === 200); |
||||||
|
} |
||||||
|
|
||||||
|
// License TextBox
|
||||||
|
get() { |
||||||
|
return this.accountPage.get().locator(`textarea[placeholder="License key"]`); |
||||||
|
} |
||||||
|
|
||||||
|
// Save button
|
||||||
|
getSaveButton() { |
||||||
|
return this.accountPage.get().locator(`button.ant-btn-primary:has-text("Save license key")`); |
||||||
|
} |
||||||
|
|
||||||
|
async saveLicenseKey(licenseKey: string) { |
||||||
|
await this.get().fill(licenseKey); |
||||||
|
await this.getSaveButton().click(); |
||||||
|
await this.verifyToast({ message: 'License key updated' }); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
import { test } from '@playwright/test'; |
||||||
|
import { AccountPage } from '../pages/Account'; |
||||||
|
import setup from '../setup'; |
||||||
|
import { AccountLicensePage } from '../pages/Account/License'; |
||||||
|
import { DashboardPage } from '../pages/Dashboard'; |
||||||
|
|
||||||
|
test.describe('Enterprise License', () => { |
||||||
|
// @ts-ignore
|
||||||
|
let dashboard: DashboardPage; |
||||||
|
// @ts-ignore
|
||||||
|
let accountLicensePage: AccountLicensePage, accountPage: AccountPage, context: any; |
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => { |
||||||
|
context = await setup({ page }); |
||||||
|
accountPage = new AccountPage(page); |
||||||
|
accountLicensePage = new AccountLicensePage(accountPage); |
||||||
|
dashboard = new DashboardPage(page, context.project); |
||||||
|
}); |
||||||
|
|
||||||
|
test('Update license key & verify if enterprise features enabled', async () => { |
||||||
|
test.slow(); |
||||||
|
await accountLicensePage.goto(); |
||||||
|
await accountLicensePage.saveLicenseKey('1234567890'); |
||||||
|
|
||||||
|
await dashboard.goto(); |
||||||
|
// presence of snowflake icon indicates enterprise features are enabled
|
||||||
|
await dashboard.treeView.quickImport({ title: 'Snowflake' }); |
||||||
|
}); |
||||||
|
}); |
Loading…
Reference in new issue