From a2680f8626752d034ac7f7972c6732de7cdfe98e Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 15 Jan 2019 12:23:39 +0200 Subject: [PATCH] Add admin page e2e test --- tests/testcafe/admin.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/testcafe/admin.test.ts diff --git a/tests/testcafe/admin.test.ts b/tests/testcafe/admin.test.ts new file mode 100644 index 0000000..1a904ab --- /dev/null +++ b/tests/testcafe/admin.test.ts @@ -0,0 +1,17 @@ +/** + * TestCafé test fixtures. + * This file is used by TestCafé to run end-to-end tests with chrome against the site. + * Tests are grouped into fixtures and fixtures into files. + */ +import { Selector } from "testcafe"; + +fixture`Admin page renders and functions correctly`.page("http://localhost:3000/admin"); + +test("Header contains text \"Admin panel\"", async t => { + /** + * Test if the header contains the text. + */ + const header = Selector("h1"); + await t.expect(header.textContent) + .contains("Admin panel"); +});