splinter icon indicating copy to clipboard operation
splinter copied to clipboard

new driver for webkit

Open andrewsmedina opened this issue 15 years ago • 15 comments

we can create a driver using webkit engine to run actions without a browser, with the same results.

for help us with this, we can use qtwebkit

andrewsmedina avatar Apr 28 '11 13:04 andrewsmedina

Going to work on it using pyphantomjs: https://github.com/ariya/phantomjs/blob/master/python/pyphantomjs.py

fsouza avatar May 17 '11 06:05 fsouza

Or PySide! :)

rafaelcaricio avatar Jul 23 '11 01:07 rafaelcaricio

Hello, are you currently working on this issue? Do you need some help to finish the issue? https://github.com/diegokogan and I may be able to help.

cacciaresi avatar Aug 03 '11 20:08 cacciaresi

I'd appreciate your help a lot :)

Can you get QtWebKit working on a Mac OS?

I recently updated to Mac OS X Lion and Xcode 4 and didn't try again. I'm gonna try it later today :)

fsouza avatar Aug 03 '11 20:08 fsouza

We look at this issue because we were looking for a headless browser to run our acceptance tests. We thought that using PhantomJS to implement a headless browser would be a good option.

Could you list which should be the behaviour to implement? We don't have much experience with the implementation of splinter.

cacciaresi avatar Aug 08 '11 13:08 cacciaresi

Hi there, the process of create a new driver is pretty simple: you just need to implement a TestCase (extending tests.base. BaseBrowserTests). e.g.: you can create test_phantomjs.py file, containing something like this:

from splinter.browser import Browser
from tests.base import BaseBrowserTests

class PhantomJSTest(BaseBrowserTests):

    @classmethod
    def setUpClass(cls):
        cls.browser = Browser('phantomjs')

    # ...

And then you add your driver to splinter.driver.phantomjs.PhantomJS, e.g.:

from splinter.driver import DriverAPI, ElementAPI

class PhantomJS(DriverAPI):
    pass

class PhantomJSElement(ElementAPI):
    pass

All you have to do now is run the tests and implement the methods present on DriverAPI and ElementAPI classes. You can run the test with make:

$ make test which=tests/test_phantomjs.py

It's a very "guide" on how to write a splinter driver, please keep in touch if you have any trouble.

fsouza avatar Aug 08 '11 16:08 fsouza

Excellent information! Thanks a lot.

We will be updating this issue while we progress on the issue.

cacciaresi avatar Aug 09 '11 12:08 cacciaresi

I'm on it too, It's nice to see it actually working! Right now I can visit a page and get it's title. There's too much work to be done!

fabiomcosta avatar Aug 21 '11 23:08 fabiomcosta

Glad to read this :)

fsouza avatar Aug 22 '11 00:08 fsouza

BTW, the test suite you guys did is awesome! Will help a lot.

fabiomcosta avatar Aug 22 '11 00:08 fabiomcosta

I would love to see phantom.js supported.

oinopion avatar Jan 05 '12 11:01 oinopion

I've stopped it. I was having some non-helpful errors while trying to test it. The api would have to change too, cause phantomJs is all asynchronous, which made the work even more unpleasant. There's a python project that uses QtWebkit too, just don't remember the name, maybe it would be a good one to use as part of the qtwebkit driver.

fabiomcosta avatar Jan 05 '12 11:01 fabiomcosta

There's spynner: http://code.google.com/p/spynner/

fsouza avatar Jan 05 '12 15:01 fsouza

thats the one I was trying to remember :) ty @fsouza

fabiomcosta avatar Jan 05 '12 16:01 fabiomcosta

The right link for spynner, on github: https://github.com/makinacorpus/spynner

fsouza avatar Jan 06 '12 12:01 fsouza