Working on selecting date in regression test
This commit is contained in:
parent
6eb1c75aab
commit
cec88c7247
1 changed files with 38 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue