Skip to content

Commit 193b2f8

Browse files
committed
Fixes
1 parent fbe1039 commit 193b2f8

6 files changed

Lines changed: 13 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,5 @@ backups/
147147
/playwright/.cache/
148148

149149
.claude
150+
151+
load_testing/data/

load_testing/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
### Usage (Docker)
44

55
```shell
6-
./scripts/k6.sh -e BACKEND_BASE_URL=#### -e FRONTEND_BASE_URL=####
6+
./scripts/k6.sh /app/learn.smoke.ts -e BACKEND_BASE_URL=#### -e FRONTEND_BASE_URL=####
77
```
88

99
### Usage (local k6)
1010

1111
- Install [k6](https://grafana.com/docs/k6/latest/set-up/install-k6/)
1212

1313
```shell
14-
k6 run learn.ts -e BACKEND_BASE_URL=#### -e FRONTEND_BASE_URL=####
14+
k6 run learn.smoke.ts -e BACKEND_BASE_URL=#### -e FRONTEND_BASE_URL=####
1515
```

load_testing/auth.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function hasAccessToken(): boolean {
1414
}
1515

1616
function _validate_credentials(credentials) {
17-
if (typeof credentials !== "array") {
17+
if (!Array.isArray(credentials)) {
1818
throw Error("Expected an array of credentials")
1919
}
2020

@@ -38,6 +38,8 @@ export const credentials: AuthCredential[] = new SharedArray(
3838

3939
const parsed = JSON.parse(open(__ENV.USERS_JSON_FILE))
4040

41+
console.log(parsed)
42+
4143
_validate_credentials(parsed)
4244

4345
return parsed

load_testing/data/.keep

Whitespace-only changes.

load_testing/frontend/test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,15 @@ async function loginKeycloak(page: Page, credential: AuthCredential) {
7575
const credentialnameInput = await page.locator("input#username")
7676
await credentialnameInput.type(credential.email)
7777
await page.locator("button#kc-login").click()
78+
await page.waitForNavigation()
79+
console.log(page.url())
7880

7981
const passwordInput = await page.locator("input#password")
8082
await passwordInput.type(credential.password)
8183
await page.locator("button#kc-login").click()
84+
await page.waitForNavigation()
85+
86+
console.log(page.url())
8287
}
8388

8489
async function dashboard(page: Page) {

scripts/k6.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ docker run --rm -ti \
1111
-v $ROOT_DIR/load_testing:/app \
1212
--add-host learn.odl.local:host-gateway \
1313
grafana/k6:master-with-browser \
14-
run /app/learn.ts "$@"
14+
run "$@"

0 commit comments

Comments
 (0)