func checkMainSectionsVisible(t *testing.T, wd selenium.WebDriverT, isVis bool, text string) { for _, hidden := range []string{"#footer", "#main"} { element := wd.Q(hidden) if element.IsDisplayed() != isVis { msg := "not be" if isVis { msg = "be" } t.Fatalf("%s section should %s turned on %s", hidden, msg, text) } } }
func checkNumCompletedItemsDisplayedText(t *testing.T, wd selenium.WebDriverT, expected string) { countDisplayed := wd.Q("span#num-completed") if countDisplayed.Text() != expected { t.Fatalf("unexpected done count '%s' but expected '%s'", countDisplayed, expected) } }
func numCheckedItems(t *testing.T, wd selenium.WebDriverT) int { return len(wd.QAll("li.completed")) }
func checkNumTodoItemsDisplayedText(t *testing.T, wd selenium.WebDriverT, expected string) { countDisplayed := wd.FindElement(selenium.ByCSSSelector, "#todo-count").Text() if countDisplayed != expected { t.Fatalf("unexpected todo count '%s' but expected '%s'", countDisplayed, expected) } }