umap-project 3.4.0b3__py3-none-any.whl → 3.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  3. umap/locale/br/LC_MESSAGES/django.po +71 -57
  4. umap/locale/da/LC_MESSAGES/django.mo +0 -0
  5. umap/locale/da/LC_MESSAGES/django.po +18 -14
  6. umap/locale/de/LC_MESSAGES/django.mo +0 -0
  7. umap/locale/de/LC_MESSAGES/django.po +20 -16
  8. umap/locale/en/LC_MESSAGES/django.po +18 -14
  9. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  10. umap/locale/es/LC_MESSAGES/django.po +20 -16
  11. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  12. umap/locale/fr/LC_MESSAGES/django.po +18 -14
  13. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  14. umap/locale/hu/LC_MESSAGES/django.po +20 -16
  15. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  16. umap/locale/pl/LC_MESSAGES/django.po +101 -95
  17. umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
  18. umap/locale/zh_TW/LC_MESSAGES/django.po +20 -16
  19. umap/management/commands/clean_tilelayer.py +0 -1
  20. umap/management/commands/search_maps.py +95 -0
  21. umap/settings/__init__.py +9 -1
  22. umap/settings/base.py +7 -6
  23. umap/static/umap/content.css +0 -3
  24. umap/static/umap/css/bar.css +9 -6
  25. umap/static/umap/css/form.css +25 -9
  26. umap/static/umap/css/icon.css +8 -0
  27. umap/static/umap/css/popup.css +1 -0
  28. umap/static/umap/img/16-white.svg +5 -2
  29. umap/static/umap/img/16.svg +1 -1
  30. umap/static/umap/img/source/16-white.svg +7 -4
  31. umap/static/umap/img/source/16.svg +1 -1
  32. umap/static/umap/js/components/copiable.js +47 -0
  33. umap/static/umap/js/modules/autocomplete.js +32 -67
  34. umap/static/umap/js/modules/browser.js +31 -14
  35. umap/static/umap/js/modules/data/features.js +34 -36
  36. umap/static/umap/js/modules/data/fields.js +199 -23
  37. umap/static/umap/js/modules/data/layer.js +85 -96
  38. umap/static/umap/js/modules/domutils.js +25 -1
  39. umap/static/umap/js/modules/filters.js +24 -50
  40. umap/static/umap/js/modules/form/builder.js +17 -16
  41. umap/static/umap/js/modules/form/fields.js +20 -20
  42. umap/static/umap/js/modules/formatter.js +9 -1
  43. umap/static/umap/js/modules/help.js +12 -13
  44. umap/static/umap/js/modules/importer.js +17 -26
  45. umap/static/umap/js/modules/importers/banfr.js +0 -1
  46. umap/static/umap/js/modules/importers/cadastrefr.js +19 -19
  47. umap/static/umap/js/modules/importers/communesfr.js +7 -8
  48. umap/static/umap/js/modules/importers/datasets.js +14 -14
  49. umap/static/umap/js/modules/importers/geodatamine.js +20 -22
  50. umap/static/umap/js/modules/importers/opendata.js +10 -0
  51. umap/static/umap/js/modules/importers/overpass.js +19 -18
  52. umap/static/umap/js/modules/managers.js +1 -1
  53. umap/static/umap/js/modules/permissions.js +15 -5
  54. umap/static/umap/js/modules/rendering/controls.js +203 -10
  55. umap/static/umap/js/modules/rendering/icon.js +5 -9
  56. umap/static/umap/js/modules/rendering/layers/base.js +1 -1
  57. umap/static/umap/js/modules/rendering/layers/classified.js +16 -11
  58. umap/static/umap/js/modules/rendering/layers/heat.js +1 -0
  59. umap/static/umap/js/modules/rendering/map.js +67 -57
  60. umap/static/umap/js/modules/rendering/popup.js +6 -3
  61. umap/static/umap/js/modules/rendering/template.js +40 -40
  62. umap/static/umap/js/modules/rendering/ui.js +1 -2
  63. umap/static/umap/js/modules/rules.js +34 -41
  64. umap/static/umap/js/modules/schema.js +0 -7
  65. umap/static/umap/js/modules/share.js +36 -69
  66. umap/static/umap/js/modules/slideshow.js +3 -3
  67. umap/static/umap/js/modules/tableeditor.js +0 -1
  68. umap/static/umap/js/modules/ui/bar.js +53 -33
  69. umap/static/umap/js/modules/ui/hash.js +36 -0
  70. umap/static/umap/js/modules/ui/loader.js +26 -0
  71. umap/static/umap/js/modules/ui/panel.js +33 -21
  72. umap/static/umap/js/modules/ui/tooltip.js +1 -1
  73. umap/static/umap/js/modules/umap.js +81 -80
  74. umap/static/umap/js/modules/utils.js +13 -3
  75. umap/static/umap/js/umap.controls.js +16 -179
  76. umap/static/umap/locale/am_ET.js +7 -8
  77. umap/static/umap/locale/am_ET.json +7 -8
  78. umap/static/umap/locale/ar.js +7 -8
  79. umap/static/umap/locale/ar.json +7 -8
  80. umap/static/umap/locale/ast.js +7 -8
  81. umap/static/umap/locale/ast.json +7 -8
  82. umap/static/umap/locale/bg.js +7 -8
  83. umap/static/umap/locale/bg.json +7 -8
  84. umap/static/umap/locale/br.js +44 -36
  85. umap/static/umap/locale/br.json +44 -36
  86. umap/static/umap/locale/ca.js +7 -8
  87. umap/static/umap/locale/ca.json +7 -8
  88. umap/static/umap/locale/cs_CZ.js +7 -8
  89. umap/static/umap/locale/cs_CZ.json +7 -8
  90. umap/static/umap/locale/da.js +8 -9
  91. umap/static/umap/locale/da.json +8 -9
  92. umap/static/umap/locale/de.js +62 -63
  93. umap/static/umap/locale/de.json +62 -63
  94. umap/static/umap/locale/el.js +7 -8
  95. umap/static/umap/locale/el.json +7 -8
  96. umap/static/umap/locale/en.js +7 -8
  97. umap/static/umap/locale/en.json +7 -8
  98. umap/static/umap/locale/en_US.json +7 -8
  99. umap/static/umap/locale/es.js +19 -20
  100. umap/static/umap/locale/es.json +19 -20
  101. umap/static/umap/locale/et.js +7 -8
  102. umap/static/umap/locale/et.json +7 -8
  103. umap/static/umap/locale/eu.js +23 -24
  104. umap/static/umap/locale/eu.json +23 -24
  105. umap/static/umap/locale/fa_IR.js +7 -8
  106. umap/static/umap/locale/fa_IR.json +7 -8
  107. umap/static/umap/locale/fi.js +7 -8
  108. umap/static/umap/locale/fi.json +7 -8
  109. umap/static/umap/locale/fr.js +11 -12
  110. umap/static/umap/locale/fr.json +11 -12
  111. umap/static/umap/locale/gl.js +147 -148
  112. umap/static/umap/locale/gl.json +147 -148
  113. umap/static/umap/locale/he.js +7 -8
  114. umap/static/umap/locale/he.json +7 -8
  115. umap/static/umap/locale/hr.js +7 -8
  116. umap/static/umap/locale/hr.json +7 -8
  117. umap/static/umap/locale/hu.js +8 -9
  118. umap/static/umap/locale/hu.json +8 -9
  119. umap/static/umap/locale/id.js +7 -8
  120. umap/static/umap/locale/id.json +7 -8
  121. umap/static/umap/locale/is.js +7 -8
  122. umap/static/umap/locale/is.json +7 -8
  123. umap/static/umap/locale/it.js +7 -8
  124. umap/static/umap/locale/it.json +7 -8
  125. umap/static/umap/locale/ja.js +7 -8
  126. umap/static/umap/locale/ja.json +7 -8
  127. umap/static/umap/locale/ko.js +7 -8
  128. umap/static/umap/locale/ko.json +7 -8
  129. umap/static/umap/locale/lt.js +7 -8
  130. umap/static/umap/locale/lt.json +7 -8
  131. umap/static/umap/locale/ms.js +7 -8
  132. umap/static/umap/locale/ms.json +7 -8
  133. umap/static/umap/locale/nl.js +7 -8
  134. umap/static/umap/locale/nl.json +7 -8
  135. umap/static/umap/locale/no.js +7 -8
  136. umap/static/umap/locale/no.json +7 -8
  137. umap/static/umap/locale/pl.js +53 -54
  138. umap/static/umap/locale/pl.json +53 -54
  139. umap/static/umap/locale/pl_PL.json +7 -8
  140. umap/static/umap/locale/pt.js +7 -8
  141. umap/static/umap/locale/pt.json +7 -8
  142. umap/static/umap/locale/pt_BR.js +7 -8
  143. umap/static/umap/locale/pt_BR.json +7 -8
  144. umap/static/umap/locale/pt_PT.js +7 -8
  145. umap/static/umap/locale/pt_PT.json +7 -8
  146. umap/static/umap/locale/ro.js +7 -8
  147. umap/static/umap/locale/ro.json +7 -8
  148. umap/static/umap/locale/ru.js +7 -8
  149. umap/static/umap/locale/ru.json +7 -8
  150. umap/static/umap/locale/sk_SK.js +7 -8
  151. umap/static/umap/locale/sk_SK.json +7 -8
  152. umap/static/umap/locale/sl.js +7 -8
  153. umap/static/umap/locale/sl.json +7 -8
  154. umap/static/umap/locale/sr.js +7 -8
  155. umap/static/umap/locale/sr.json +7 -8
  156. umap/static/umap/locale/sv.js +7 -8
  157. umap/static/umap/locale/sv.json +7 -8
  158. umap/static/umap/locale/th_TH.js +7 -8
  159. umap/static/umap/locale/th_TH.json +7 -8
  160. umap/static/umap/locale/tr.js +7 -8
  161. umap/static/umap/locale/tr.json +7 -8
  162. umap/static/umap/locale/uk_UA.js +7 -8
  163. umap/static/umap/locale/uk_UA.json +7 -8
  164. umap/static/umap/locale/vi.js +7 -8
  165. umap/static/umap/locale/vi.json +7 -8
  166. umap/static/umap/locale/vi_VN.json +7 -8
  167. umap/static/umap/locale/zh.js +7 -8
  168. umap/static/umap/locale/zh.json +7 -8
  169. umap/static/umap/locale/zh_CN.json +7 -8
  170. umap/static/umap/locale/zh_TW.Big5.json +7 -8
  171. umap/static/umap/locale/zh_TW.js +20 -21
  172. umap/static/umap/locale/zh_TW.json +20 -21
  173. umap/static/umap/map.css +6 -21
  174. umap/static/umap/unittests/utils.js +7 -7
  175. umap/static/umap/vendors/locatecontrol/L.Control.Locate.esm.js +942 -0
  176. umap/static/umap/vendors/photon/leaflet.photon.esm.js +472 -0
  177. umap/sync/app.py +4 -1
  178. umap/templates/umap/content_footer.html +1 -0
  179. umap/templates/umap/css.html +0 -4
  180. umap/templates/umap/js.html +1 -8
  181. umap/templates/umap/team_form.html +2 -1
  182. umap/tests/integration/conftest.py +3 -2
  183. umap/tests/integration/test_anonymous_owned_map.py +1 -1
  184. umap/tests/integration/test_conditional_rules.py +106 -51
  185. umap/tests/integration/test_draw_polygon.py +4 -0
  186. umap/tests/integration/test_draw_polyline.py +11 -0
  187. umap/tests/integration/test_edit_datalayer.py +1 -1
  188. umap/tests/integration/test_edit_map.py +2 -0
  189. umap/tests/integration/test_fields.py +19 -0
  190. umap/tests/integration/test_filters.py +24 -0
  191. umap/tests/integration/test_iframe.py +1 -1
  192. umap/tests/integration/test_import.py +26 -0
  193. umap/tests/integration/test_map.py +3 -3
  194. umap/tests/integration/test_optimistic_merge.py +7 -1
  195. umap/tests/integration/test_owned_map.py +2 -2
  196. umap/tests/integration/test_popup.py +31 -0
  197. umap/tests/integration/test_remote_data.py +5 -5
  198. umap/tests/integration/test_search.py +41 -0
  199. umap/tests/integration/test_share.py +2 -2
  200. umap/tests/integration/test_team.py +1 -1
  201. umap/tests/integration/test_websocket_sync.py +6 -1
  202. umap/tests/test_search_maps_command.py +44 -0
  203. umap/tests/test_utils.py +4 -1
  204. umap/utils.py +10 -3
  205. umap/views.py +17 -4
  206. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/METADATA +29 -23
  207. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/RECORD +210 -214
  208. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/WHEEL +1 -1
  209. umap/static/umap/js/umap.core.js +0 -93
  210. umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.css +0 -46
  211. umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.js +0 -240
  212. umap/static/umap/vendors/editinosm/edit-in-osm.png +0 -0
  213. umap/static/umap/vendors/hash/leaflet-hash.js +0 -162
  214. umap/static/umap/vendors/loading/Control.Loading.css +0 -26
  215. umap/static/umap/vendors/loading/Control.Loading.js +0 -351
  216. umap/static/umap/vendors/locatecontrol/L.Control.Locate.min.css +0 -1
  217. umap/static/umap/vendors/locatecontrol/L.Control.Locate.min.css.map +0 -1
  218. umap/static/umap/vendors/locatecontrol/L.Control.Locate.min.js +0 -4
  219. umap/static/umap/vendors/locatecontrol/L.Control.Locate.min.js.map +0 -1
  220. umap/static/umap/vendors/photon/leaflet.photon.js +0 -487
  221. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/entry_points.txt +0 -0
  222. {umap_project-3.4.0b3.dist-info → umap_project-3.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -8,13 +8,6 @@ from ..base import DataLayerFactory
8
8
  pytestmark = pytest.mark.django_db
9
9
 
10
10
 
11
- def getColors(elements):
12
- return [
13
- el.evaluate("e => window.getComputedStyle(e).backgroundColor")
14
- for el in elements.all()
15
- ]
16
-
17
-
18
11
  DATALAYER_DATA1 = {
19
12
  "type": "FeatureCollection",
20
13
  "features": [
@@ -96,6 +89,9 @@ DATALAYER_DATA2 = {
96
89
 
97
90
 
98
91
  def test_simple_equal_rule_at_load(live_server, page, map):
92
+ map.settings["properties"]["fields"] = [
93
+ {"key": "mytype", "type": "String"},
94
+ ]
99
95
  map.settings["properties"]["rules"] = [
100
96
  {"condition": "mytype=odd", "properties": {"color": "aliceblue"}}
101
97
  ]
@@ -103,13 +99,18 @@ def test_simple_equal_rule_at_load(live_server, page, map):
103
99
  DataLayerFactory(map=map, data=DATALAYER_DATA1)
104
100
  DataLayerFactory(map=map, data=DATALAYER_DATA2)
105
101
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
106
- markers = page.locator(".leaflet-marker-icon .icon-container")
102
+ markers = page.locator(".leaflet-marker-icon")
107
103
  expect(markers).to_have_count(5)
108
- colors = getColors(markers)
109
- assert colors.count("rgb(240, 248, 255)") == 3
104
+ markers = page.locator(
105
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
106
+ )
107
+ expect(markers).to_have_count(3)
110
108
 
111
109
 
112
- def test_simple_not_equal_rule_at_load(live_server, page, map):
110
+ def test_simple_not_equal_rule_at_load(live_server, page, map, wait_for_loaded):
111
+ map.settings["properties"]["fields"] = [
112
+ {"key": "mytype", "type": "String"},
113
+ ]
113
114
  map.settings["properties"]["rules"] = [
114
115
  {"condition": "mytype!=even", "properties": {"color": "aliceblue"}}
115
116
  ]
@@ -117,13 +118,19 @@ def test_simple_not_equal_rule_at_load(live_server, page, map):
117
118
  DataLayerFactory(map=map, data=DATALAYER_DATA1)
118
119
  DataLayerFactory(map=map, data=DATALAYER_DATA2)
119
120
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
120
- markers = page.locator(".leaflet-marker-icon .icon-container")
121
+ wait_for_loaded(page)
122
+ markers = page.locator(".leaflet-marker-icon")
121
123
  expect(markers).to_have_count(5)
122
- colors = getColors(markers)
123
- assert colors.count("rgb(240, 248, 255)") == 3
124
+ markers = page.locator(
125
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
126
+ )
127
+ expect(markers).to_have_count(3)
124
128
 
125
129
 
126
130
  def test_gt_rule_with_number_at_load(live_server, page, map):
131
+ map.settings["properties"]["fields"] = [
132
+ {"key": "mynumber", "type": "Number"},
133
+ ]
127
134
  map.settings["properties"]["rules"] = [
128
135
  {"condition": "mynumber>10", "properties": {"color": "aliceblue"}}
129
136
  ]
@@ -133,11 +140,16 @@ def test_gt_rule_with_number_at_load(live_server, page, map):
133
140
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
134
141
  markers = page.locator(".leaflet-marker-icon .icon-container")
135
142
  expect(markers).to_have_count(5)
136
- colors = getColors(markers)
137
- assert colors.count("rgb(240, 248, 255)") == 2
143
+ markers = page.locator(
144
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
145
+ )
146
+ expect(markers).to_have_count(2)
138
147
 
139
148
 
140
149
  def test_lt_rule_with_number_at_load(live_server, page, map):
150
+ map.settings["properties"]["fields"] = [
151
+ {"key": "mynumber", "type": "Number"},
152
+ ]
141
153
  map.settings["properties"]["rules"] = [
142
154
  {"condition": "mynumber<14", "properties": {"color": "aliceblue"}}
143
155
  ]
@@ -147,8 +159,10 @@ def test_lt_rule_with_number_at_load(live_server, page, map):
147
159
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
148
160
  markers = page.locator(".leaflet-marker-icon .icon-container")
149
161
  expect(markers).to_have_count(5)
150
- colors = getColors(markers)
151
- assert colors.count("rgb(240, 248, 255)") == 4
162
+ markers = page.locator(
163
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
164
+ )
165
+ expect(markers).to_have_count(4)
152
166
 
153
167
 
154
168
  def test_lt_rule_with_float_at_load(live_server, page, map):
@@ -161,8 +175,10 @@ def test_lt_rule_with_float_at_load(live_server, page, map):
161
175
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
162
176
  markers = page.locator(".leaflet-marker-icon .icon-container")
163
177
  expect(markers).to_have_count(5)
164
- colors = getColors(markers)
165
- assert colors.count("rgb(240, 248, 255)") == 4
178
+ markers = page.locator(
179
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
180
+ )
181
+ expect(markers).to_have_count(4)
166
182
 
167
183
 
168
184
  def test_equal_rule_with_boolean_at_load(live_server, page, map):
@@ -175,8 +191,10 @@ def test_equal_rule_with_boolean_at_load(live_server, page, map):
175
191
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
176
192
  markers = page.locator(".leaflet-marker-icon .icon-container")
177
193
  expect(markers).to_have_count(5)
178
- colors = getColors(markers)
179
- assert colors.count("rgb(240, 248, 255)") == 2
194
+ markers = page.locator(
195
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
196
+ )
197
+ expect(markers).to_have_count(2)
180
198
 
181
199
 
182
200
  def test_equal_rule_with_boolean_not_true_at_load(live_server, page, map):
@@ -189,8 +207,10 @@ def test_equal_rule_with_boolean_not_true_at_load(live_server, page, map):
189
207
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
190
208
  markers = page.locator(".leaflet-marker-icon .icon-container")
191
209
  expect(markers).to_have_count(5)
192
- colors = getColors(markers)
193
- assert colors.count("rgb(240, 248, 255)") == 3
210
+ markers = page.locator(
211
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
212
+ )
213
+ expect(markers).to_have_count(3)
194
214
 
195
215
 
196
216
  def test_equal_rule_with_boolean_false_at_load(live_server, page, map):
@@ -203,8 +223,10 @@ def test_equal_rule_with_boolean_false_at_load(live_server, page, map):
203
223
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
204
224
  markers = page.locator(".leaflet-marker-icon .icon-container")
205
225
  expect(markers).to_have_count(5)
206
- colors = getColors(markers)
207
- assert colors.count("rgb(240, 248, 255)") == 1
226
+ markers = page.locator(
227
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
228
+ )
229
+ expect(markers).to_have_count(1)
208
230
 
209
231
 
210
232
  def test_equal_rule_with_boolean_not_false_at_load(live_server, page, map):
@@ -217,8 +239,10 @@ def test_equal_rule_with_boolean_not_false_at_load(live_server, page, map):
217
239
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
218
240
  markers = page.locator(".leaflet-marker-icon .icon-container")
219
241
  expect(markers).to_have_count(5)
220
- colors = getColors(markers)
221
- assert colors.count("rgb(240, 248, 255)") == 4
242
+ markers = page.locator(
243
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
244
+ )
245
+ expect(markers).to_have_count(4)
222
246
 
223
247
 
224
248
  def test_empty_rule_at_load(live_server, page, map):
@@ -231,8 +255,10 @@ def test_empty_rule_at_load(live_server, page, map):
231
255
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
232
256
  markers = page.locator(".leaflet-marker-icon .icon-container")
233
257
  expect(markers).to_have_count(5)
234
- colors = getColors(markers)
235
- assert colors.count("rgb(240, 248, 255)") == 3
258
+ markers = page.locator(
259
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
260
+ )
261
+ expect(markers).to_have_count(3)
236
262
 
237
263
 
238
264
  def test_not_empty_rule_at_load(live_server, page, map):
@@ -245,8 +271,10 @@ def test_not_empty_rule_at_load(live_server, page, map):
245
271
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
246
272
  markers = page.locator(".leaflet-marker-icon .icon-container")
247
273
  expect(markers).to_have_count(5)
248
- colors = getColors(markers)
249
- assert colors.count("rgb(240, 248, 255)") == 2
274
+ markers = page.locator(
275
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
276
+ )
277
+ expect(markers).to_have_count(2)
250
278
 
251
279
 
252
280
  def test_can_create_new_rule(live_server, page, openmap):
@@ -263,11 +291,15 @@ def test_can_create_new_rule(live_server, page, openmap):
263
291
  page.locator("input[name=condition]").fill("mytype=odd")
264
292
  page.locator(".umap-field-color .define").first.click()
265
293
  page.get_by_title("AliceBlue").first.click()
266
- colors = getColors(markers)
267
- assert colors.count("rgb(240, 248, 255)") == 3
294
+ markers = page.locator(
295
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
296
+ )
297
+ expect(markers).to_have_count(3)
268
298
  page.locator(".edit-undo").click()
269
- colors = getColors(markers)
270
- assert colors.count("rgb(240, 248, 255)") == 0
299
+ markers = page.locator(
300
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
301
+ )
302
+ expect(markers).to_have_count(0)
271
303
 
272
304
 
273
305
  def test_can_deactivate_rule_from_list(live_server, page, openmap):
@@ -280,20 +312,36 @@ def test_can_deactivate_rule_from_list(live_server, page, openmap):
280
312
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}#6/48.948/1.670")
281
313
  markers = page.locator(".leaflet-marker-icon .icon-container")
282
314
  expect(markers).to_have_count(5)
283
- colors = getColors(markers)
284
- assert colors.count("rgb(240, 248, 255)") == 3
315
+ markers = page.locator(
316
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
317
+ )
318
+ expect(markers).to_have_count(3)
285
319
  page.get_by_role("button", name="Edit").click()
286
320
  page.get_by_role("button", name="Map advanced properties").click()
287
321
  page.get_by_text("Conditional style rules").click()
288
322
  page.get_by_role("button", name="Toggle rule").click()
289
- colors = getColors(markers)
290
- assert colors.count("rgb(240, 248, 255)") == 0
323
+ markers = page.locator(
324
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
325
+ )
326
+ expect(markers).to_have_count(0)
291
327
  page.get_by_role("button", name="Toggle rule").click()
292
- colors = getColors(markers)
293
- assert colors.count("rgb(240, 248, 255)") == 3
328
+ markers = page.locator(
329
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
330
+ )
331
+ expect(markers).to_have_count(3)
294
332
 
295
333
 
296
334
  def test_autocomplete_datalist(live_server, page, openmap):
335
+ openmap.settings["properties"]["fields"] = [
336
+ {"key": "myboolean", "type": "String"},
337
+ {"key": "mytype", "type": "String"},
338
+ {"key": "mynumber", "type": "String"},
339
+ {"key": "mydate", "type": "String"},
340
+ {"key": "name", "type": "String"},
341
+ {"key": "maybeempty", "type": "String"},
342
+ {"key": "onlyinone", "type": "String"},
343
+ ]
344
+ openmap.save()
297
345
  DataLayerFactory(map=openmap, data=DATALAYER_DATA1)
298
346
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit#6/48.948/1.670")
299
347
  page.get_by_role("button", name="Map advanced properties").click()
@@ -335,10 +383,12 @@ def test_can_combine_rules(live_server, page, map):
335
383
  drops = page.locator(".umap-drop-icon .icon-container")
336
384
  expect(markers).to_have_count(5)
337
385
  expect(drops).to_have_count(2)
338
- colors = getColors(markers)
339
- assert colors.count("rgb(240, 248, 255)") == 3
340
- colors = getColors(drops)
341
- assert colors.count("rgb(240, 248, 255)") == 2
386
+ markers = page.locator(
387
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
388
+ )
389
+ expect(markers).to_have_count(3)
390
+ drops = page.locator('.umap-drop-icon [style*="background-color: aliceblue"]')
391
+ expect(drops).to_have_count(2)
342
392
 
343
393
 
344
394
  def test_first_matching_rule_wins_on_given_property(live_server, page, map):
@@ -352,8 +402,10 @@ def test_first_matching_rule_wins_on_given_property(live_server, page, map):
352
402
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
353
403
  markers = page.locator(".leaflet-marker-icon .icon-container")
354
404
  expect(markers).to_have_count(5)
355
- colors = getColors(markers)
356
- assert colors.count("rgb(240, 248, 255)") == 3
405
+ markers = page.locator(
406
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
407
+ )
408
+ expect(markers).to_have_count(3)
357
409
 
358
410
 
359
411
  def test_rules_from_datalayer(live_server, page, map):
@@ -370,11 +422,14 @@ def test_rules_from_datalayer(live_server, page, map):
370
422
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
371
423
  markers = page.locator(".leaflet-marker-icon .icon-container")
372
424
  expect(markers).to_have_count(5)
373
- colors = getColors(markers)
374
425
  # Alice Blue should only affect layer 1
375
- assert colors.count("rgb(240, 248, 255)") == 1
426
+ markers = page.locator(
427
+ '.leaflet-marker-icon [style*="background-color: aliceblue"]'
428
+ )
429
+ expect(markers).to_have_count(1)
376
430
  # Dark Red as for map global rules
377
- assert colors.count("rgb(139, 0, 0)") == 2
431
+ markers = page.locator('.leaflet-marker-icon [style*="background-color: darkred"]')
432
+ expect(markers).to_have_count(2)
378
433
 
379
434
 
380
435
  def test_rules_in_caption(live_server, page, map):
@@ -176,6 +176,7 @@ def test_can_draw_hole(page, live_server, tilelayer):
176
176
  expect(polygons).to_have_count(1)
177
177
  expect(vertices).to_have_count(4)
178
178
 
179
+ page.wait_for_timeout(300) # Time for the panel animation to finish
179
180
  # First vertex of the hole will be created here
180
181
  map.click(position={"x": 180, "y": 120}, button="right")
181
182
  page.get_by_role("button", name="Start a hole here").click()
@@ -373,6 +374,7 @@ def test_can_clone_polygon(live_server, page, tilelayer, settings):
373
374
  map.click(position={"x": 100, "y": 100})
374
375
  # Click again to finish
375
376
  map.click(position={"x": 100, "y": 100})
377
+ page.wait_for_timeout(300) # Time for the panel animation to finish
376
378
  expect(polygons).to_have_count(1)
377
379
  polygons.first.click(button="right")
378
380
  page.get_by_role("button", name="Clone this feature").click()
@@ -399,6 +401,7 @@ def test_can_transform_polygon_to_line(live_server, page, tilelayer, settings):
399
401
  map.click(position={"x": 100, "y": 100})
400
402
  expect(polygons).to_have_count(1)
401
403
  expect(paths).to_have_count(1)
404
+ page.wait_for_timeout(300) # Time for the panel animation to finish
402
405
  polygons.first.click(button="right")
403
406
  page.get_by_role("button", name="Transform to lines").click()
404
407
  # No more polygons (will fill), but one path, it must be a line
@@ -471,6 +474,7 @@ def test_vertexmarker_not_shown_if_too_many(live_server, map, page, settings):
471
474
  settings.UMAP_ALLOW_ANONYMOUS = True
472
475
  page.goto(f"{live_server.url}/en/map/new/#15/48.4395/3.3189")
473
476
  page.get_by_title("Import data").click()
477
+ page.wait_for_timeout(300) # Time for the panel animation to finish
474
478
  page.locator(".umap-import textarea").fill(geojson)
475
479
  page.locator('select[name="format"]').select_option("geojson")
476
480
  page.get_by_role("button", name="Import data", exact=True).click()
@@ -261,6 +261,9 @@ def test_can_extract_shape(live_server, page, tilelayer):
261
261
  map.click(position={"x": 200, "y": 200})
262
262
  # Click again to finish
263
263
  map.click(position={"x": 200, "y": 200})
264
+ # Let the panel fully open, not to close the contextmenu (when
265
+ # refocus on panel input)
266
+ page.wait_for_timeout(300)
264
267
  expect(lines).to_have_count(1)
265
268
  lines.first.click(position={"x": 10, "y": 1}, button="right")
266
269
  extract_button.click()
@@ -279,6 +282,9 @@ def test_can_clone_polyline(live_server, page, tilelayer, settings):
279
282
  map.click(position={"x": 100, "y": 200})
280
283
  # Click again to finish
281
284
  map.click(position={"x": 100, "y": 200})
285
+ # Let the panel fully open, not to close the contextmenu (when
286
+ # refocus on panel input)
287
+ page.wait_for_timeout(300)
282
288
  expect(lines).to_have_count(1)
283
289
  lines.first.click(position={"x": 10, "y": 1}, button="right")
284
290
  page.get_by_role("button", name="Clone this feature").click()
@@ -304,6 +310,8 @@ def test_can_transform_polyline_to_polygon(live_server, page, tilelayer, setting
304
310
  map.click(position={"x": 100, "y": 200})
305
311
  # Click again to finish
306
312
  map.click(position={"x": 100, "y": 200})
313
+ page.wait_for_timeout(300) # Time for the panel animation to finish
314
+
307
315
  expect(paths).to_have_count(1)
308
316
  expect(polygons).to_have_count(0)
309
317
  paths.first.click(position={"x": 10, "y": 1}, button="right")
@@ -324,6 +332,9 @@ def test_can_delete_shape_using_toolbar(live_server, page, tilelayer, settings):
324
332
  map.click(position={"x": 100, "y": 100})
325
333
  map.click(position={"x": 100, "y": 200})
326
334
  map.click(position={"x": 100, "y": 200})
335
+ # Let the panel fully open, not to close the contextmenu (when
336
+ # refocus on panel input)
337
+ page.wait_for_timeout(300)
327
338
 
328
339
  # Now split the line
329
340
  map.click(position={"x": 100, "y": 100}, button="right")
@@ -15,7 +15,7 @@ def test_should_have_fieldset_for_layer_type_properties(page, live_server, tilel
15
15
  page.get_by_title("Manage layers").click()
16
16
 
17
17
  # Create a layer
18
- page.get_by_title("Add a layer").click()
18
+ page.get_by_role("button", name="Add a layer").click()
19
19
  page.locator("input[name=name]").fill("Layer 1")
20
20
 
21
21
  select = page.locator(".panel.on .umap-field-type select")
@@ -115,6 +115,7 @@ def test_limitbounds_impacts_ui(live_server, page, tilelayer):
115
115
  page.get_by_text("Limit bounds").click()
116
116
  default_zoom_url = f"{live_server.url}/en/map/new/#5/51.110/7.053"
117
117
  page.goto(default_zoom_url)
118
+ page.wait_for_timeout(300)
118
119
  page.get_by_role("button", name="Use current bounds").click()
119
120
 
120
121
  zoom_in = page.get_by_label("Zoom in")
@@ -198,6 +199,7 @@ def test_sortkey_impacts_datalayerindex(map, live_server, page):
198
199
  page.locator(".panel .umap-field-sortKey .blur-container button").click()
199
200
 
200
201
  # Features should be sorted by key (First, Second, Third)
202
+ page.locator(".umap-browser .datalayer-name").click()
201
203
  first_listed_feature = page.locator(".umap-browser .datalayer ul > li").nth(0)
202
204
  second_listed_feature = page.locator(".umap-browser .datalayer ul > li").nth(1)
203
205
  third_listed_feature = page.locator(".umap-browser .datalayer ul > li").nth(2)
@@ -520,3 +520,22 @@ def test_can_change_field_type_with_remote_data(live_server, page, openmap, tile
520
520
  expect(page.locator(".panel .umap-filter label")).to_contain_text(
521
521
  ["bababar", "feefee", "foofoo"]
522
522
  )
523
+
524
+
525
+ def test_boolean_field_should_display_a_switch_in_feature_form(
526
+ live_server, page, openmap, tilelayer
527
+ ):
528
+ openmap.settings["properties"]["fields"] = [
529
+ {"key": "mystring", "type": "String"},
530
+ {"key": "mynumber", "type": "Number"},
531
+ {"key": "mybool", "type": "Boolean"},
532
+ ]
533
+ openmap.save()
534
+ page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
535
+ page.get_by_role("button", name="Draw a marker (Ctrl+M)").click()
536
+ page.locator("#map").click()
537
+ panel = page.locator(".panel")
538
+ expect(panel.locator(".umap-field-mynumber input")).to_have_attribute(
539
+ "type", "number"
540
+ )
541
+ expect(panel.locator(".umap-field-mybool.with-switch")).to_be_visible()
@@ -219,6 +219,30 @@ def test_choice_with_empty_value(live_server, page, map):
219
219
  expect(markers).to_have_count(2)
220
220
 
221
221
 
222
+ def test_choice_with_numbers(live_server, page, map):
223
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
224
+ map.settings["properties"]["fields"] = [{"key": "mynumber", "type": "Number"}]
225
+ map.settings["properties"]["filters"] = [
226
+ {"fieldKey": "mynumber", "label": "My Number"}
227
+ ]
228
+ map.save()
229
+ data = copy.deepcopy(DATALAYER_DATA1)
230
+ data["features"][0]["properties"]["mynumber"] = ""
231
+ del data["features"][1]["properties"]["mynumber"]
232
+ DataLayerFactory(map=map, data=data)
233
+ DataLayerFactory(map=map, data=DATALAYER_DATA2)
234
+ page.goto(f"{live_server.url}{map.get_absolute_url()}#6/47.5/-1.5")
235
+ expect(page.get_by_text("<empty value>")).to_be_visible()
236
+ expect(page.get_by_text("14")).to_be_visible()
237
+ markers = page.locator(".leaflet-marker-icon")
238
+ expect(markers).to_have_count(4)
239
+ page.get_by_text("14", exact=True).click()
240
+ expect(markers).to_have_count(1)
241
+ page.get_by_text("14", exact=True).click() # Unselect this filter.
242
+ page.get_by_text("<empty value>", exact=True).click()
243
+ expect(markers).to_have_count(2)
244
+
245
+
222
246
  def test_number_with_zero_value(live_server, page, map):
223
247
  map.settings["properties"]["onLoadPanel"] = "datafilters"
224
248
  map.settings["properties"]["filters"] = [
@@ -6,7 +6,7 @@ def test_home_control_is_hidden(live_server, map, tilelayer, page):
6
6
  <html>
7
7
  <head></head>
8
8
  <body>
9
- <iframe width="100%" height="300px" frameborder="0" allowfullscreen allow="geolocation"
9
+ <iframe style="width: 100%; height: 300px; border: 0;" allowfullscreen allow="geolocation"
10
10
  src="{map.get_absolute_url()}?scaleControl=false&miniMap=false&scrollWheelZoom=false&zoomControl=true&editMode=disabled&moreControl=true&searchControl=null&tilelayersControl=null&embedControl=null&datalayersControl=true&onLoadPanel=caption&captionBar=false&captionMenus=true"></iframe>
11
11
  </body>
12
12
  </html>
@@ -13,6 +13,8 @@ from .helpers import save_and_get_json
13
13
 
14
14
  pytestmark = pytest.mark.django_db
15
15
 
16
+ PANEL_ANIMATION_TIME = 350
17
+
16
18
 
17
19
  def test_layers_list_is_updated(live_server, tilelayer, page):
18
20
  page.goto(f"{live_server.url}/map/new/")
@@ -75,6 +77,7 @@ def test_umap_import_from_textarea(live_server, tilelayer, page, settings):
75
77
  page.goto(f"{live_server.url}/map/new/")
76
78
  page.get_by_role("button", name="Open browser").click()
77
79
  page.get_by_title("Import data").click()
80
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
78
81
  textarea = page.locator(".umap-import textarea")
79
82
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.umap"
80
83
  textarea.fill(path.read_text())
@@ -108,6 +111,7 @@ def test_import_geojson_from_textarea(tilelayer, live_server, page):
108
111
  expect(paths).to_have_count(0)
109
112
  expect(layers).to_have_count(0)
110
113
  page.get_by_title("Import data").click()
114
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
111
115
  textarea = page.locator(".umap-import textarea")
112
116
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.json"
113
117
  textarea.fill(path.read_text())
@@ -131,6 +135,7 @@ def test_import_invalid_data(tilelayer, live_server, page):
131
135
  expect(paths).to_have_count(0)
132
136
  expect(layers).to_have_count(0)
133
137
  page.get_by_title("Import data").click()
138
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
134
139
  textarea = page.locator(".umap-import textarea")
135
140
  textarea.fill("invalid data")
136
141
  for format in ["geojson", "csv", "gpx", "kml", "georss", "osm", "umap"]:
@@ -149,6 +154,7 @@ def test_import_kml_from_textarea(tilelayer, live_server, page):
149
154
  expect(paths).to_have_count(0)
150
155
  expect(layers).to_have_count(0)
151
156
  page.get_by_title("Import data").click()
157
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
152
158
  textarea = page.locator(".umap-import textarea")
153
159
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.kml"
154
160
  textarea.fill(path.read_text())
@@ -171,6 +177,7 @@ def test_import_gpx_from_textarea(tilelayer, live_server, page, settings):
171
177
  expect(paths).to_have_count(0)
172
178
  expect(layers).to_have_count(0)
173
179
  page.get_by_title("Import data").click()
180
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
174
181
  textarea = page.locator(".umap-import textarea")
175
182
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.gpx"
176
183
  textarea.fill(path.read_text())
@@ -226,6 +233,7 @@ def test_import_osm_from_textarea(tilelayer, live_server, page):
226
233
  expect(markers).to_have_count(0)
227
234
  expect(layers).to_have_count(0)
228
235
  page.get_by_title("Import data").click()
236
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
229
237
  textarea = page.locator(".umap-import textarea")
230
238
  path = Path(__file__).parent.parent / "fixtures/test_upload_data_osm.json"
231
239
  textarea.fill(path.read_text())
@@ -244,6 +252,7 @@ def test_import_csv_from_textarea(tilelayer, live_server, page):
244
252
  expect(markers).to_have_count(0)
245
253
  expect(layers).to_have_count(0)
246
254
  page.get_by_title("Import data").click()
255
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
247
256
  textarea = page.locator(".umap-import textarea")
248
257
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
249
258
  textarea.fill(path.read_text())
@@ -263,6 +272,7 @@ def test_can_import_in_existing_datalayer(live_server, datalayer, page, openmap)
263
272
  expect(layers).to_have_count(1)
264
273
  page.get_by_role("button", name="Edit").click()
265
274
  page.get_by_title("Import data").click()
275
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
266
276
  textarea = page.locator(".umap-import textarea")
267
277
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
268
278
  textarea.fill(path.read_text())
@@ -284,6 +294,7 @@ def test_can_replace_datalayer_data(live_server, datalayer, page, openmap):
284
294
  expect(layers).to_have_count(1)
285
295
  page.get_by_role("button", name="Edit").click()
286
296
  page.get_by_title("Import data").click()
297
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
287
298
  textarea = page.locator(".umap-import textarea")
288
299
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
289
300
  textarea.fill(path.read_text())
@@ -305,6 +316,7 @@ def test_can_import_in_new_datalayer(live_server, datalayer, page, openmap):
305
316
  expect(layers).to_have_count(1)
306
317
  page.get_by_role("button", name="Edit").click()
307
318
  page.get_by_title("Import data").click()
319
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
308
320
  textarea = page.locator(".umap-import textarea")
309
321
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
310
322
  textarea.fill(path.read_text())
@@ -351,6 +363,7 @@ def test_should_remove_dot_in_property_names(live_server, page, settings, tilela
351
363
  }
352
364
  page.goto(f"{live_server.url}/map/new/")
353
365
  page.get_by_title("Import data").click()
366
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
354
367
  textarea = page.locator(".umap-import textarea")
355
368
  textarea.fill(json.dumps(data))
356
369
  page.locator('select[name="format"]').select_option("geojson")
@@ -410,6 +423,7 @@ def test_import_geometry_collection(live_server, page, tilelayer):
410
423
  expect(paths).to_have_count(0)
411
424
  expect(layers).to_have_count(0)
412
425
  page.get_by_title("Import data").click()
426
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
413
427
  textarea = page.locator(".umap-import textarea")
414
428
  textarea.fill(json.dumps(data))
415
429
  page.locator('select[name="format"]').select_option("geojson")
@@ -463,6 +477,7 @@ def test_import_geometry_collection_in_feature(live_server, page, tilelayer):
463
477
  expect(paths).to_have_count(0)
464
478
  expect(layers).to_have_count(0)
465
479
  page.get_by_title("Import data").click()
480
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
466
481
  textarea = page.locator(".umap-import textarea")
467
482
  textarea.fill(json.dumps(data))
468
483
  page.locator('select[name="format"]').select_option("geojson")
@@ -472,6 +487,7 @@ def test_import_geometry_collection_in_feature(live_server, page, tilelayer):
472
487
  expect(markers).to_have_count(1)
473
488
  expect(paths).to_have_count(2)
474
489
  # Geometries are treated as separate features.
490
+ page.get_by_text("Layer 1").click() # Open layer box in browser.
475
491
  expect(page.get_by_text("foobar")).to_have_count(3)
476
492
 
477
493
 
@@ -497,6 +513,7 @@ def test_import_multipolygon(live_server, page, tilelayer):
497
513
  expect(paths).to_have_count(0)
498
514
  expect(layers).to_have_count(0)
499
515
  page.get_by_title("Import data").click()
516
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
500
517
  textarea = page.locator(".umap-import textarea")
501
518
  textarea.fill(json.dumps(data))
502
519
  page.locator('select[name="format"]').select_option("geojson")
@@ -527,6 +544,7 @@ def test_import_multipolyline(live_server, page, tilelayer):
527
544
  expect(paths).to_have_count(0)
528
545
  expect(layers).to_have_count(0)
529
546
  page.get_by_title("Import data").click()
547
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
530
548
  textarea = page.locator(".umap-import textarea")
531
549
  textarea.fill(json.dumps(data))
532
550
  page.locator('select[name="format"]').select_option("geojson")
@@ -557,6 +575,7 @@ def test_import_false_multipoint(live_server, page, tilelayer):
557
575
  expect(markers).to_have_count(0)
558
576
  expect(layers).to_have_count(0)
559
577
  page.get_by_title("Import data").click()
578
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
560
579
  textarea = page.locator(".umap-import textarea")
561
580
  textarea.fill(json.dumps(data))
562
581
  page.locator('select[name="format"]').select_option("geojson")
@@ -621,6 +640,7 @@ def test_should_not_import_empty_coordinates(live_server, page, tilelayer):
621
640
  page.goto(f"{live_server.url}/map/new/")
622
641
  page.get_by_title("Open browser").click()
623
642
  page.get_by_title("Import data").click()
643
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
624
644
  textarea = page.locator(".umap-import textarea")
625
645
  textarea.fill(json.dumps(data))
626
646
  page.locator('select[name="format"]').select_option("geojson")
@@ -636,6 +656,7 @@ def test_import_csv_without_valid_latlon_headers(tilelayer, live_server, page):
636
656
  layers = page.locator(".umap-browser .datalayer")
637
657
  markers = page.locator(".leaflet-marker-icon")
638
658
  page.get_by_title("Import data").click()
659
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
639
660
  textarea = page.locator(".umap-import textarea")
640
661
  textarea.fill("a,b,c\n12.23,48.34,mypoint\n12.23,48.34,mypoint2")
641
662
  page.locator('select[name="format"]').select_option("csv")
@@ -653,6 +674,7 @@ def test_import_csv_with_commas_in_latlon(tilelayer, live_server, page, settings
653
674
  layers = page.locator(".umap-browser .datalayer")
654
675
  markers = page.locator(".leaflet-marker-icon")
655
676
  page.get_by_title("Import data").click()
677
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
656
678
  textarea = page.locator(".umap-import textarea")
657
679
  textarea.fill("lat;lon;foobar\n12,24;48,34;mypoint\n12,23;48,35;mypoint2")
658
680
  page.locator('select[name="format"]').select_option("csv")
@@ -687,6 +709,7 @@ def test_import_csv_with_wkt_geom(tilelayer, live_server, page, settings):
687
709
  markers = page.locator(".leaflet-marker-icon")
688
710
  paths = page.locator("path")
689
711
  page.get_by_title("Import data").click()
712
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
690
713
  textarea = page.locator(".umap-import textarea")
691
714
  textarea.fill(
692
715
  "Geom;foobar\nPOLYGON ((-64.8 32.3, -65.5 18.3, -80.3 25.2, -64.8 32.3));mypoly\nPOINT(48.35 12.23);mypoint"
@@ -740,6 +763,7 @@ def test_import_csv_with_geojson_geom(tilelayer, live_server, page, settings):
740
763
  markers = page.locator(".leaflet-marker-icon")
741
764
  paths = page.locator("path")
742
765
  page.get_by_title("Import data").click()
766
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
743
767
  textarea = page.locator(".umap-import textarea")
744
768
  textarea.fill(
745
769
  "geojson;foobar\n"
@@ -1034,6 +1058,7 @@ def test_import_osm_relation(tilelayer, live_server, page):
1034
1058
  expect(paths).to_have_count(0)
1035
1059
  expect(layers).to_have_count(0)
1036
1060
  page.get_by_title("Import data").click()
1061
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
1037
1062
  textarea = page.locator(".umap-import textarea")
1038
1063
  file_path = Path(__file__).parent.parent / "fixtures/test_import_osm_relation.json"
1039
1064
  textarea.fill(file_path.read_text())
@@ -1052,6 +1077,7 @@ def test_import_georss_from_textarea(tilelayer, live_server, page):
1052
1077
  expect(markers).to_have_count(0)
1053
1078
  expect(layers).to_have_count(0)
1054
1079
  page.get_by_title("Import data").click()
1080
+ page.wait_for_timeout(PANEL_ANIMATION_TIME)
1055
1081
  textarea = page.locator(".umap-import textarea")
1056
1082
  path = Path(__file__).parent.parent / "fixtures/test_upload_georss.xml"
1057
1083
  textarea.fill(path.read_text())