Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement BrowserType.connect #800

Merged
merged 17 commits into from
Mar 2, 2023
Merged

Implement BrowserType.connect #800

merged 17 commits into from
Mar 2, 2023

Commits on Mar 2, 2023

  1. Remove storage.Dir property from BrowserType

    Removes the data dir property from BrowserType as it's unnecessary as a
    property for the struct, instead we can define it when launching the
    browser. This will allows the possibility of having two different
    implementations of storage.Dir, one local and one remote.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    2900f70 View commit details
    Browse the repository at this point in the history
  2. Add BrowserProcessMeta abstraction

    Adds a new component BrowserProcessMeta in order to abstract the
    handling of the browser process handle and the browser data directory.
    This is defined as an interface that will support implementations for a
    local browser process and for a remote browser process and therefore
    minimizing changes in the rest of the implementation, as well as
    protecting the process and data dir properties from possible NPE errors.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    5e9b761 View commit details
    Browse the repository at this point in the history
  3. Modify BrowserProcess to use LocalBrowserProcessMeta

    Modify BrowserProcess to use the BrowserProcessMeta abstraction. With
    the current implementation only LocalBrowserProcessMeta applies as right
    now the browser to connect to is always launched from our
    implementation.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    dd2c1fa View commit details
    Browse the repository at this point in the history
  4. Avoid call to BrowserProcess meta from Browser

    This commit provides an abstraction for BrowserProcess cleanup and
    modifies Browser implementation in order to use it and in this way
    avoids reaching the internal BrowserProcess property 'meta' from it.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    39e62b9 View commit details
    Browse the repository at this point in the history
  5. Fix BrowserType.Connect method signature

    Fixes the BrowserType.Connect method signature in order to receive as
    input the WS URL to connect to, and return a Browser instance.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    b0d75fd View commit details
    Browse the repository at this point in the history
  6. Remove BrowserType logger

    Removes the logger instance held by BrowserType as it's unnecessary.
    Instead a local logger is created and passed along during the launch
    process. Also removes the unnecessary BrowserProcess.AttachLogger method
    as the logger was already passed to the constructor and could be set
    from there.
    This will allow to not tight the loggers used for BrowserType.Launch and
    BrowserType.Connect methods.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    383f254 View commit details
    Browse the repository at this point in the history
  7. Refactor browser options to use constants

    Defines possible browser launch options as constants instead of string
    literals. This will be useful when adding additional parsing methods to
    handle the differences for BrowserType launch and connect methods.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    f87fd5f View commit details
    Browse the repository at this point in the history
  8. Add support for remote browser options

    Modifies browser options in order to support parsing for options when
    the browser is indicated to be in a remote machine.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    aa84874 View commit details
    Browse the repository at this point in the history
  9. Rename NewBrowserProcess to NewLocalBrowserProcess

    This allows to differentiate the constructor for a local browser process
    and a remote browser process.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    9aafb17 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1815afd View commit details
    Browse the repository at this point in the history
  11. Refactor browser process constructors

    Extract common code for browser process termination handling in its own
    function.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    8f42ed6 View commit details
    Browse the repository at this point in the history
  12. Implement BrowserType.Connect

    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    a77bf3a View commit details
    Browse the repository at this point in the history
  13. Refactor, move ExecutablePath method

    This is for readability purposes, so launch and connect implementations
    are together, as they share common behaviors.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    c60ad61 View commit details
    Browse the repository at this point in the history
  14. Refactor BrowserType Launch and Connect

    Refactos Launch and Connect methods in order to extract common
    implementation parts (mainly initialization procedures) into a single
    function, reduce code repetition and simplify the main methods flow.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    2b1a852 View commit details
    Browse the repository at this point in the history
  15. Add BrowserType.Connect test

    Also adds a new method in common.Browser API so we can get the
    underlying browser process WS URL. This is required in order to reuse
    the current TestBrowser implementation to launch a new browser and
    connecto to it through BrowserType.Connect.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    eb32d01 View commit details
    Browse the repository at this point in the history
  16. Refactor cloud and remote browser flags

    Removes the cloud flag as it's overlapped by the remote flag.
    Resolves: #800 (comment)
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    21253ab View commit details
    Browse the repository at this point in the history
  17. Avoid closing browser when executed remotely

    Modifies the Browser.Close implementation in order to avoid sending the
    Close CDP cmd when the browser is being executed remotely.
    ka3de committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    1bbf855 View commit details
    Browse the repository at this point in the history