|
|
|
@ -2,6 +2,7 @@ import { test } from '@playwright/test';
|
|
|
|
|
import { AccountPage } from '../../../pages/Account'; |
|
|
|
|
import { AccountTokenPage } from '../../../pages/Account/Token'; |
|
|
|
|
import setup, { unsetup } from '../../../setup'; |
|
|
|
|
import { Api } from 'nocodb-sdk'; |
|
|
|
|
|
|
|
|
|
test.describe('Token Management', () => { |
|
|
|
|
let accountTokenPage: AccountTokenPage; |
|
|
|
@ -20,6 +21,19 @@ test.describe('Token Management', () => {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('Create and Delete token', async () => { |
|
|
|
|
// Init SDK using token
|
|
|
|
|
const api = new Api({ |
|
|
|
|
baseURL: `http://localhost:8080/`, |
|
|
|
|
headers: { |
|
|
|
|
'xc-auth': context.token, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const apiTokens = await api.orgTokens.list(); |
|
|
|
|
if (apiTokens.list.length > 0) { |
|
|
|
|
await api.orgTokens.delete(apiTokens.list[0].id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
test.slow(); |
|
|
|
|
const parallelId = process.env.TEST_PARALLEL_INDEX ?? '0'; |
|
|
|
|
await accountTokenPage.goto(); |
|
|
|
|