Add new subscription form fields to regression tests
This commit is contained in:
parent
2da0b371bc
commit
a6179ecbb3
1 changed files with 43 additions and 11 deletions
|
@ -2,6 +2,7 @@ package regression_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.andreafazzi.eu/andrea/oef/orm"
|
"git.andreafazzi.eu/andrea/oef/orm"
|
||||||
|
@ -98,15 +99,18 @@ func (t *testSuite) TestSchoolSubscription() {
|
||||||
}
|
}
|
||||||
|
|
||||||
addSchoolAsSubscriber(&orm.School{
|
addSchoolAsSubscriber(&orm.School{
|
||||||
Name: "Liceo GALILEI",
|
Name: "Liceo GALILEI",
|
||||||
Code: "Fi12346789",
|
Code: "Fi12346789",
|
||||||
Address: "via Trieste 1, Milano",
|
Address: "via Trieste 1, Milano",
|
||||||
Region: &orm.Region{Name: "Friuli"},
|
Region: &orm.Region{Name: "Friuli"},
|
||||||
Email: "foo.bar@school.org",
|
Email: "foo.bar@school.org",
|
||||||
SchoolContactPersonFirstname: "Mario",
|
SchoolContactPersonFirstname: "Mario",
|
||||||
SchoolContactPersonLastname: "BROS",
|
SchoolContactPersonLastname: "BROS",
|
||||||
ContestDirectorFirstname: "Luigi",
|
SchoolContactPersonEmail: "mario.bros@nintendo.com",
|
||||||
ContestDirectorLastname: "BROS",
|
SchoolContactPersonTelephoneNumber: "123 456 789",
|
||||||
|
ContestDirectorFirstname: "Luigi",
|
||||||
|
ContestDirectorLastname: "BROS",
|
||||||
|
PreviousParticipantsSelection: 30,
|
||||||
})
|
})
|
||||||
|
|
||||||
expected := []string{"Liceo GALILEI", "foo.bar@school.org"}
|
expected := []string{"Liceo GALILEI", "foo.bar@school.org"}
|
||||||
|
@ -143,6 +147,8 @@ func (t *testSuite) TestSchoolSubscription() {
|
||||||
Firstname: "Mario",
|
Firstname: "Mario",
|
||||||
Lastname: "ROSSI",
|
Lastname: "ROSSI",
|
||||||
FiscalCode: "RSSMR1234567",
|
FiscalCode: "RSSMR1234567",
|
||||||
|
Year: 2,
|
||||||
|
StudyField: "Human Science",
|
||||||
Category: &orm.Category{Name: "Junior"},
|
Category: &orm.Category{Name: "Junior"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -151,6 +157,8 @@ func (t *testSuite) TestSchoolSubscription() {
|
||||||
Firstname: "Serena",
|
Firstname: "Serena",
|
||||||
Lastname: "BIANCA",
|
Lastname: "BIANCA",
|
||||||
FiscalCode: "BNCSR1234567",
|
FiscalCode: "BNCSR1234567",
|
||||||
|
Year: 4,
|
||||||
|
StudyField: "Economics",
|
||||||
Category: &orm.Category{Name: "Senior"},
|
Category: &orm.Category{Name: "Senior"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -195,6 +203,8 @@ func (t *testSuite) TestSchoolSubscription() {
|
||||||
Firstname: "Luigi",
|
Firstname: "Luigi",
|
||||||
Lastname: "VERDI",
|
Lastname: "VERDI",
|
||||||
FiscalCode: "VRDLGSR1234567",
|
FiscalCode: "VRDLGSR1234567",
|
||||||
|
Year: 4,
|
||||||
|
StudyField: "Economics",
|
||||||
Category: &orm.Category{Name: "Senior"},
|
Category: &orm.Category{Name: "Senior"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -214,6 +224,8 @@ func (t *testSuite) TestSchoolSubscription() {
|
||||||
Firstname: "Luigi",
|
Firstname: "Luigi",
|
||||||
Lastname: "VERDI",
|
Lastname: "VERDI",
|
||||||
FiscalCode: "BNCSR1234567",
|
FiscalCode: "BNCSR1234567",
|
||||||
|
Year: 4,
|
||||||
|
StudyField: "Economics",
|
||||||
Category: &orm.Category{Name: "Senior"},
|
Category: &orm.Category{Name: "Senior"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -472,7 +484,14 @@ func addSchoolAsSubscriber(school *orm.School) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
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)
|
err = findElement("#school_contest_director_firstname").SendKeys(school.ContestDirectorFirstname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -481,7 +500,10 @@ func addSchoolAsSubscriber(school *orm.School) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
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()
|
err = findElement("button.btn.btn-primary").Click()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -514,6 +536,16 @@ func populateParticipantForm(participant *orm.Participant) {
|
||||||
panic(err)
|
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()
|
err = findElement("button.dropdown-toggle").Click()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in a new issue