mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
Anchors don't agree with setUrl. Using load instead. Fixes #92
This commit is contained in:
parent
89bee3cf65
commit
f75bc3dbad
2 changed files with 8 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue