Files
web2.0-frontend/tests/testcafe/index.test.ts
T
2023-10-03 20:59:42 +03:00

22 lines
624 B
TypeScript

import { Selector } from "testcafe";
import { getSiteRoot } from "../utils";
fixture`Front page renders and functions correctly`.page(`${getSiteRoot()}`);
test("Favicon exists", async (t) => {
/**
* Test if there is a favicon element on the page
*/
const elem = Selector("link[rel=\"icon\"]");
await t.expect(elem.exists).ok();
});
test("Header contains text \"Aalto-yliopiston Sähköinsinöörikilta\"", async (t) => {
/**
* Test if the header contains the text.
*/
const header = Selector("h1");
await t.expect(header.textContent)
.contains("Aalto-yliopiston Sähköinsinöörikilta");
});