You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On pages with iframes cuprite triggers a javascript error when switching into a frame.
I have written a test which shows the errors:
diff --git a/spec/features/driver_spec.rb b/spec/features/driver_spec.rb
index d9f9403..d4c3d7d 100644
--- a/spec/features/driver_spec.rb+++ b/spec/features/driver_spec.rb@@ -1555,6 +1555,16 @@ module Capybara
expect(@session.driver.current_url).to end_with("/cuprite/frames")
end
+ it "generates no javascript errors with frames" do+ @driver.browser.evaluate_on_new_document(+ "window.errors ||= []; window.onerror = function(msg) { window.errors += msg; };" + )+ @session.visit "/cuprite/frames" ++ @session.within_frame(0) { expect(@session.evaluate_script("window.errors")).to be_empty }+ expect(@session.evaluate_script("window.errors")).to be_empty+ end+
it "waits for network idle" do
@session.visit "/cuprite/show_cookies"
expect(@session).not_to have_content("test_cookie")
This fails with this message:
Failure/Error: @session.within_frame(0) { expect(@session.evaluate_script("window.errors")).to be_empty }
expected `"Uncaught SyntaxError: Identifier 'InvalidSelector' has already been declared".empty?` to be truthy, got false
However this seems only to happen with Chrome >= 102. When i run this test with Chrome 101 or lower it does not fail.
On pages with iframes cuprite triggers a javascript error when switching into a frame.
I have written a test which shows the errors:
This fails with this message:
However this seems only to happen with Chrome >= 102. When i run this test with Chrome 101 or lower it does not fail.
The identifier
InvalidSelector
is defined here: https://github.com/rubycdp/cuprite/blob/2bbf3634d92af4e8b8ec3026c2b66ccf1d0590ad/lib/capybara/cuprite/javascripts/index.js.Looks like these extensions are executed in the same context multiple times with frames?
The text was updated successfully, but these errors were encountered: