Revert "Try test order manipulation with folder structure"
This reverts commit 83f3df6ccc.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { Selector } from "testcafe";
|
||||
import { getSiteRoot, getPageUrl } from "./utils";
|
||||
|
||||
fixture`Event signup`.page(getSiteRoot());
|
||||
|
||||
test("User signups to event from front page", async t => {
|
||||
const CardSelector = Selector("[data-e2e=\"event-card\"]").withText("title_fi").nth(0);
|
||||
|
||||
await t
|
||||
.click(CardSelector.child("a"));
|
||||
|
||||
let url = await getPageUrl();
|
||||
await t.expect(url).match(/\/events\/\d{1,4}/, "URL isn't /events/<id>");
|
||||
|
||||
const SignupButton = Selector("button");
|
||||
await t
|
||||
.click(SignupButton);
|
||||
|
||||
url = await getPageUrl();
|
||||
await t.expect(url).match(/\/signup\/\d{1,4}/, "URL isn't /signup/<id>");
|
||||
|
||||
const nameField = Selector("input").nth(0);
|
||||
const emailField = Selector("input").nth(1);
|
||||
const typeField = Selector("fieldset").child(-1).child("div").child("div").child("label").nth(-1);
|
||||
|
||||
await t
|
||||
.typeText(nameField, "Testi Testeri")
|
||||
.typeText(emailField, "e2e@sahkoinsinoorikilta.fi")
|
||||
.click(typeField);
|
||||
|
||||
await t.click(Selector("button").nth(-1));
|
||||
|
||||
const statusMessage = Selector(".sign-up-statusmessage");
|
||||
await t
|
||||
.hover(statusMessage)
|
||||
.expect(
|
||||
statusMessage.innerText
|
||||
).eql("Sign-up submitted successfully");
|
||||
});
|
||||
Reference in New Issue
Block a user