|
|
from playwright.sync_api import sync_playwright |
|
|
|
|
|
def verify_comments_layout(): |
|
|
with sync_playwright() as p: |
|
|
browser = p.chromium.launch(headless=True) |
|
|
|
|
|
context = browser.new_context(viewport={'width': 375, 'height': 812}) |
|
|
page = context.new_page() |
|
|
|
|
|
|
|
|
page.goto("http://127.0.0.1:5000/") |
|
|
|
|
|
|
|
|
page.click("text=Général") |
|
|
|
|
|
|
|
|
|
|
|
page.click("#fab-button") |
|
|
|
|
|
page.fill("textarea[name='content']", "Hello World Thread") |
|
|
|
|
|
|
|
|
page.click("input[value='Envoyer']") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
page.click(".text-blue-500", strict=False) |
|
|
|
|
|
|
|
|
|
|
|
page.wait_for_selector("#sticky-form") |
|
|
|
|
|
|
|
|
page.fill("#sticky-form textarea[name='content']", "First reply!") |
|
|
|
|
|
page.click("#sticky-form button[type='submit']") |
|
|
|
|
|
|
|
|
page.fill("#sticky-form textarea[name='content']", "Second reply!") |
|
|
page.click("#sticky-form button[type='submit']") |
|
|
|
|
|
|
|
|
page.wait_for_selector("#comments-list") |
|
|
|
|
|
|
|
|
page.screenshot(path="verification/thread_view.png", full_page=False) |
|
|
|
|
|
browser.close() |
|
|
|
|
|
if __name__ == "__main__": |
|
|
verify_comments_layout() |
|
|
|