Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed Sep 14, 2024
1 parent cc71739 commit a935963
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libs/backend-api7/e2e/support/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,21 @@ const setupAPI7 = async () => {
});
};

const modifyPassword = async () => {
await httpClient.post(`/api/login`, {
username: 'admin',
password: 'admin',
});
await httpClient.post(`/api/password`, { new_password: 'Admin12345!' });
};

const activateAPI7 = async () => {
await httpClient.put(`/api/license`, {
data: process.env.BACKEND_API7_LICENSE,
});
};

const generateToken = async () => {
await httpClient.post(`/api/login`, {
username: 'admin',
password: 'admin',
});
await httpClient.post(`/api/password`, { new_password: 'Admin12345!' });
const resp = await httpClient.post<{ value: { token: string } }>(
`/api/tokens`,
{
Expand All @@ -86,6 +89,7 @@ const generateToken = async () => {

export default async () => {
if (process.env['SKIP_API7_SETUP'] !== 'true') await setupAPI7();
await modifyPassword();
await activateAPI7();
await generateToken();

Expand Down

0 comments on commit a935963

Please sign in to comment.