Skip to content

Commit

Permalink
Remove workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgross committed Jan 5, 2025
1 parent bcb61cf commit 527e41d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/pcloud/oauth2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import logging
import socket
import _thread
import time

Expand Down
12 changes: 3 additions & 9 deletions src/pcloud/tests/test_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

from playwright.sync_api import sync_playwright, expect

from urllib.parse import urlparse


folder_for_tests = "integration-test"

Expand All @@ -21,25 +19,21 @@ class PlaywrightTokenHandler(TokenHandler):
"""

def open_browser(self):
parts = urlparse(self.auth_url)
home_url = f"{parts.scheme}://{parts.hostname}/"

with sync_playwright() as p:
# set headless to `False` for debugging purposes
self.browser = p.firefox.launch(headless=False)
self.browser = p.firefox.launch(headless=True)
self.browser.new_context(
locale="de-DE",
timezone_id="Europe/Berlin",
)
page = self.browser.new_page()
page.goto(home_url)
log.info(self.auth_url)
page.goto(self.auth_url)
page.get_by_placeholder("Email").fill(os.environ.get("PCLOUD_USERNAME"))
page.locator("[type=submit]").click()
page.get_by_placeholder("Password").fill(os.environ.get("PCLOUD_PASSWORD"))
page.locator("[type=submit]").click()
expect(page.get_by_text("[email protected]")).to_be_visible()
log.info(self.auth_url)
page.goto(self.auth_url)
expect(page.get_by_text("You may now close this window.")).to_be_visible()


Expand Down

0 comments on commit 527e41d

Please sign in to comment.