From 5aa6f2db0f6bd614a35ea1cb0fe0252783532ef1 Mon Sep 17 00:00:00 2001 From: dgh06175 Date: Tue, 5 Aug 2025 22:16:46 +0900 Subject: [PATCH] Add best practice for assertion style in Playwright Python instructions --- instructions/playwright-python.instructions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instructions/playwright-python.instructions.md b/instructions/playwright-python.instructions.md index 92bbc77..f2cca5c 100644 --- a/instructions/playwright-python.instructions.md +++ b/instructions/playwright-python.instructions.md @@ -27,6 +27,8 @@ applyTo: '**' - **Element Counts**: Use expect(locator).to_have_count() to assert the number of elements found by a locator. - **Text Content**: Use expect(locator).to_have_text() for exact text matches and expect(locator).to_contain_text() for partial matches. - **Navigation**: Use expect(page).to_have_url() to verify the page URL. +- **Assertion Style**: Prefer `expect` over `assert` for more reliable UI tests. + ## Example