|
|
@ -2,6 +2,7 @@ import { test } from '@playwright/test'; |
|
|
|
import { AccountPage } from '../../../pages/Account'; |
|
|
|
import { AccountPage } from '../../../pages/Account'; |
|
|
|
import { AccountTokenPage } from '../../../pages/Account/Token'; |
|
|
|
import { AccountTokenPage } from '../../../pages/Account/Token'; |
|
|
|
import setup, { unsetup } from '../../../setup'; |
|
|
|
import setup, { unsetup } from '../../../setup'; |
|
|
|
|
|
|
|
import { Api } from 'nocodb-sdk'; |
|
|
|
|
|
|
|
|
|
|
|
test.describe('Token Management', () => { |
|
|
|
test.describe('Token Management', () => { |
|
|
|
let accountTokenPage: AccountTokenPage; |
|
|
|
let accountTokenPage: AccountTokenPage; |
|
|
@ -20,6 +21,19 @@ test.describe('Token Management', () => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
test('Create and Delete token', async () => { |
|
|
|
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(); |
|
|
|
test.slow(); |
|
|
|
const parallelId = process.env.TEST_PARALLEL_INDEX ?? '0'; |
|
|
|
const parallelId = process.env.TEST_PARALLEL_INDEX ?? '0'; |
|
|
|
await accountTokenPage.goto(); |
|
|
|
await accountTokenPage.goto(); |
|
|
|