-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
4 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,6 @@ | |
|
||
from playwright.sync_api import sync_playwright, expect | ||
|
||
from urllib.parse import urlparse | ||
|
||
|
||
folder_for_tests = "integration-test" | ||
|
||
|
@@ -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() | ||
|
||
|
||
|