| 123456789101112131415161718192021222324252627282930 |
- from playwright.sync_api import sync_playwright
- import time
- with sync_playwright() as p:
- browser = p.chromium.launch(headless=True)
- page = browser.new_page(viewport={'width': 1440, 'height': 900})
- page.goto('http://127.0.0.1:4320/')
- time.sleep(2)
- page.click('text=社群运营')
- time.sleep(2)
- page.click('text=SOP 版本')
- time.sleep(1)
- # Test confirm modal by clicking 发布
- page.click('text=发布')
- time.sleep(1)
- page.screenshot(path='/tmp/qiwei-group-ops-confirm-modal2.png', full_page=False)
- # Close with cancel
- page.click('button:has-text("取消")')
- time.sleep(0.5)
- # Test prompt modal by clicking 新版本
- page.click('text=新版本')
- time.sleep(1)
- page.screenshot(path='/tmp/qiwei-group-ops-prompt-modal2.png', full_page=False)
- # Close with cancel
- page.click('button:has-text("取消")')
- time.sleep(0.5)
- browser.close()
- print('screenshots saved')
|