mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 11:02:03 -08:00
Update test script to output debug.log
This commit is contained in:
parent
752a36c9c2
commit
8a9b062d05
1 changed files with 20 additions and 2 deletions
|
|
@ -1,17 +1,35 @@
|
||||||
import argparse
|
import argparse
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import time
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from _mixin import find_src_dir, get_moz_target, temp_cd
|
from _mixin import find_src_dir, get_moz_target, temp_cd
|
||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright
|
||||||
|
|
||||||
|
LOCAL_PATH = Path(os.path.abspath(__file__)).parent
|
||||||
|
|
||||||
|
CONFIG = {
|
||||||
|
'window.outerWidth': 1920,
|
||||||
|
'window.outerHeight': 1080,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def launch_playwright(executable_path):
|
def launch_playwright(executable_path):
|
||||||
"""Launch playwright Firefox with unlimited time"""
|
"""Launch playwright Firefox with unlimited time"""
|
||||||
with sync_playwright() as p:
|
with sync_playwright() as p:
|
||||||
print('Launching browser.')
|
print('Launching browser.', executable_path)
|
||||||
browser = p.firefox.launch(executable_path=executable_path, headless=False)
|
browser = p.firefox.launch(
|
||||||
|
executable_path=executable_path,
|
||||||
|
headless=False,
|
||||||
|
args=[
|
||||||
|
'--stderr',
|
||||||
|
str(LOCAL_PATH / 'debug.log'),
|
||||||
|
'--config',
|
||||||
|
json.dumps(CONFIG),
|
||||||
|
],
|
||||||
|
)
|
||||||
page = browser.new_page()
|
page = browser.new_page()
|
||||||
url = os.getenv('URL') or 'https://google.com'
|
url = os.getenv('URL') or 'https://google.com'
|
||||||
page.goto(url)
|
page.goto(url)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue