feat: Fix cookie handling for session in logs_page.py tests

This commit is contained in:
Théophile Diot 2024-06-12 13:57:17 +02:00
parent f67f5f65ab
commit 95c7896f93
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -133,10 +133,11 @@ try:
log_info("Type filter is working, trying to filter by date ...")
current_date = datetime.now()
cookie = DRIVER.get_cookies()[0]
resp = get(
f"https://www.example.com{UI_URL}/logs/{first_instance}?from_date={int((current_date - timedelta(weeks=1)).timestamp())}&to_date={int((current_date - timedelta(days=1)).timestamp())}",
headers={"Host": "www.example.com", "User-Agent": DRIVER.execute_script("return navigator.userAgent;")},
cookies={"session": DRIVER.get_cookies()[0]["value"]},
cookies={cookie["name"]: cookie["value"]},
verify=False,
)