Files
web2.0-frontend/tests/testcafe/index.test.ts
T
2021-01-12 22:51:07 +02:00

22 lines
617 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");
});