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

Set custom HTML #170

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@niklasb
Contributor

niklasb commented Sep 24, 2011

  • Allows setting a custom HTML document and URL without issuing an HTTP request
  • Resources (Javascript/CSS) are fetched correctly after loading the HTML
  • Includes specs

General information about my pull requests

As I decided to use capybara and capybara-webkit for screen scraping tasks, I added some new procedures to the webkit_server and Capybara::WebKit::Browser that provide an interface to some of the underlying QtWebKit's advanced functionality.
A possible use case for this is that one can use a fast Javascript-unaware scraper like Mechanize or Net::HTTP and upgrade to a Javascript-aware browser-session using capybara-webkit only as long as dynamic content has to be accessed.

Pull requests that belong to this group of changes:

  • _Advanced cookie management_
  • _Set custom HTML_

Note: Because I had to add several C++ source files and headers to webkit_server, I decided to give the webkit_server.pro a nicer and more version control friendly layout. This is of course optional, I don't know whether this file is somehow auto-generated?

niklasb added some commits Sep 24, 2011

work around issue when the pageFinished signal is emitted twice
This problem was analyzed in detail by Brian Buchanan here:
#39
This fix is the same as for the Visit command in the master branch.
message = page()->failureString();
disconnect(page(), SIGNAL(pageFinished(bool)), this,
SLOT(loadFinished(bool)));

This comment has been minimized.

@niklasb

niklasb Oct 6, 2011

Contributor

same fix as for the Visit command. Also needs a test?

@niklasb

niklasb Oct 6, 2011

Contributor

same fix as for the Visit command. Also needs a test?

@halogenandtoast

This comment has been minimized.

Show comment
Hide comment
@halogenandtoast

halogenandtoast Jan 13, 2012

Contributor

I think the use case you've described is beyond the scope of what we'd like to maintain. If more people run into a need for this perhaps I'll reconsider, but for the time being I'm going to close this.

Contributor

halogenandtoast commented Jan 13, 2012

I think the use case you've described is beyond the scope of what we'd like to maintain. If more people run into a need for this perhaps I'll reconsider, but for the time being I'm going to close this.

@niklasb

This comment has been minimized.

Show comment
Hide comment
@niklasb

niklasb Jan 13, 2012

Contributor

@halogenandtoast: I see.

If somebody is interested in this, I opened a fork of the server at https://github.com/niklasb/webkit-server. Also includes Python bindings.

Contributor

niklasb commented Jan 13, 2012

@halogenandtoast: I see.

If somebody is interested in this, I opened a fork of the server at https://github.com/niklasb/webkit-server. Also includes Python bindings.

@david

This comment has been minimized.

Show comment
Hide comment
@david

david Apr 4, 2012

I think this would actually be a very nifty solution to test html emails. I would be able to extract the html content, pass it to capybara-webkit, render it for debugging purposes, and even use capybara's methods.

Is there a simpler way to do what I mentioned that I'm not aware of?

david commented Apr 4, 2012

I think this would actually be a very nifty solution to test html emails. I would be able to extract the html content, pass it to capybara-webkit, render it for debugging purposes, and even use capybara's methods.

Is there a simpler way to do what I mentioned that I'm not aware of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment