diff --git a/regression_test/regression_test.go b/regression_test/regression_test.go index 581856ef..504e67e9 100644 --- a/regression_test/regression_test.go +++ b/regression_test/regression_test.go @@ -2,6 +2,7 @@ package regression_test import ( "fmt" + "strconv" "testing" "git.andreafazzi.eu/andrea/oef/orm" @@ -98,15 +99,18 @@ func (t *testSuite) TestSchoolSubscription() { } addSchoolAsSubscriber(&orm.School{ - Name: "Liceo GALILEI", - Code: "Fi12346789", - Address: "via Trieste 1, Milano", - Region: &orm.Region{Name: "Friuli"}, - Email: "foo.bar@school.org", - SchoolContactPersonFirstname: "Mario", - SchoolContactPersonLastname: "BROS", - ContestDirectorFirstname: "Luigi", - ContestDirectorLastname: "BROS", + Name: "Liceo GALILEI", + Code: "Fi12346789", + Address: "via Trieste 1, Milano", + Region: &orm.Region{Name: "Friuli"}, + Email: "foo.bar@school.org", + SchoolContactPersonFirstname: "Mario", + SchoolContactPersonLastname: "BROS", + SchoolContactPersonEmail: "mario.bros@nintendo.com", + SchoolContactPersonTelephoneNumber: "123 456 789", + ContestDirectorFirstname: "Luigi", + ContestDirectorLastname: "BROS", + PreviousParticipantsSelection: 30, }) expected := []string{"Liceo GALILEI", "foo.bar@school.org"} @@ -143,6 +147,8 @@ func (t *testSuite) TestSchoolSubscription() { Firstname: "Mario", Lastname: "ROSSI", FiscalCode: "RSSMR1234567", + Year: 2, + StudyField: "Human Science", Category: &orm.Category{Name: "Junior"}, }) @@ -151,6 +157,8 @@ func (t *testSuite) TestSchoolSubscription() { Firstname: "Serena", Lastname: "BIANCA", FiscalCode: "BNCSR1234567", + Year: 4, + StudyField: "Economics", Category: &orm.Category{Name: "Senior"}, }) @@ -195,6 +203,8 @@ func (t *testSuite) TestSchoolSubscription() { Firstname: "Luigi", Lastname: "VERDI", FiscalCode: "VRDLGSR1234567", + Year: 4, + StudyField: "Economics", Category: &orm.Category{Name: "Senior"}, }) @@ -214,6 +224,8 @@ func (t *testSuite) TestSchoolSubscription() { Firstname: "Luigi", Lastname: "VERDI", FiscalCode: "BNCSR1234567", + Year: 4, + StudyField: "Economics", Category: &orm.Category{Name: "Senior"}, }) @@ -472,7 +484,14 @@ func addSchoolAsSubscriber(school *orm.School) { if err != nil { panic(err) } - + err = findElement("#school_contact_person_email").SendKeys(school.SchoolContactPersonEmail) + if err != nil { + panic(err) + } + err = findElement("#school_contact_person_telephone_number").SendKeys(school.SchoolContactPersonTelephoneNumber) + if err != nil { + panic(err) + } err = findElement("#school_contest_director_firstname").SendKeys(school.ContestDirectorFirstname) if err != nil { panic(err) @@ -481,7 +500,10 @@ func addSchoolAsSubscriber(school *orm.School) { if err != nil { panic(err) } - + err = findElement("#school_previous_participants_selection").SendKeys(strconv.Itoa(int(school.PreviousParticipantsSelection))) + if err != nil { + panic(err) + } err = findElement("button.btn.btn-primary").Click() if err != nil { panic(err) @@ -514,6 +536,16 @@ func populateParticipantForm(participant *orm.Participant) { panic(err) } + err = findElement("#participant_year").SendKeys(strconv.Itoa(participant.Year)) + if err != nil { + panic(err) + } + + err = findElement("#participant_study_field").SendKeys(participant.StudyField) + if err != nil { + panic(err) + } + err = findElement("button.dropdown-toggle").Click() if err != nil { panic(err)