Working on selecting date in regression test

This commit is contained in:
Andrea Fazzi 2020-03-04 13:32:48 +01:00
parent 6eb1c75aab
commit cec88c7247

View file

@ -304,6 +304,31 @@ func (t *testSuite) TestParticipantResponse() {
logout()
}
func (t *testSuite) TestContestActiveWindow() {
login("admin", "admin")
err := searchAndClick("junior")
if err != nil {
panic(err)
}
err = findElement("a.btn-primary").Click()
if err != nil {
panic(err)
}
err = findElement("#contest_date").Click()
if err != nil {
panic(err)
}
err = findElement(".datetime-edit-field").SendKeys("04032020")
t.True(true)
logout()
}
func findElement(selector string) selenium.WebElement {
element, err := wd.FindElement(selenium.ByCSSSelector, selector)
if err != nil {
@ -509,3 +534,16 @@ func clickPrimaryButton() {
panic(err)
}
}
func searchAndClick(text string) error {
err := findElement("#myInput").SendKeys(text)
if err != nil {
return err
}
err = findElement("a.oef-selected-by-search").Click()
if err != nil {
return err
}
return nil
}