Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions spec/integration/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,6 @@ module TestSessions
subject.find(:css, '#one').click
}.to raise_error(Capybara::Webkit::ClickFailed) { |exception|
exception.message.should =~ %r{Failed.*\[@id='one'\].*overlapping.*\[@id='two'\].*at position}
screenshot_pattern = %r{A screenshot of the page at the time of the failure has been written to (.*)}
exception.message.should =~ screenshot_pattern
file = exception.message.match(screenshot_pattern)[1]
File.exist?(file).should be_true
}
end

Expand Down
11 changes: 0 additions & 11 deletions src/JavascriptInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,3 @@ void JavascriptInvocation::keypress(QChar key) {
event = QKeyEvent(QKeyEvent::KeyRelease, keyCode, Qt::NoModifier, key);
QApplication::sendEvent(m_page, &event);
}

const QString JavascriptInvocation::render(void) {
QString pathTemplate =
QDir::temp().absoluteFilePath("./click_failed_XXXXXX.png");
QTemporaryFile file(pathTemplate);
file.open();
file.setAutoRemove(false);
QString path = file.fileName();
m_page->render(path, QSize(1024, 768));
return path;
}
1 change: 0 additions & 1 deletion src/JavascriptInvocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class JavascriptInvocation : public QObject {
Q_INVOKABLE QVariantMap clickPosition(QWebElement element, int left, int top, int width, int height);
Q_INVOKABLE void hover(int absoluteX, int absoluteY);
Q_INVOKABLE void keypress(QChar);
Q_INVOKABLE const QString render(void);
QVariant getError();
void setError(QVariant error);
InvocationResult invoke(QWebFrame *);
Expand Down
1 change: 0 additions & 1 deletion src/capybara.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ Capybara.ClickFailed = function(expectedPath, actualPath, position) {
this.message += ' at position ' + position["absoluteX"] + ', ' + position["absoluteY"];
else
this.message += ' at unknown position';
this.message += "; \nA screenshot of the page at the time of the failure has been written to " + CapybaraInvocation.render();
};
Capybara.ClickFailed.prototype = new Error();
Capybara.ClickFailed.prototype.constructor = Capybara.ClickFailed;
Expand Down