mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-23 21:28:47 +00:00
chore: init load tests (#7635)
* init load tests * add machine pat * setup app * add introspect * use xk6-modules repo * logging * add teardown * add manipulate user * add manipulate user * remove logs * convert tests to ts * add readme * zitadel * review comments
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { loginByUsernamePassword } from '../login_ui';
|
||||
import { userinfo } from '../oidc';
|
||||
import { Config } from '../config';
|
||||
import { User, createHuman } from '../user';
|
||||
import { createOrg, removeOrg } from '../org';
|
||||
|
||||
export async function setup() {
|
||||
const adminTokens = loginByUsernamePassword(Config.admin as User);
|
||||
console.info('setup: admin signed in');
|
||||
|
||||
const org = await createOrg(adminTokens.accessToken!);
|
||||
console.info(`setup: org (${org.organizationId}) created`);
|
||||
|
||||
const user = await createHuman('gigi', org, adminTokens.accessToken!);
|
||||
console.info(`setup: user (${user.userId}) created`);
|
||||
|
||||
return { org, tokens: loginByUsernamePassword({ loginName: user.loginNames[0], password: 'Password1!' } as User) };
|
||||
}
|
||||
|
||||
export default function (data: any) {
|
||||
userinfo(data.tokens.accessToken);
|
||||
}
|
||||
|
||||
export function teardown(data: any) {
|
||||
removeOrg(data.org, data.tokens.accessToken);
|
||||
console.info('teardown: org removed');
|
||||
}
|
||||
Reference in New Issue
Block a user