This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/tests/wdio/test/specs/bad-logins.ts

22 lines
820 B
TypeScript

import LoginPage from "../pageobjects/login.page.js";
import { BAD_PASSWORD, BAD_USERNAME, GOOD_USERNAME } from "../utils/constants.js";
import { expect } from "@wdio/globals";
describe("Log into authentik", () => {
it("should fail on a bad username", async () => {
await LoginPage.open();
await LoginPage.username(BAD_USERNAME);
const failure = await LoginPage.authFailure;
expect(failure).toHaveText("Failed to authenticate.");
});
it("should fail on a bad password", async () => {
await LoginPage.open();
await LoginPage.username(GOOD_USERNAME);
await LoginPage.pause();
await LoginPage.password(BAD_PASSWORD);
const failure = await LoginPage.authFailure;
expect(failure).toHaveText("Failed to authenticate.");
});
});