Skip to content

Commit ab9fb96

Browse files
committed
Add missing test
1 parent 2db296d commit ab9fb96

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/async/test_selectors_misc.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import pytest
16+
17+
from playwright._impl._errors import Error
18+
from playwright._impl._selectors import Selectors
1519
from playwright.async_api import Page
1620

1721

@@ -52,3 +56,14 @@ async def test_should_work_with_internal_and(page: Page) -> None:
5256
'.bar >> internal:and="span"', "els => els.map(e => e.textContent)"
5357
)
5458
) == ["world2"]
59+
60+
61+
async def test_should_throw_already_registered_error_when_registering(
62+
selectors: Selectors,
63+
) -> None:
64+
await selectors.register("alreadyRegistered", "return []")
65+
with pytest.raises(
66+
Error,
67+
match='Selectors.register: "alreadyRegistered" selector engine has been already registered',
68+
):
69+
await selectors.register("alreadyRegistered", "return []")

0 commit comments

Comments
 (0)