Webapp Testing Assertion Examples

Sub-skill of webapp-testing: Assertion Examples (+1).

vamseeachanta baf55d6 724 B Updated

File contents

Assertion Examples (+1)

Assertion Examples

from playwright.sync_api import expect

# Text content
expect(page.locator("h1")).to_have_text("Welcome")

# Visibility
expect(page.locator(".modal")).to_be_visible()
expect(page.locator(".loading")).to_be_hidden()


*See sub-skills for full details.*

## Test Structure


```python
import pytest
from playwright.sync_api import sync_playwright

@pytest.fixture(scope="session")
def browser():
    with sync_playwright() as p:
        browser = p.chromium.launch()
        yield browser
        browser.close()

*See sub-skills for full details.*

vamseeachanta/workspace-hub/tree/main/.agents/skills/_archive/development/webapp-testing/assertion-examples commit baf55d6f1d

Frequently asked questions

npx skillmds@latest add vamseeachanta/webapp-testing-assertion-examples