Skip to content

test(site): add e2e tests for user auth #12971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
mtojek committed Apr 16, 2024
commit ad4f37030fb5e8be65f1bbee27ba4805619c58c4
18 changes: 13 additions & 5 deletions site/e2e/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,22 @@ export async function verifyConfigFlag(
`div.options-table .option-${flag} .${type}`,
);

if (type === "option-array") {
if (typeof value === "object" && !Array.isArray(value)) {
Object.entries(value)
.sort((a, b) => a[0].localeCompare(b[0]))
.map(async ([item]) => {
await expect(configOption.locator(`.option-array-item-${item}.option-enabled`)).toHaveText(item);
});
.map(async ([item]) =>
expect(
configOption.locator(`.option-array-item-${item}.option-enabled`, {
hasText: item,
}),
),
);
return;
} else if (Array.isArray(value)) {
for (const item of value) {
expect(configOption.locator("li", { hasText: item }));
}
return;
}

await expect(configOption).toHaveText(String(value));
}
8 changes: 4 additions & 4 deletions site/e2e/tests/deployment/userAuth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ test("login with OIDC", async ({ page }) => {
"oidc-allow-signups",
"oidc-auth-url-params",
"oidc-client-id",
//"oidc-email-domain",
"oidc-email-domain",
"oidc-email-field",
//"oidc-group-mapping",
"oidc-group-mapping",
"oidc-ignore-email-verified",
"oidc-ignore-userinfo",
"oidc-issuer-url",
"oidc-group-regex-filter",
//"oidc-scopes",
//"oidc-user-role-mapping",
"oidc-scopes",
"oidc-user-role-mapping",
"oidc-username-field",
"oidc-sign-in-text",
"oidc-icon-url",
Expand Down