diff --git a/internal/driver/chrome/selector_parity_test.go b/internal/driver/chrome/selector_parity_test.go index 7166f4f..c91d0da 100644 --- a/internal/driver/chrome/selector_parity_test.go +++ b/internal/driver/chrome/selector_parity_test.go @@ -108,6 +108,25 @@ func TestSelectors_ResolveTheSameElementsAsTheWebRuntime(t *testing.T) { object: objectSelector("data-state", "sent"), want: []string{"status_badge"}, }, + { + name: "class", + selector: "class:status", + object: objectSelector("class", "status"), + want: []string{"nested_row", "nested_badge"}, + }, + { + // className is the DOM property name for the same attribute, and + // the two names have to name the same elements: the web runtime + // compiles both to the same class query, while the dump carries + // the fact under `class` alone and no alias reached it, so this + // key matched the row and the badge on one host and NOTHING on the + // other. The key is accepted, so no unknown-key error fires, and a + // property over the missing element passes having checked nothing. + name: "className", + selector: "className:status", + object: objectSelector("className", "status"), + want: []string{"nested_row", "nested_badge"}, + }, { // A custom element's tag name holds a real tag name inside it, so a // substring rule answered tag:li with and tag:a with