Fix E2E tests
This commit is contained in:
@@ -38,45 +38,58 @@ test("Logged in user can create signup", async (t) => {
|
||||
|
||||
await t.click(newQuestionButton);
|
||||
let question = lastQuestion();
|
||||
let questionName = question.child("input");
|
||||
let questionNameFi = question.child("input").nth(0);
|
||||
let questionNameEn = question.child("input").nth(1);
|
||||
let questionTypeSelect = question.child("select");
|
||||
let requiredBox = question.child("label");
|
||||
|
||||
await t
|
||||
.selectText(questionName)
|
||||
.selectText(questionNameFi)
|
||||
.pressKey("delete")
|
||||
.typeText(questionName, "Nimi")
|
||||
.typeText(questionNameFi, "Nimi")
|
||||
.selectText(questionNameEn)
|
||||
.pressKey("delete")
|
||||
.typeText(questionNameEn, "Name")
|
||||
.click(questionTypeSelect)
|
||||
.click(questionTypeSelect.find("option").withExactText("name"))
|
||||
.click(requiredBox);
|
||||
|
||||
await t.click(newQuestionButton);
|
||||
question = lastQuestion();
|
||||
questionName = question.child("input");
|
||||
questionNameFi = question.child("input").nth(0);
|
||||
questionNameEn = question.child("input").nth(1);
|
||||
questionTypeSelect = question.child("select");
|
||||
requiredBox = question.child("label");
|
||||
|
||||
await t
|
||||
.selectText(questionName)
|
||||
.selectText(questionNameFi)
|
||||
.pressKey("delete")
|
||||
.typeText(questionName, "S-Posti")
|
||||
.typeText(questionNameFi, "S-Posti")
|
||||
.selectText(questionNameEn)
|
||||
.pressKey("delete")
|
||||
.typeText(questionNameEn, "Email")
|
||||
.click(questionTypeSelect)
|
||||
.click(questionTypeSelect.find("option").withExactText("email"))
|
||||
.click(requiredBox);
|
||||
|
||||
await t.click(newQuestionButton);
|
||||
question = lastQuestion();
|
||||
questionName = question.child("input");
|
||||
questionNameFi = question.child("input");
|
||||
questionTypeSelect = question.child("select");
|
||||
const radioOptions = question.child("input").nth(-1);
|
||||
const radioOptionsFi = question.child("input").nth(-2);
|
||||
const radioOptionsEn = question.child("input").nth(-1);
|
||||
|
||||
await t
|
||||
.selectText(questionName)
|
||||
.selectText(questionNameFi)
|
||||
.pressKey("delete")
|
||||
.typeText(questionName, "Olen")
|
||||
.typeText(questionNameFi, "Olen")
|
||||
.selectText(questionNameEn)
|
||||
.pressKey("delete")
|
||||
.typeText(questionNameEn, "I am")
|
||||
.click(questionTypeSelect)
|
||||
.click(questionTypeSelect.find("option").withExactText("radiobutton"))
|
||||
.typeText(radioOptions, "Nuori,Vanha,Testaaja");
|
||||
.typeText(radioOptionsFi, "Nuori;Vanha;Testaaja")
|
||||
.typeText(radioOptionsEn, "Yung;Old;Tester");
|
||||
|
||||
const submit = Selector("button[type=\"submit\"]");
|
||||
|
||||
|
||||
@@ -111,23 +111,23 @@ export const generateTestForm = async (jwt: string) => (
|
||||
end_time: tomorrow,
|
||||
email_content: "E2E Test",
|
||||
questions: [{
|
||||
id: "XS_Ox5Rry", name: "Nimi", type: "name", options: [], required: true,
|
||||
id: "Kv0IRYUWE", type: "name", options: { enum: [], enumNames_en: [], enumNames_fi: [] }, required: true, title_en: "Name", title_fi: "Nimi",
|
||||
}, {
|
||||
id: "Ve02XSEEx", name: "S-Posti", type: "email", options: [], required: true,
|
||||
id: "_9o78DbdZ", type: "email", options: { enum: [], enumNames_en: [], enumNames_fi: [] }, required: true, title_en: "Email", title_fi: "S-Posti",
|
||||
}, {
|
||||
id: "luMqnz5y9", name: "Olen", type: "radiobutton", options: ["Nuori", "Vanha", "Testaaja"],
|
||||
id: "-Zk6tCy7U", type: "radiobutton", options: { enum: ["Nuori", "Vanha", "Testaaja"], enumNames_en: ["Yung", "Old", "Tester"], enumNames_fi: ["Nuori", "Vanha", "Testaaja"] }, title_en: "I am", title_fi: "Olen",
|
||||
}],
|
||||
id: 14,
|
||||
isOpen: true,
|
||||
schema: {
|
||||
type: "object",
|
||||
required: ["XS_Ox5Rry", "Ve02XSEEx"],
|
||||
required: ["Kv0IRYUWE", "_9o78DbdZ"],
|
||||
properties: {
|
||||
XS_Ox5Rry: { type: "string", title: "Nimi" },
|
||||
Ve02XSEEx: {
|
||||
Kv0IRYUWE: { type: "string", title: "Nimi" },
|
||||
_9o78DbdZ: {
|
||||
type: ["string"], title: "S-Posti", format: "email", pattern: "^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$", default: null,
|
||||
},
|
||||
luMqnz5y9: {
|
||||
"-Zk6tCy7U": {
|
||||
type: "string", title: "Olen", pattern: "^Nuori$|^Vanha$|^Testaaja$", enum: ["Nuori", "Vanha", "Testaaja"],
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user