Anchors don't agree with setUrl. Using load instead. Fixes #92

This commit is contained in:
Matthew Mongeau 2011-09-30 12:32:06 -04:00
parent 89bee3cf65
commit f75bc3dbad
2 changed files with 8 additions and 5 deletions

View File

@ -177,6 +177,13 @@ describe Capybara::Driver::Webkit do
end
end
it "handles anchor tags" do
subject.visit("#test")
subject.find("//*[contains(., 'hello')]").should_not be_empty
subject.visit("#test")
subject.find("//*[contains(., 'hello')]").should_not be_empty
end
it "finds content after loading a URL" do
subject.find("//*[contains(., 'hello')]").should_not be_empty
end

View File

@ -8,11 +8,7 @@ Visit::Visit(WebPage *page, QObject *parent) : Command(page, parent) {
void Visit::start(QStringList &arguments) {
QUrl requestedUrl = QUrl(arguments[0]);
page()->currentFrame()->setUrl(QUrl(requestedUrl));
if(requestedUrl.hasFragment()) {
// workaround for https://bugs.webkit.org/show_bug.cgi?id=32723
page()->currentFrame()->setUrl(QUrl(requestedUrl));
}
page()->currentFrame()->load(QUrl(requestedUrl));
}
void Visit::loadFinished(bool success) {