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

Add service class #1902

Merged
merged 18 commits into from
May 18, 2024
Merged

Add service class #1902

merged 18 commits into from
May 18, 2024

Conversation

emanlove
Copy link
Member

This brings in the Service class into the Open Browser keyword.

Working on an issue with the Options class gave me deeper insight into how it was working. Brought that experience over to
the Service class. Thjis is an initial implementation / rewrite of the Service class. It follows more closely the options class.
There is just the one test for now and I see I need to bring in the service argument into Open Browser but this feels like
a good start.
… browsers

The is just an in ititial commit with some changes which bring the service class down to
the point where we create/instantiate the webdrivers for the for the various browsers.
Still need some work to actually use what the user provides and to test this code.
Although I have completed the intial implementation of the service class and
it's usage, I have discovered unlike the selenium options most if not all of the attributes
must be set on the instantiate of the class. So need to rework the parsing (should check
signature instead of attributes) and then construct the class with these parameters.
Some minor changes which I want to store away. Starting to see the final
version of this code. Also started to add a test case copied from the
options test. All this is a work in progress.
It is almost complete but still something wrong with how I am instatiating the
service class with the parsed arguments. Cleaned up the Service class and added
a test case where I wasn't trying to set the driver path (which is a bad idea to
use a made up one because the test fails in the the chromedriver wouldn't start).
Update some of the atests. Need to add some unit tests and make sure service class is
getting passed in. Need to deprecate and guide users away from service_log_path and
executable_path.
All but the Chrome needed to have service class added. Now need to figure out
how to handle one using the deprecated service_log_path and executable_path
arguments.
A major overhaul of the keyword documentation for `Open Browser`.

- Added some deprecation warnings for ``service_log_path`` and
  ``executable_path`` options. Also noted that the already
  deprecated ``desired_capabilities`` will be removed in the next
  release.
- Removed note about partial support for options as it is now full
  support.
- Moved majority of options description up to the main library
  documentation.
- Reshuffled examples and put them closery to the arguments they
  demonstarte.
- Removed many of the "this feature was added in version x" messages
  as they are very old changes.
My method for parsing out the argument does not allow for spaces. I want to revist this but
in the meantime going to exclude that test.

Also corrected unit test which checked the plug in documentation. As I update the library
intro section this was failing. Not sure why it was not failing in GitHub Actions .. either
I hadn't pushed or maybe had not yet checked that yet ..
# service = importlib.import_module(f"selenium.webdriver.{browser}.service")
# return service.Service
class SeleniumService:
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty doc string

@emanlove emanlove merged commit dd89d33 into robotframework:master May 18, 2024
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants