diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 9ae55c0..7b9ff22 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -49,14 +49,15 @@ jobs: libegl1 \ libnotify4 \ libxslt1.1 \ - libevent-2.1-6 \ + libevent-2.1-7 \ libgles2 \ - libvpx5 \ + libvpx6 \ libxcomposite1 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libepoxy0 \ libgtk-3-0 \ + libgstreamer-gl1.0-0 \ libharfbuzz-icu0 \ xvfb - name: Lint with flake8 diff --git a/Examples/browser-management/open-close-browser.robot b/Examples/browser-management/open-close-browser.robot index 4af9152..836b686 100644 --- a/Examples/browser-management/open-close-browser.robot +++ b/Examples/browser-management/open-close-browser.robot @@ -5,10 +5,14 @@ Test Teardown Close All Browser *** Variables *** -${DEFAULT_BROWSER} chrome +${DEFAULT_BROWSER} pwchrome *** Test Cases *** +Open browser without option + ${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER} + Open browser http://127.0.0.1:7272/basic-html-elements.html browser=${BROWSER} + Switch to new browser ${BROWSER} = Get variable value ${BROWSER} ${DEFAULT_BROWSER} ${HEADLESS} = Get variable value ${HEADLESS} ${False} diff --git a/PuppeteerLibrary/keywords/browsermanagement.py b/PuppeteerLibrary/keywords/browsermanagement.py index 66b5bff..8262185 100644 --- a/PuppeteerLibrary/keywords/browsermanagement.py +++ b/PuppeteerLibrary/keywords/browsermanagement.py @@ -12,7 +12,7 @@ def get_async_keyword_group(self) -> iBrowserManagementAsync: return self.ctx.get_current_library_context().get_async_keyword_group(type(self).__name__) @keyword - def open_browser(self, url, browser="chrome", alias=None, options=None): + def open_browser(self, url, browser="chrome", alias=None, options={}): """Opens a new browser instance to the specific ``url``. The ``browser`` argument specifies which browser to use. diff --git a/PuppeteerLibrary/library_context/ilibrary_context.py b/PuppeteerLibrary/library_context/ilibrary_context.py index 8745aa8..96c6dff 100644 --- a/PuppeteerLibrary/library_context/ilibrary_context.py +++ b/PuppeteerLibrary/library_context/ilibrary_context.py @@ -14,7 +14,7 @@ def __init__(self, browser_type: str): self.screenshot_path = os.curdir @abstractmethod - async def start_server(self, options: dict=None): + async def start_server(self, options: dict={}): pass @abstractmethod @@ -26,7 +26,7 @@ def is_server_started(self) -> bool: pass @abstractmethod - async def create_new_page(self, options: dict=None) -> BasePage: + async def create_new_page(self, options: dict={}) -> BasePage: pass @abstractmethod diff --git a/PuppeteerLibrary/playwright/playwright_context.py b/PuppeteerLibrary/playwright/playwright_context.py index 5ea74d5..3ed6795 100644 --- a/PuppeteerLibrary/playwright/playwright_context.py +++ b/PuppeteerLibrary/playwright/playwright_context.py @@ -33,7 +33,7 @@ class PlaywrightContext(iLibraryContext): def __init__(self, browser_type: str): super().__init__(browser_type) - async def start_server(self, options: dict=None): + async def start_server(self, options: dict={}): default_options = { 'slowMo': 0, 'headless': True, @@ -67,7 +67,7 @@ def is_server_started(self) -> bool: return True return False - async def create_new_page(self, options: dict=None) -> BasePage: + async def create_new_page(self, options: dict={}) -> BasePage: device_options = { 'accept_downloads': True } diff --git a/PuppeteerLibrary/puppeteer/puppeteer_context.py b/PuppeteerLibrary/puppeteer/puppeteer_context.py index 45f847b..2a5e68c 100644 --- a/PuppeteerLibrary/puppeteer/puppeteer_context.py +++ b/PuppeteerLibrary/puppeteer/puppeteer_context.py @@ -35,7 +35,7 @@ class PuppeteerContext(iLibraryContext): def __init__(self, browser_type: str): super().__init__(browser_type) - async def start_server(self, options: dict=None): + async def start_server(self, options: dict={}): default_args = [] default_options = { 'slowMo': 0, @@ -74,7 +74,7 @@ def is_server_started(self) -> bool: return True return False - async def create_new_page(self, options: dict=None) -> BasePage: + async def create_new_page(self, options: dict={}) -> BasePage: new_page = await self.browser.newPage() self.current_page = PuppeteerPage(new_page) if 'emulate' in options: