Tests for #1304

Wrote two tests (select by text and select by CSS) for #1304