Use url contains on E2E
This commit is contained in:
@@ -20,12 +20,11 @@ test("Logged in user can create event", async t => {
|
|||||||
const loginForm = Selector("form.admin-login-form");
|
const loginForm = Selector("form.admin-login-form");
|
||||||
await t.expect(loginForm.exists).ok();
|
await t.expect(loginForm.exists).ok();
|
||||||
await doLogin(t);
|
await doLogin(t);
|
||||||
await t.expect(await getPageUrl() === "/admin/events").ok();
|
await t.expect(await getPageUrl()).contains("/admin/events");
|
||||||
|
|
||||||
const newButton = Selector("[data-e2e=\"create-event\"]");
|
const newButton = Selector("[data-e2e=\"create-event\"]");
|
||||||
await t.click(newButton);
|
await t.click(newButton);
|
||||||
// await t.expect(await getPageUrl() === "/admin/events/create").ok();
|
await t.expect(await getPageUrl()).contains("/admin/events/create");
|
||||||
console.log(await getPageUrl());
|
|
||||||
|
|
||||||
const titleFi = Selector("#rjsf_title_fi");
|
const titleFi = Selector("#rjsf_title_fi");
|
||||||
const titleEn = Selector("#rjsf_title_en");
|
const titleEn = Selector("#rjsf_title_en");
|
||||||
|
|||||||
@@ -14,12 +14,11 @@ test("Logged in user can create signup", async t => {
|
|||||||
const loginForm = Selector("form.admin-login-form");
|
const loginForm = Selector("form.admin-login-form");
|
||||||
await t.expect(loginForm.exists).ok();
|
await t.expect(loginForm.exists).ok();
|
||||||
await doLogin(t);
|
await doLogin(t);
|
||||||
await t.expect(await getPageUrl() === "/admin/signups").ok();
|
await t.expect(await getPageUrl()).contains("/admin/signups");
|
||||||
|
|
||||||
const newButton = Selector("[data-e2e=\"create-signup\"]");
|
const newButton = Selector("[data-e2e=\"create-signup\"]");
|
||||||
await t.click(newButton);
|
await t.click(newButton);
|
||||||
// await t.expect(await getPageUrl() === "/admin/signups/create").ok();
|
await t.expect(await getPageUrl()).contains("/admin/signups/create");
|
||||||
console.log(await getPageUrl());
|
|
||||||
|
|
||||||
const titleFi = Selector("#rjsf_title_fi");
|
const titleFi = Selector("#rjsf_title_fi");
|
||||||
const titleEn = Selector("#rjsf_title_en");
|
const titleEn = Selector("#rjsf_title_en");
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ test("User can log out and is redirected to login", async t => {
|
|||||||
*/
|
*/
|
||||||
await t.click(Selector("#login-submit"));
|
await t.click(Selector("#login-submit"));
|
||||||
|
|
||||||
const logout = Selector(`[data-e2e="admin-sidebar-logout"]`);
|
const logout = Selector("[data-e2e=\"admin-sidebar-logout\"]");
|
||||||
await t.click(logout);
|
await t.click(logout);
|
||||||
|
|
||||||
const loginForm = Selector("form.admin-login-form");
|
const loginForm = Selector("form.admin-login-form");
|
||||||
|
|||||||
@@ -21,15 +21,13 @@ test("User signups to event from front page", async t => {
|
|||||||
await t
|
await t
|
||||||
.click(CardSelector.child("a"));
|
.click(CardSelector.child("a"));
|
||||||
|
|
||||||
let url = await getPageUrl();
|
await t.expect(await getPageUrl()).match(/\/events\/\d{1,4}/, "URL isn't /events/<id>");
|
||||||
await t.expect(url).match(/\/events\/\d{1,4}/, "URL isn't /events/<id>");
|
|
||||||
|
|
||||||
const SignupButton = Selector("button");
|
const SignupButton = Selector("button");
|
||||||
await t
|
await t
|
||||||
.click(SignupButton);
|
.click(SignupButton);
|
||||||
|
|
||||||
url = await getPageUrl();
|
await t.expect(await getPageUrl()).match(/\/signup\/\d{1,4}/, "URL isn't /signup/<id>");
|
||||||
await t.expect(url).match(/\/signup\/\d{1,4}/, "URL isn't /signup/<id>");
|
|
||||||
|
|
||||||
const nameField = Selector("input").nth(0);
|
const nameField = Selector("input").nth(0);
|
||||||
const emailField = Selector("input").nth(1);
|
const emailField = Selector("input").nth(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user