Browse Source

fix: pw for api tokens

pull/9543/head
Raju Udava 2 months ago
parent
commit
4fd54382a4
  1. 14
      tests/playwright/tests/db/usersAccounts/accountTokenManagement.spec.ts

14
tests/playwright/tests/db/usersAccounts/accountTokenManagement.spec.ts

@ -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();

Loading…
Cancel
Save