示例#1
0
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)
		}
	}

}
示例#2
0
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)
	}
}
示例#3
0
func numCheckedItems(t *testing.T, wd selenium.WebDriverT) int {
	return len(wd.QAll("li.completed"))
}
示例#4
0
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)
	}
}