roughly working again, now dev docker exists
This commit is contained in:
parent
a77a0c0393
commit
155ab39368
26 changed files with 1976 additions and 235 deletions
42
tests/test_playwright_login_flow.py
Normal file
42
tests/test_playwright_login_flow.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
import asyncio
|
||||
import pytest
|
||||
from playwright.async_api import async_playwright
|
||||
|
||||
USER_AGENTS = [
|
||||
# Chrome on Mac
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
||||
# Chrome on Windows
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
||||
# Firefox on Mac
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0",
|
||||
# Edge on Windows
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
|
||||
# Safari on Mac
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15",
|
||||
# iPhone Safari
|
||||
"Mozilla/5.0 (iPhone; CPU iPhone OS 17_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
|
||||
]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_inberlin_login_flow():
|
||||
async with async_playwright() as p:
|
||||
for ua in USER_AGENTS:
|
||||
print("\n==============================")
|
||||
print(f"Testing user agent: {ua}")
|
||||
browser = await p.chromium.launch(headless=True)
|
||||
context = await browser.new_context(user_agent=ua)
|
||||
page = await context.new_page()
|
||||
try:
|
||||
print("Navigating to login page...")
|
||||
login_response = await page.goto("https://www.inberlinwohnen.de/login", wait_until="networkidle")
|
||||
print(f"Login page status: {login_response.status if login_response else 'No response'}")
|
||||
print(f"Login page headers: {login_response.headers if login_response else 'No response'}")
|
||||
await asyncio.sleep(2)
|
||||
except Exception as e:
|
||||
print(f"Exception for user agent: {ua}\n{e}")
|
||||
finally:
|
||||
await browser.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(test_inberlin_login_flow())
|
||||
Loading…
Add table
Add a link
Reference in a new issue