Telefonica / toolium

Wrapper tool of Selenium and Appium libraries to test web and mobile applications in a single project
Apache License 2.0
115 stars 62 forks source link

feat: support different browsers at playwright starts #398

Closed jruizg23 closed 3 months ago

jruizg23 commented 4 months ago

Implements the method to start different browser types with these options.

New options sections can be defined in the properties.cfg:

[PlaywrightBrowserOptions] >> Playwright options for the Browser instance (check here: https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch). ChromeArguments can be defined in the property "args" or in the old section. In this case, ChromeArguments replaces the defined arguments in args. The same with FirefoxArguments. FirefoxPreferences works in the same way but the property used is firefox_user_prefs. ChromeExtensions are added as arguments. Firefox Extensions are not supported in playwright.

[PlaywrightContextOptions] >> Playwright options for the Context instance (check here: https://playwright.dev/python/docs/api/class-browser#browser-new-context)

[PlawrightPageOptions] >> Playwright options for the Page instance (check here: https://playwright.dev/python/docs/api/class-browser#browser-new-page)

It's possible to execute a browser in persistent mode passing the property user_data_dir in PlaywrightContextOptions. In these case, the session will be persisted and used by all the pages. In this case PlawrightBrowserOptions are omitted, only context options are available (check options here: https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch-persistent-context)