Signup creation and submit tests

This commit is contained in:
Aarni Halinen
2021-01-14 20:44:37 +02:00
parent 957aeb75f2
commit 88f445ef9b
8 changed files with 142 additions and 39 deletions
+10 -10
View File
@@ -2,13 +2,12 @@ import { Selector } from "testcafe";
import { getSiteRoot, getPageUrl } from "../utils";
import { doLogin } from "./common/login";
fixture`Admin can create events`.page(`${getSiteRoot()}/admin/events`);
fixture`Admin events`.page(`${getSiteRoot()}/admin/events`);
test("Logged in user can create event", async t => {
const loginForm = Selector("form.admin-login-form");
await t.expect(loginForm.exists).ok();
await doLogin(t);
await t.expect(await getPageUrl() === "/admin/events").ok();
const newButton = Selector("[data-e2e=\"create-event\"]");
@@ -50,14 +49,15 @@ test("Logged in user can create event", async t => {
// .click(signupOption, { modifiers: { ctrl: true } });
await t.typeText(titleFi, "title_fi");
await t.typeText(descFi, "desc_fi");
await t.typeText(contentFi, "content_fi");
await t.typeText(locationFi, "location_fi");
await t.typeText(titleEn, "title_en");
await t.typeText(descEn, "desc_en");
await t.typeText(contentEn, "content_en");
await t.typeText(locationEn, "location_en");
await t
.typeText(titleFi, "title_fi")
.typeText(descFi, "desc_fi")
.typeText(contentFi, "content_fi")
.typeText(locationFi, "location_fi")
.typeText(titleEn, "title_en")
.typeText(descEn, "desc_en")
.typeText(contentEn, "content_en")
.typeText(locationEn, "location_en");
const submit = Selector("button[type=\"submit\"]");