-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
458 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { | ||
getAllProviders, | ||
getLoginInfo, | ||
getOrganisationen, | ||
} from "../util/api.ts"; | ||
import { getFrontendUrl } from "../util/config.ts"; | ||
import { loadPage } from "../util/page.ts"; | ||
import { PageObject } from "./index.ts"; | ||
|
||
class CreateRollePage implements PageObject { | ||
name = "UserList"; | ||
url = `${getFrontendUrl()}admin/rollen/new`; | ||
|
||
navigate(): void { | ||
loadPage(this.url, this.name); | ||
this.fetchData(); | ||
} | ||
|
||
// fetch on initial load | ||
fetchData() { | ||
getLoginInfo(); | ||
const organisationen = getOrganisationen([ | ||
"systemrechte=ROLLEN_VERWALTEN", | ||
"excludeTyp=KLASSE", | ||
]); | ||
const providers = getAllProviders(); | ||
return { | ||
organisationen, | ||
providers, | ||
}; | ||
} | ||
} | ||
|
||
export const createRollePage = new CreateRollePage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { | ||
deleteRolleById, | ||
getAllProviders, | ||
getLoginInfo, | ||
getOrganisationById, | ||
getRolleById, | ||
} from "../util/api.ts"; | ||
import { getFrontendUrl } from "../util/config.ts"; | ||
import { loadPage } from "../util/page.ts"; | ||
import { PageObject } from "./index.ts"; | ||
|
||
export class EditRollePage implements PageObject { | ||
name = "UserList"; | ||
url = `${getFrontendUrl()}admin/rollen/new`; | ||
|
||
constructor(public rolleId: string) {} | ||
|
||
navigate(): void { | ||
loadPage(this.url, this.name); | ||
this.fetchData(); | ||
} | ||
|
||
// fetch on initial load | ||
fetchData() { | ||
getLoginInfo(); | ||
const rolle = getRolleById(this.rolleId); | ||
const organisation = getOrganisationById( | ||
rolle.administeredBySchulstrukturknoten, | ||
); | ||
|
||
const providers = getAllProviders(); | ||
return { | ||
rolle, | ||
organisation, | ||
providers, | ||
}; | ||
} | ||
|
||
deleteRolle() { | ||
deleteRolleById(this.rolleId); | ||
// TODO: go to rolle list | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { getFrontendUrl } from "../util/config.ts"; | ||
import { loadPage } from "../util/page.ts"; | ||
import { PageObject } from "./index.ts"; | ||
|
||
export class ProfilePage implements PageObject { | ||
name = "UserList"; | ||
url = `${getFrontendUrl()}admin/personen`; | ||
|
||
constructor(public personId: string) {} | ||
|
||
navigate(): void { | ||
loadPage(this.url, this.name); | ||
this.fetchData(); | ||
} | ||
|
||
fetchData() { | ||
// TODO: implement | ||
//stub | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { group } from "k6"; | ||
import { OrganisationResponse } from "../api-client/generated/index.ts"; | ||
import { getDefaultOptions } from "../util/config.ts"; | ||
import { login } from "../util/page"; | ||
import { wrapTestFunction } from "../util/usecase-wrapper.ts"; | ||
import { UserMix } from "../util/users.ts"; | ||
|
||
type TestData = { | ||
testOrg: OrganisationResponse; | ||
}; | ||
|
||
const loginData = new UserMix({ SYSADMIN: 1 }).getLogin(); | ||
export const options = { | ||
...getDefaultOptions(), | ||
}; | ||
|
||
export function setup() {} | ||
|
||
export function teardown(data: TestData) {} | ||
|
||
export default wrapTestFunction(main); | ||
|
||
function main(data: TestData) { | ||
group("setup", () => { | ||
login(loginData); | ||
// TODO: go to details page | ||
}); | ||
|
||
group("add zuordnung", () => { | ||
// TODO: | ||
// https://localhost:8099/api/personenkontext-workflow/step?limit=25 | ||
// https://localhost:8099/api/personenkontext-workflow/step?limit=25 | ||
// https://localhost:8099/api/personenkontext-workflow/step?organisationId=99a2e34e-c0b7-4afe-9120-a7cbc3dac6b9&limit=25 | ||
// https://localhost:8099/api/organisationen/99a2e34e-c0b7-4afe-9120-a7cbc3dac6b9/administriert | ||
// https://localhost:8099/api/organisationen?limit=30&typ=SCHULE&systemrechte=SCHULEN_VERWALTEN&organisationIds=99a2e34e-c0b7-4afe-9120-a7cbc3dac6b9 | ||
// https://localhost:8099/api/personenkontext-workflow/step?organisationId=99a2e34e-c0b7-4afe-9120-a7cbc3dac6b9&rolleId=c590a195-8416-44ad-9264-f6e6bd9f6744&limit=25 | ||
// https://localhost:8099/api/personenkontext-workflow/c4852e54-cd0b-45c2-96cf-2028153db08b | ||
// {"lastModified":"2024-11-07T09:58:41.888Z","count":2,"personenkontexte":[{"personId":"c4852e54-cd0b-45c2-96cf-2028153db08b","organisationId":"d58ec217-42c8-4824-abae-13093eb29f40","rolleId":"c590a195-8416-44ad-9264-f6e6bd9f6744","befristung":null},{"personId":"c4852e54-cd0b-45c2-96cf-2028153db08b","organisationId":"99a2e34e-c0b7-4afe-9120-a7cbc3dac6b9","rolleId":"c590a195-8416-44ad-9264-f6e6bd9f6744"},{"personId":"c4852e54-cd0b-45c2-96cf-2028153db08b","organisationId":"9122528c-f67e-49b7-89e8-2669be7d39f9","rolleId":"c590a195-8416-44ad-9264-f6e6bd9f6744"},{"personId":"c4852e54-cd0b-45c2-96cf-2028153db08b","organisationId":"74567a50-d6d5-4a35-995f-72020b843c61","rolleId":"c590a195-8416-44ad-9264-f6e6bd9f6744","befristung":null}]} | ||
// TODO: reload details page | ||
}); | ||
|
||
group("delete zuordnung", () => { | ||
// TODO: | ||
// https://localhost:8099/api/personenkontext-workflow/step?limit=25 | ||
// https://localhost:8099/api/personenkontext-workflow/step?organisationId=d58ec217-42c8-4824-abae-13093eb29f40&rolleId=c590a195-8416-44ad-9264-f6e6bd9f6744&limit=25 | ||
// https://localhost:8099/api/personenkontext-workflow/c4852e54-cd0b-45c2-96cf-2028153db08b | ||
// TODO: reload details page | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { check, group } from "k6"; | ||
import { | ||
CreateRolleBodyParams, | ||
OrganisationResponse, | ||
RollenArt, | ||
TokenInitBodyParams, | ||
} from "../api-client/generated/index.ts"; | ||
import { getDefaultOptions } from "../util/config.ts"; | ||
import { goToUserList } from "../util/page.ts"; | ||
import { wrapTestFunction } from "../util/usecase-wrapper.ts"; | ||
import { getDefaultUserMix, UserMix } from "../util/users.ts"; | ||
import { createRollePage } from "../pages/create-rolle.ts"; | ||
import { getOrganisationById, getOrganisationen, postRolle } from "../util/api"; | ||
import { EditRollePage } from "../pages/edit-rolle"; | ||
|
||
type TestData = { | ||
testOrg: OrganisationResponse; | ||
}; | ||
|
||
export const options = { | ||
...getDefaultOptions(), | ||
}; | ||
const users = new UserMix({ SYSADMIN: 1000 }); | ||
|
||
export function setup() { | ||
// TODO: get testOrg | ||
// TODO: create test users | ||
} | ||
|
||
export function teardown(data: TestData) { | ||
// TODO: delete test users in testOrg | ||
} | ||
|
||
export default wrapTestFunction(main); | ||
|
||
function main(data: TestData) { | ||
const personId = group("setup", () => { | ||
goToUserList(users.getLogin()); | ||
// TODO: pick user | ||
// TODO: go to details | ||
}); | ||
const rolleId = group("create token", () => { | ||
const bodyParams: TokenInitBodyParams = { | ||
personId, | ||
}; | ||
const rolleResponse = postRolle(bodyParams); | ||
check(rolleResponse, { | ||
"rolle created": (r) => r.id != undefined, | ||
}); | ||
getOrganisationById(bodyParams.administeredBySchulstrukturknoten); | ||
return rolleResponse.id; | ||
}); | ||
group("delete rolle", () => { | ||
const po = new EditRollePage(rolleId); | ||
po.fetchData(); | ||
po.deleteRolle(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { group } from "k6"; | ||
import { getDefaultOptions } from "../util/config.ts"; | ||
import { goToUserList } from "../util/page.ts"; | ||
import { wrapTestFunction } from "../util/usecase-wrapper.ts"; | ||
import { getDefaultUserMix } from "../util/users.ts"; | ||
import { OrganisationResponse } from "../api-client/generated/index.ts"; | ||
|
||
type TestData = { | ||
testOrg: OrganisationResponse; | ||
}; | ||
|
||
export const options = { | ||
...getDefaultOptions(), | ||
}; | ||
const users = getDefaultUserMix(); | ||
|
||
export function setup() { | ||
// TODO: get testOrg | ||
} | ||
|
||
export function teardown(data: TestData) { | ||
// TODO: delete klassen in testOrg | ||
} | ||
|
||
export default wrapTestFunction(main); | ||
|
||
function main(data: TestData) { | ||
group("setup", () => { | ||
goToUserList(users.getLogin()); | ||
}); | ||
const klasseId = group("create klasse", () => { | ||
// TODO: create klasse in testOrg | ||
}); | ||
group("delete klasse", () => { | ||
// TODO: delete klasse in testOrg | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { check, group } from "k6"; | ||
import { | ||
CreateRolleBodyParams, | ||
OrganisationResponse, | ||
RollenArt, | ||
} from "../api-client/generated/index.ts"; | ||
import { getDefaultOptions } from "../util/config.ts"; | ||
import { goToUserList } from "../util/page.ts"; | ||
import { wrapTestFunction } from "../util/usecase-wrapper.ts"; | ||
import { getDefaultUserMix } from "../util/users.ts"; | ||
import { createRollePage } from "../pages/create-rolle.ts"; | ||
import { getOrganisationById, getOrganisationen, postRolle } from "../util/api"; | ||
import { EditRollePage } from "../pages/edit-rolle"; | ||
|
||
type TestData = { | ||
testOrg: OrganisationResponse; | ||
}; | ||
|
||
export const options = { | ||
...getDefaultOptions(), | ||
}; | ||
const users = getDefaultUserMix(); | ||
|
||
export function setup() { | ||
// TODO: get testOrg | ||
} | ||
|
||
export function teardown(data: TestData) { | ||
// TODO: delete rollen in testOrg | ||
} | ||
|
||
export default wrapTestFunction(main); | ||
|
||
function main(data: TestData) { | ||
group("setup", () => { | ||
goToUserList(users.getLogin()); | ||
}); | ||
const rolleId = group("create rolle", () => { | ||
// TODO: create rolle in testOrg | ||
const data = createRollePage.fetchData(); | ||
const bodyParams: CreateRolleBodyParams = { | ||
name: getRandomString(8), | ||
administeredBySchulstrukturknoten: "", | ||
rollenart: RollenArt.Lern, | ||
merkmale: new Set(), | ||
systemrechte: new Set(), | ||
}; | ||
const rolleResponse = postRolle(bodyParams); | ||
check(rolleResponse, { | ||
"rolle created": (r) => r.id != undefined, | ||
}); | ||
getOrganisationById(bodyParams.administeredBySchulstrukturknoten); | ||
return rolleResponse.id; | ||
}); | ||
group("delete rolle", () => { | ||
const po = new EditRollePage(rolleId); | ||
po.fetchData(); | ||
po.deleteRolle(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { group } from "k6"; | ||
import { logout } from "../pages/index"; | ||
import { getDefaultOptions } from "../util/config.ts"; | ||
import { login } from "../util/page"; | ||
import { wrapTestFunction } from "../util/usecase-wrapper.ts"; | ||
import { getDefaultUserMix } from "../util/users.ts"; | ||
|
||
export const options = { | ||
...getDefaultOptions(), | ||
}; | ||
|
||
export default wrapTestFunction(main); | ||
|
||
function main(users = getDefaultUserMix()) { | ||
group("setup", () => { | ||
login(users.getLogin()); | ||
}); | ||
group("logout", () => { | ||
logout(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { check, fail, group } from "k6"; | ||
import { ProfilePage } from "../pages/profile"; | ||
import { getDefaultOptions } from "../util/config.ts"; | ||
import { login } from "../util/page"; | ||
import { wrapTestFunction } from "../util/usecase-wrapper.ts"; | ||
import { getDefaultUserMix } from "../util/users.ts"; | ||
|
||
export const options = { | ||
...getDefaultOptions(), | ||
}; | ||
|
||
export default wrapTestFunction(main); | ||
|
||
function main(users = getDefaultUserMix()) { | ||
const personId = group("setup", () => { | ||
const { loginInfo } = login(users.getLogin()); | ||
if ( | ||
!check(loginInfo, { | ||
"personId found": (info) => info.personId != undefined, | ||
}) | ||
) | ||
fail("no personId found"); | ||
return loginInfo.personId!; | ||
}); | ||
group("go to profile", () => { | ||
const profilePage = new ProfilePage(personId); | ||
profilePage.navigate(); | ||
}); | ||
} |
Oops, something went wrong.