diff --git a/Gemfile.lock b/Gemfile.lock index f1584df..9fd7062 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,10 +72,10 @@ GEM zeitwerk (~> 2.3) acts_as_list (0.9.19) activerecord (>= 3.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - axe-core-api (4.8.0) + axe-core-api (4.8.1) dumb_delegator virtus axe-core-rspec (4.1.0) @@ -97,17 +97,18 @@ GEM html_tokenizer (~> 0.0.6) parser (>= 2.4) smart_properties + bigdecimal (3.1.6) bindex (0.8.1) - bootsnap (1.17.0) + bootsnap (1.18.2) msgpack (~> 1.2) browser (2.7.1) builder (3.2.4) byebug (11.1.3) - capybara (3.39.2) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) @@ -132,7 +133,7 @@ GEM actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) charlock_holmes (0.7.7) - chef-utils (18.3.0) + chef-utils (18.4.2) concurrent-ruby childprocess (4.1.0) coercible (1.0.0) @@ -145,8 +146,9 @@ GEM execjs coffee-script-source (1.12.2) commonmarker (0.23.10) - concurrent-ruby (1.2.2) - crack (0.4.5) + concurrent-ruby (1.2.3) + crack (0.4.6) + bigdecimal rexml crass (1.0.6) css_parser (1.16.0) @@ -158,53 +160,53 @@ GEM db-query-matchers (0.10.0) activesupport (>= 4.0, < 7) rspec (~> 3.0) - decidim (0.27.4) - decidim-accountability (= 0.27.4) - decidim-admin (= 0.27.4) - decidim-api (= 0.27.4) - decidim-assemblies (= 0.27.4) - decidim-blogs (= 0.27.4) - decidim-budgets (= 0.27.4) - decidim-comments (= 0.27.4) - decidim-core (= 0.27.4) - decidim-debates (= 0.27.4) - decidim-forms (= 0.27.4) - decidim-generators (= 0.27.4) - decidim-meetings (= 0.27.4) - decidim-pages (= 0.27.4) - decidim-participatory_processes (= 0.27.4) - decidim-proposals (= 0.27.4) - decidim-sortitions (= 0.27.4) - decidim-surveys (= 0.27.4) - decidim-system (= 0.27.4) - decidim-templates (= 0.27.4) - decidim-verifications (= 0.27.4) - decidim-accountability (0.27.4) - decidim-comments (= 0.27.4) - decidim-core (= 0.27.4) - decidim-admin (0.27.4) + decidim (0.27.5) + decidim-accountability (= 0.27.5) + decidim-admin (= 0.27.5) + decidim-api (= 0.27.5) + decidim-assemblies (= 0.27.5) + decidim-blogs (= 0.27.5) + decidim-budgets (= 0.27.5) + decidim-comments (= 0.27.5) + decidim-core (= 0.27.5) + decidim-debates (= 0.27.5) + decidim-forms (= 0.27.5) + decidim-generators (= 0.27.5) + decidim-meetings (= 0.27.5) + decidim-pages (= 0.27.5) + decidim-participatory_processes (= 0.27.5) + decidim-proposals (= 0.27.5) + decidim-sortitions (= 0.27.5) + decidim-surveys (= 0.27.5) + decidim-system (= 0.27.5) + decidim-templates (= 0.27.5) + decidim-verifications (= 0.27.5) + decidim-accountability (0.27.5) + decidim-comments (= 0.27.5) + decidim-core (= 0.27.5) + decidim-admin (0.27.5) active_link_to (~> 1.0) - decidim-core (= 0.27.4) + decidim-core (= 0.27.5) devise (~> 4.7) devise-i18n (~> 1.2) - devise_invitable (~> 2.0) - decidim-api (0.27.4) + devise_invitable (~> 2.0, >= 2.0.9) + decidim-api (0.27.5) graphql (~> 1.12, < 1.13) graphql-docs (~> 2.1.0) rack-cors (~> 1.0) - decidim-assemblies (0.27.4) - decidim-core (= 0.27.4) - decidim-blogs (0.27.4) - decidim-admin (= 0.27.4) - decidim-comments (= 0.27.4) - decidim-core (= 0.27.4) - decidim-budgets (0.27.4) - decidim-comments (= 0.27.4) - decidim-core (= 0.27.4) - decidim-comments (0.27.4) - decidim-core (= 0.27.4) + decidim-assemblies (0.27.5) + decidim-core (= 0.27.5) + decidim-blogs (0.27.5) + decidim-admin (= 0.27.5) + decidim-comments (= 0.27.5) + decidim-core (= 0.27.5) + decidim-budgets (0.27.5) + decidim-comments (= 0.27.5) + decidim-core (= 0.27.5) + decidim-comments (0.27.5) + decidim-core (= 0.27.5) redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.27.4) + decidim-core (0.27.5) active_link_to (~> 1.0) acts_as_list (~> 0.9) batch-loader (~> 1.2) @@ -214,7 +216,7 @@ GEM cells-rails (~> 0.1.3) charlock_holmes (~> 0.7) date_validator (~> 0.12.0) - decidim-api (= 0.27.4) + decidim-api (= 0.27.5) devise (~> 4.7) devise-i18n (~> 1.2) diffy (~> 3.3) @@ -255,15 +257,15 @@ GEM webpacker (= 6.0.0.rc.5) webpush (~> 1.1) wisper (~> 2.0) - decidim-debates (0.27.4) - decidim-comments (= 0.27.4) - decidim-core (= 0.27.4) - decidim-dev (0.27.4) + decidim-debates (0.27.5) + decidim-comments (= 0.27.5) + decidim-core (= 0.27.5) + decidim-dev (0.27.5) axe-core-rspec (~> 4.1.0) byebug (~> 11.0) capybara (~> 3.24) db-query-matchers (~> 0.10.0) - decidim (= 0.27.4) + decidim (= 0.27.5) erb_lint (~> 0.0.35) factory_bot_rails (~> 4.8) i18n-tasks (~> 0.9.18) @@ -286,45 +288,45 @@ GEM w3c_rspec_validators (~> 0.3.0) webmock (~> 3.6) wisper-rspec (~> 1.0) - decidim-forms (0.27.4) - decidim-core (= 0.27.4) + decidim-forms (0.27.5) + decidim-core (= 0.27.5) wicked_pdf (~> 2.1) wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.27.4) - decidim-core (= 0.27.4) - decidim-meetings (0.27.4) - decidim-core (= 0.27.4) - decidim-forms (= 0.27.4) + decidim-generators (0.27.5) + decidim-core (= 0.27.5) + decidim-meetings (0.27.5) + decidim-core (= 0.27.5) + decidim-forms (= 0.27.5) icalendar (~> 2.5) - decidim-pages (0.27.4) - decidim-core (= 0.27.4) - decidim-participatory_processes (0.27.4) - decidim-core (= 0.27.4) - decidim-proposals (0.27.4) - decidim-comments (= 0.27.4) - decidim-core (= 0.27.4) + decidim-pages (0.27.5) + decidim-core (= 0.27.5) + decidim-participatory_processes (0.27.5) + decidim-core (= 0.27.5) + decidim-proposals (0.27.5) + decidim-comments (= 0.27.5) + decidim-core (= 0.27.5) doc2text (~> 0.4.5) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.27.4) - decidim-admin (= 0.27.4) - decidim-comments (= 0.27.4) - decidim-core (= 0.27.4) - decidim-proposals (= 0.27.4) - decidim-surveys (0.27.4) - decidim-core (= 0.27.4) - decidim-forms (= 0.27.4) - decidim-templates (= 0.27.4) - decidim-system (0.27.4) + decidim-sortitions (0.27.5) + decidim-admin (= 0.27.5) + decidim-comments (= 0.27.5) + decidim-core (= 0.27.5) + decidim-proposals (= 0.27.5) + decidim-surveys (0.27.5) + decidim-core (= 0.27.5) + decidim-forms (= 0.27.5) + decidim-templates (= 0.27.5) + decidim-system (0.27.5) active_link_to (~> 1.0) - decidim-core (= 0.27.4) + decidim-core (= 0.27.5) devise (~> 4.7) devise-i18n (~> 1.2) - devise_invitable (~> 2.0) - decidim-templates (0.27.4) - decidim-core (= 0.27.4) - decidim-forms (= 0.27.4) - decidim-verifications (0.27.4) - decidim-core (= 0.27.4) + devise_invitable (~> 2.0, >= 2.0.9) + decidim-templates (0.27.5) + decidim-core (= 0.27.5) + decidim-forms (= 0.27.5) + decidim-verifications (0.27.5) + decidim-core (= 0.27.5) declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) @@ -347,7 +349,7 @@ GEM nokogiri (>= 1.13.2, < 1.15.0) rubyzip (~> 2.3.0) docile (1.4.0) - doorkeeper (5.6.7) + doorkeeper (5.6.8) railties (>= 5) doorkeeper-i18n (4.0.1) dumb_delegator (1.0.0) @@ -363,7 +365,7 @@ GEM temple erubi (1.12.0) escape_utils (1.3.0) - excon (0.105.0) + excon (0.109.0) execjs (2.9.1) extended-markdown-filter (0.7.0) html-pipeline (~> 2.9) @@ -374,16 +376,15 @@ GEM railties (>= 3.0.0) faker (2.23.0) i18n (>= 1.8.11, < 2) - faraday (2.7.12) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http ffi (1.16.3) file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-core (2.3.0) + fog-core (2.4.0) builder excon (~> 0.71) formatador (>= 0.2, < 2.0) @@ -409,9 +410,9 @@ GEM graphql (~> 1.12) html-pipeline (~> 2.9) sass (~> 3.4) - hashdiff (1.0.1) + hashdiff (1.1.0) hashie (5.0.0) - highline (2.1.0) + highline (3.0.1) hkdf (0.3.0) html-pipeline (2.14.3) activesupport (>= 2) @@ -430,7 +431,7 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.10.0) + icalendar (2.10.1) ice_cube (~> 0.16) ice_cube (0.16.4) ice_nine (0.11.2) @@ -439,7 +440,7 @@ GEM ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) - json (2.6.3) + json (2.7.1) jwt (2.7.1) kaminari (1.2.2) activesupport (>= 4.1.0) @@ -486,12 +487,12 @@ GEM mixlib-config (>= 2.2.1, < 4) mixlib-shellout method_source (1.0.0) - mime-types (3.5.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.1003) + mime-types-data (3.2023.1205) mini_magick (4.12.0) mini_mime (1.1.5) - minitest (5.20.0) + minitest (5.21.2) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb @@ -500,16 +501,18 @@ GEM msgpack (1.7.2) multi_xml (0.6.0) mustache (1.1.1) - net-imap (0.4.7) + net-http (0.4.1) + uri + net-imap (0.4.9.1) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.4.0.1) net-protocol - nio4r (2.6.1) + nio4r (2.7.0) nokogiri (1.14.5-x86_64-linux) racc (~> 1.4) oauth (1.1.0) @@ -525,7 +528,7 @@ GEM rack (>= 1.2, < 4) snaky_hash (~> 2.0) version_gem (~> 1.1) - omniauth (2.1.1) + omniauth (2.1.2) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection @@ -552,17 +555,17 @@ GEM paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.23.0) + parallel (1.24.0) parallel_tests (3.13.0) parallel - parser (3.2.2.4) + parser (3.3.0.5) ast (~> 2.4.1) racc pg (1.1.4) pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) - premailer (1.21.0) + premailer (1.22.0) addressable css_parser (>= 1.12.0) htmlentities (>= 4.0.0) @@ -571,7 +574,7 @@ GEM net-smtp premailer (~> 1.7, >= 1.7.9) public_suffix (5.0.4) - puma (5.6.7) + puma (5.6.8) nio4r (~> 2.0) racc (1.7.3) rack (2.2.8) @@ -579,7 +582,8 @@ GEM rack (>= 1.0, < 4) rack-cors (1.1.1) rack (>= 2.0.0) - rack-protection (3.1.0) + rack-protection (3.2.0) + base64 (>= 0.1.0) rack (~> 2.2, >= 2.2.4) rack-proxy (0.7.7) rack @@ -630,7 +634,7 @@ GEM ffi (~> 1.0) redcarpet (3.6.0) redis (4.8.1) - regexp_parser (2.8.2) + regexp_parser (2.9.0) request_store (1.5.1) rack (>= 1.4) responders (3.1.1) @@ -644,9 +648,9 @@ GEM rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-cells (0.3.8) + rspec-cells (0.3.9) cells (>= 4.0.0, < 6.0.0) - rspec-rails (>= 3.0.0, < 6.1.0) + rspec-rails (>= 3.0.0, < 6.2.0) rspec-core (3.12.2) rspec-support (~> 3.12.0) rspec-expectations (3.12.3) @@ -697,7 +701,6 @@ GEM ruby-progressbar (1.13.0) ruby-vips (2.2.0) ffi (~> 1.12) - ruby2_keywords (0.0.5) rubyXL (3.4.25) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) @@ -754,6 +757,7 @@ GEM uglifier (4.2.0) execjs (>= 0.3.0, < 3) unicode-display_width (2.5.0) + uri (0.13.0) valid_email2 (2.3.1) activemodel (>= 3.2) mail (~> 2.5) diff --git a/spec/system/map_spec.rb b/spec/system/map_spec.rb index 79b64e0..22e1893 100644 --- a/spec/system/map_spec.rb +++ b/spec/system/map_spec.rb @@ -606,13 +606,13 @@ def drag_polygon end context "when polygon" do - it "adds polygons" do + it "adds polygon" do page.execute_script(revgeo) find('div[title="Draw Polygons"] a').click - find("[data-decidim-map]").click(x: 1, y: 2) - find("[data-decidim-map]").click(x: 6, y: 7) - find("[data-decidim-map]").click(x: 20, y: 21) - find("[data-decidim-map]").click(x: 1, y: 2) + find("[data-decidim-map]").click(x: 50, y: 45) + find("[data-decidim-map]").click(x: 30, y: 37) + find("[data-decidim-map]").click(x: 33, y: 21) + find("[data-decidim-map]").click(x: 50, y: 45) expect(page).to have_css(".leaflet-interactive") end end @@ -853,158 +853,158 @@ def drag_polygon end end end - end - context "when rendering more than one cell" do - let(:dummy) { create(:dummy_resource, body: "A reasonable body") } - let(:dummy_form) { Decidim::DummyResources::DummyResourceForm.from_model(dummy) } - let(:form) { Decidim::FormBuilder.new("dummy", dummy_form, template, {}) } - let(:cell) { template.cell("decidim/locations/locations", dummy, form: form, map_configuration: "single", coords: [12, 2], checkbox: false) } - let(:cell_two) { template.cell("decidim/locations/locations", dummy, form: form, map_configuration: "multiple", coords: [12, 2], checkbox: false) } - - let(:html_document) do - cell_html = cell.to_s - cell_two_html = cell_two.to_s - js = javascript - template.instance_eval do - <<~HTML.strip - - - - Map Test - #{stylesheet_pack_tag "decidim_core", media: "all"} - #{snippets.display(:head)} - - -
- Skip to main content -
- #{cell_html} - #{cell_two_html} - #{js} - #{snippets.display(:foot)} - - - HTML + context "when rendering more than one cell" do + let(:dummy) { create(:dummy_resource, body: "A reasonable body") } + let(:dummy_form) { Decidim::DummyResources::DummyResourceForm.from_model(dummy) } + let(:form) { Decidim::FormBuilder.new("dummy", dummy_form, template, {}) } + let(:cell) { template.cell("decidim/locations/locations", dummy, form: form, map_configuration: "single", coords: [12, 2], checkbox: false) } + let(:cell_two) { template.cell("decidim/locations/locations", dummy, form: form, map_configuration: "multiple", coords: [12, 2], checkbox: false) } + + let(:html_document) do + cell_html = cell.to_s + cell_two_html = cell_two.to_s + js = javascript + template.instance_eval do + <<~HTML.strip + + + + Map Test + #{stylesheet_pack_tag "decidim_core", media: "all"} + #{snippets.display(:head)} + + +
+ Skip to main content +
+ #{cell_html} + #{cell_two_html} + #{js} + #{snippets.display(:foot)} + + + HTML + end end - end - before do - utility = Decidim::Map.autocomplete(organization: organization) - allow(Decidim::Map).to receive(:autocomplete).with(organization: organization).and_return(utility) - allow(utility).to receive(:builder_options).and_return( - api_key: "key1234" - ) - allow(cell).to receive(:random_id).and_return("example") - allow(cell_two).to receive(:random_id).and_return("exampletwo") + before do + utility = Decidim::Map.autocomplete(organization: organization) + allow(Decidim::Map).to receive(:autocomplete).with(organization: organization).and_return(utility) + allow(utility).to receive(:builder_options).and_return( + api_key: "key1234" + ) + allow(cell).to receive(:random_id).and_return("example") + allow(cell_two).to receive(:random_id).and_return("exampletwo") - tile_content = File.read(Decidim::Dev.asset("icon.png")) - final_html = html_document + tile_content = File.read(Decidim::Dev.asset("icon.png")) + final_html = html_document - Rails.application.routes.draw do - # Map tiles - get "/tiles/:z/:x/:y", to: ->(_) { [200, {}, [tile_content]] } + Rails.application.routes.draw do + # Map tiles + get "/tiles/:z/:x/:y", to: ->(_) { [200, {}, [tile_content]] } - # The actual editor testing route for these specs - get "test_map", to: ->(_) { [200, {}, [final_html]] } - end + # The actual editor testing route for these specs + get "test_map", to: ->(_) { [200, {}, [final_html]] } + end - # Login needed for uploading the images - switch_to_host(organization.host) + # Login needed for uploading the images + switch_to_host(organization.host) - visit "/test_map" + visit "/test_map" - # Wait for the map to be rendered - expect(page).to have_css("[data-decidim-map] .leaflet-map-pane img") + # Wait for the map to be rendered + expect(page).to have_css("[data-decidim-map] .leaflet-map-pane img") - # Wait for all map tile images to be loaded - loop do - break if page.all("[data-decidim-map] .leaflet-map-pane img").all? { |img| img["complete"] == "true" } + # Wait for all map tile images to be loaded + loop do + break if page.all("[data-decidim-map] .leaflet-map-pane img").all? { |img| img["complete"] == "true" } - sleep 0.1 + sleep 0.1 + end end - end - after do - expect_no_js_errors + after do + expect_no_js_errors - # Reset the routes back to original - Rails.application.reload_routes! - end + # Reset the routes back to original + Rails.application.reload_routes! + end - it "renders multiple maps" do - expect(page).to have_css(".type-loc-field", count: 2) - expect(page).to have_selector("div[data-shape-field]", count: 2) - end + it "renders multiple maps" do + expect(page).to have_css(".type-loc-field", count: 2) + expect(page).to have_selector("div[data-shape-field]", count: 2) + end - context "when adding markers" do - it "adds markers correctly" do - page.execute_script(revgeo) + context "when adding markers" do + it "adds markers correctly" do + page.execute_script(revgeo) - within "#pick_model_locations_map-example" do - find('div[title="Draw Marker"] a').click - find("[data-decidim-map]").click - find("[data-decidim-map]").click(x: 20, y: 10) - end + within "#pick_model_locations_map-example" do + find('div[title="Draw Marker"] a').click + find("[data-decidim-map]").click(x: 15, y: 25) + find("[data-decidim-map]").click(x: 20, y: 10) + find("div.leaflet-pm-actions-container a.leaflet-pm-action.action-cancel").click - within "#pick_model_locations_map-exampletwo" do - find('div[title="Draw Marker"] a').click - find("[data-decidim-map]").click - find("[data-decidim-map]").click(x: 20, y: 10) - end + expect(page).to have_css(".leaflet-marker-icon", count: 1) + end - within "#pick_model_locations_map-example" do - expect(page).to have_css(".leaflet-pm-draggable", count: 1, visible: :all) - end + page.execute_script("window.scrollBy(0, 800)") + + within "#pick_model_locations_map-exampletwo" do + find('div[title="Draw Marker"] a').click + find("[data-decidim-map]").click(x: 15, y: 5) + find("[data-decidim-map]").click(x: 20, y: 10) + find("div.leaflet-pm-actions-container a.leaflet-pm-action.action-cancel").click - within "#pick_model_locations_map-exampletwo" do - expect(page).to have_css(".leaflet-pm-draggable", count: 2, visible: :all) + expect(page).to have_css("img.leaflet-marker-icon", count: 2) + end end end end - end - context "when cell has 'has location' -checkbox" do - let(:dummy) { create(:dummy_resource, body: "A reasonable body") } - let(:dummy_form) { Decidim::DummyResources::DummyResourceForm.from_model(dummy) } - let(:form) { Decidim::FormBuilder.new("dummy", dummy_form, template, {}) } - let(:map_configuration) { "multiple" } - let(:cell) { template.cell("decidim/locations/locations", dummy, form: form, map_configuration: map_configuration, coords: [12, 2], checkbox: true) } + context "when cell has 'has location' -checkbox" do + let(:dummy) { create(:dummy_resource, body: "A reasonable body") } + let(:dummy_form) { Decidim::DummyResources::DummyResourceForm.from_model(dummy) } + let(:form) { Decidim::FormBuilder.new("dummy", dummy_form, template, {}) } + let(:map_configuration) { "multiple" } + let(:cell) { template.cell("decidim/locations/locations", dummy, form: form, map_configuration: map_configuration, coords: [12, 2], checkbox: true) } - before do - tile_content = File.read(Decidim::Dev.asset("icon.png")) - final_html = html_document + before do + tile_content = File.read(Decidim::Dev.asset("icon.png")) + final_html = html_document - Rails.application.routes.draw do - # Map tiles - get "/tiles/:z/:x/:y", to: ->(_) { [200, {}, [tile_content]] } + Rails.application.routes.draw do + # Map tiles + get "/tiles/:z/:x/:y", to: ->(_) { [200, {}, [tile_content]] } - # The actual editor testing route for these specs - get "test_map", to: ->(_) { [200, {}, [final_html]] } - end + # The actual editor testing route for these specs + get "test_map", to: ->(_) { [200, {}, [final_html]] } + end - # Login needed for uploading the images - switch_to_host(organization.host) + # Login needed for uploading the images + switch_to_host(organization.host) - visit "/test_map" - end + visit "/test_map" + end - after do - expect_no_js_errors + after do + expect_no_js_errors - # Reset the routes back to original - Rails.application.reload_routes! - end + # Reset the routes back to original + Rails.application.reload_routes! + end - it "checks the box if text is clicked" do - expect(page).to have_content("Has location") - find('label[for="dummy_has_location"]').click - expect(page).to have_css("[data-decidim-map] .leaflet-map-pane img") + it "checks the box if text is clicked" do + expect(page).to have_content("Has location") + find('label[for="dummy_has_location"]').click + expect(page).to have_css("[data-decidim-map] .leaflet-map-pane img") - loop do - break if page.all("[data-decidim-map] .leaflet-map-pane img").all? { |img| img["complete"] == "true" } + loop do + break if page.all("[data-decidim-map] .leaflet-map-pane img").all? { |img| img["complete"] == "true" } - sleep 0.1 + sleep 0.1 + end end end end