-
Notifications
You must be signed in to change notification settings - Fork 61
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
Initial Webdriver support #305
Conversation
cog.c
Outdated
if (s_options.automation) { | ||
uri = "about:blank"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just check whether CogShell object is automated? This would avoid the need for the option list entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking the CogShell for automation is also possible. I've updated the patch with it.
Regarding the option list entry, I thought about it more like a way to document this flag, keeping consistent with other arguments (even though it has this special check before the application is created).
This property will be used through cog to detect whether it has been launched in automated mode (e.g. launched from WebDriver). The most visible changes are the "automated" property and the new `cog_launcher_init_default(type)`, to initialize the default launcher with the given session type. The previous `cog_launcher_get_default` keeps the behavior of creating a non-automated launcher if none has been created yet (unlikely to happen, though).
Just a stub and defaulting to about:blank instead of requiring an URL explicitly. Actual automation pumbling to be done in following commits.
Mirror of the cog-launcher one.
Actual testing with both selenium and WPT should be limited by lack of multi view support as their fixtures rely on creating multiple views.
Usually from javascript's window.close or webkit_web_view_try_close. This is a very basic handler. We might want to expose it to the cog-shell API to allow the user to react to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo style checker failures, patch looks reasonable to me. You can apply locally the suggestions from the style checker doing something like this, assuming you have a local branch derived from master
:
data/check-style master | git apply -p0
Thanks @lauromoura! |
These commits add the basic plumbing needed to support running WebDriver scripts with Cog. For example, opening a page, following links and sending basic mouse and keyboard commands.
Still missing some documentation and examples of using it, alongside other bits like some visual feedback that the automation mode is enabled.
On the WebKit side, some harness patch will be needed to make the webdriver tests to run with
-DENABLE_COG
enabled.