umap-project 3.4.0b1__py3-none-any.whl → 3.4.2__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.
- umap/__init__.py +1 -1
- umap/context_processors.py +1 -1
- umap/locale/da/LC_MESSAGES/django.mo +0 -0
- umap/locale/da/LC_MESSAGES/django.po +20 -16
- umap/locale/en/LC_MESSAGES/django.po +18 -14
- umap/locale/es/LC_MESSAGES/django.mo +0 -0
- umap/locale/es/LC_MESSAGES/django.po +20 -16
- umap/locale/fr/LC_MESSAGES/django.mo +0 -0
- umap/locale/fr/LC_MESSAGES/django.po +18 -14
- umap/locale/pl/LC_MESSAGES/django.mo +0 -0
- umap/locale/pl/LC_MESSAGES/django.po +72 -71
- umap/migrations/0018_datalayer_uuid.py +1 -1
- umap/models.py +7 -3
- umap/settings/local.py.sample +1 -1
- umap/static/umap/content.css +0 -3
- umap/static/umap/css/bar.css +9 -6
- umap/static/umap/css/form.css +27 -11
- umap/static/umap/css/popup.css +1 -0
- umap/static/umap/js/components/base.js +1 -1
- umap/static/umap/js/components/copiable.js +47 -0
- umap/static/umap/js/modules/autocomplete.js +31 -58
- umap/static/umap/js/modules/browser.js +8 -8
- umap/static/umap/js/modules/data/features.js +33 -36
- umap/static/umap/js/modules/data/fields.js +446 -0
- umap/static/umap/js/modules/data/layer.js +76 -93
- umap/static/umap/js/modules/domutils.js +24 -4
- umap/static/umap/js/modules/filters.js +20 -47
- umap/static/umap/js/modules/form/fields.js +4 -4
- umap/static/umap/js/modules/formatter.js +9 -1
- umap/static/umap/js/modules/help.js +13 -14
- umap/static/umap/js/modules/i18n.js +1 -1
- umap/static/umap/js/modules/importer.js +18 -27
- umap/static/umap/js/modules/importers/banfr.js +0 -1
- umap/static/umap/js/modules/importers/cadastrefr.js +19 -19
- umap/static/umap/js/modules/importers/communesfr.js +7 -8
- umap/static/umap/js/modules/importers/datasets.js +14 -14
- umap/static/umap/js/modules/importers/geodatamine.js +20 -22
- umap/static/umap/js/modules/importers/opendata.js +10 -0
- umap/static/umap/js/modules/importers/overpass.js +19 -18
- umap/static/umap/js/modules/managers.js +1 -265
- umap/static/umap/js/modules/permissions.js +5 -3
- umap/static/umap/js/modules/rendering/controls.js +6 -4
- umap/static/umap/js/modules/rendering/icon.js +5 -9
- umap/static/umap/js/modules/rendering/layers/base.js +1 -1
- umap/static/umap/js/modules/rendering/layers/classified.js +16 -11
- umap/static/umap/js/modules/rendering/layers/heat.js +27 -21
- umap/static/umap/js/modules/rendering/map.js +22 -22
- umap/static/umap/js/modules/rendering/popup.js +6 -3
- umap/static/umap/js/modules/rendering/template.js +31 -37
- umap/static/umap/js/modules/rendering/ui.js +1 -2
- umap/static/umap/js/modules/rules.js +34 -41
- umap/static/umap/js/modules/schema.js +0 -7
- umap/static/umap/js/modules/share.js +36 -69
- umap/static/umap/js/modules/slideshow.js +3 -3
- umap/static/umap/js/modules/tableeditor.js +0 -1
- umap/static/umap/js/modules/ui/bar.js +51 -32
- umap/static/umap/js/modules/ui/dialog.js +10 -1
- umap/static/umap/js/modules/ui/panel.js +28 -23
- umap/static/umap/js/modules/ui/tooltip.js +1 -1
- umap/static/umap/js/modules/umap.js +84 -84
- umap/static/umap/js/modules/utils.js +13 -4
- umap/static/umap/js/umap.controls.js +33 -14
- umap/static/umap/locale/am_ET.js +19 -8
- umap/static/umap/locale/am_ET.json +19 -8
- umap/static/umap/locale/ar.js +19 -8
- umap/static/umap/locale/ar.json +19 -8
- umap/static/umap/locale/ast.js +19 -8
- umap/static/umap/locale/ast.json +19 -8
- umap/static/umap/locale/bg.js +19 -8
- umap/static/umap/locale/bg.json +19 -8
- umap/static/umap/locale/br.js +20 -9
- umap/static/umap/locale/br.json +20 -9
- umap/static/umap/locale/ca.js +19 -8
- umap/static/umap/locale/ca.json +19 -8
- umap/static/umap/locale/cs_CZ.js +20 -9
- umap/static/umap/locale/cs_CZ.json +20 -9
- umap/static/umap/locale/da.js +54 -43
- umap/static/umap/locale/da.json +54 -43
- umap/static/umap/locale/de.js +44 -33
- umap/static/umap/locale/de.json +44 -33
- umap/static/umap/locale/el.js +20 -9
- umap/static/umap/locale/el.json +20 -9
- umap/static/umap/locale/en.js +20 -9
- umap/static/umap/locale/en.json +20 -9
- umap/static/umap/locale/en_US.json +19 -8
- umap/static/umap/locale/es.js +55 -44
- umap/static/umap/locale/es.json +55 -44
- umap/static/umap/locale/et.js +20 -9
- umap/static/umap/locale/et.json +20 -9
- umap/static/umap/locale/eu.js +25 -14
- umap/static/umap/locale/eu.json +25 -14
- umap/static/umap/locale/fa_IR.js +20 -9
- umap/static/umap/locale/fa_IR.json +20 -9
- umap/static/umap/locale/fi.js +19 -8
- umap/static/umap/locale/fi.json +19 -8
- umap/static/umap/locale/fr.js +21 -10
- umap/static/umap/locale/fr.json +21 -10
- umap/static/umap/locale/gl.js +147 -136
- umap/static/umap/locale/gl.json +147 -136
- umap/static/umap/locale/he.js +19 -8
- umap/static/umap/locale/he.json +19 -8
- umap/static/umap/locale/hr.js +19 -8
- umap/static/umap/locale/hr.json +19 -8
- umap/static/umap/locale/hu.js +62 -51
- umap/static/umap/locale/hu.json +62 -51
- umap/static/umap/locale/id.js +19 -8
- umap/static/umap/locale/id.json +19 -8
- umap/static/umap/locale/is.js +20 -9
- umap/static/umap/locale/is.json +20 -9
- umap/static/umap/locale/it.js +20 -9
- umap/static/umap/locale/it.json +20 -9
- umap/static/umap/locale/ja.js +19 -8
- umap/static/umap/locale/ja.json +19 -8
- umap/static/umap/locale/ko.js +19 -8
- umap/static/umap/locale/ko.json +19 -8
- umap/static/umap/locale/lt.js +19 -8
- umap/static/umap/locale/lt.json +19 -8
- umap/static/umap/locale/ms.js +20 -9
- umap/static/umap/locale/ms.json +20 -9
- umap/static/umap/locale/nl.js +20 -9
- umap/static/umap/locale/nl.json +20 -9
- umap/static/umap/locale/no.js +19 -8
- umap/static/umap/locale/no.json +19 -8
- umap/static/umap/locale/pl.js +56 -45
- umap/static/umap/locale/pl.json +56 -45
- umap/static/umap/locale/pl_PL.json +19 -8
- umap/static/umap/locale/pt.js +20 -9
- umap/static/umap/locale/pt.json +20 -9
- umap/static/umap/locale/pt_BR.js +19 -8
- umap/static/umap/locale/pt_BR.json +19 -8
- umap/static/umap/locale/pt_PT.js +19 -8
- umap/static/umap/locale/pt_PT.json +19 -8
- umap/static/umap/locale/ro.js +19 -8
- umap/static/umap/locale/ro.json +19 -8
- umap/static/umap/locale/ru.js +19 -8
- umap/static/umap/locale/ru.json +19 -8
- umap/static/umap/locale/si.js +1 -1
- umap/static/umap/locale/si.json +1 -1
- umap/static/umap/locale/sk_SK.js +19 -8
- umap/static/umap/locale/sk_SK.json +19 -8
- umap/static/umap/locale/sl.js +19 -8
- umap/static/umap/locale/sl.json +19 -8
- umap/static/umap/locale/sr.js +19 -8
- umap/static/umap/locale/sr.json +19 -8
- umap/static/umap/locale/sv.js +19 -8
- umap/static/umap/locale/sv.json +19 -8
- umap/static/umap/locale/th_TH.js +19 -8
- umap/static/umap/locale/th_TH.json +19 -8
- umap/static/umap/locale/tr.js +19 -8
- umap/static/umap/locale/tr.json +19 -8
- umap/static/umap/locale/uk_UA.js +19 -8
- umap/static/umap/locale/uk_UA.json +19 -8
- umap/static/umap/locale/vi.js +19 -8
- umap/static/umap/locale/vi.json +19 -8
- umap/static/umap/locale/vi_VN.json +19 -8
- umap/static/umap/locale/zh.js +19 -8
- umap/static/umap/locale/zh.json +19 -8
- umap/static/umap/locale/zh_CN.json +19 -8
- umap/static/umap/locale/zh_TW.Big5.json +19 -8
- umap/static/umap/locale/zh_TW.js +53 -42
- umap/static/umap/locale/zh_TW.json +53 -42
- umap/static/umap/map.css +8 -7
- umap/static/umap/unittests/utils.js +7 -7
- umap/templates/umap/content_footer.html +1 -0
- umap/templates/umap/css.html +0 -2
- umap/templates/umap/js.html +1 -3
- umap/templates/umap/login_popup_end.html +2 -2
- umap/tests/integration/conftest.py +11 -2
- umap/tests/integration/test_anonymous_owned_map.py +2 -2
- umap/tests/integration/test_conditional_rules.py +107 -52
- umap/tests/integration/test_draw_polygon.py +4 -0
- umap/tests/integration/test_draw_polyline.py +11 -0
- umap/tests/integration/test_edit_datalayer.py +1 -1
- umap/tests/integration/test_fields.py +19 -0
- umap/tests/integration/test_filters.py +6 -7
- umap/tests/integration/test_iframe.py +1 -1
- umap/tests/integration/test_import.py +23 -0
- umap/tests/integration/test_map.py +2 -2
- umap/tests/integration/test_map_preview.py +1 -1
- umap/tests/integration/test_owned_map.py +2 -2
- umap/tests/integration/test_picto.py +1 -1
- umap/tests/integration/test_popup.py +31 -0
- umap/tests/integration/test_remote_data.py +4 -4
- umap/tests/integration/test_save.py +1 -1
- umap/tests/integration/test_search.py +41 -0
- umap/tests/integration/test_share.py +2 -2
- umap/tests/integration/test_team.py +1 -1
- umap/tests/integration/test_websocket_sync.py +69 -20
- umap/tests/test_dashboard.py +1 -1
- umap/tests/test_statics.py +2 -2
- umap/tests/test_utils.py +4 -1
- umap/tests/test_views.py +1 -1
- umap/utils.py +3 -2
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/METADATA +17 -17
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/RECORD +198 -199
- umap/static/umap/js/umap.core.js +0 -93
- umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.css +0 -46
- umap/static/umap/vendors/editinosm/Leaflet.EditInOSM.js +0 -240
- umap/static/umap/vendors/editinosm/edit-in-osm.png +0 -0
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/WHEEL +0 -0
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.dist-info}/entry_points.txt +0 -0
- {umap_project-3.4.0b1.dist-info → umap_project-3.4.2.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
|
|
102
|
+
markers = page.locator(".leaflet-marker-icon")
|
|
107
103
|
expect(markers).to_have_count(5)
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
121
|
+
wait_for_loaded(page)
|
|
122
|
+
markers = page.locator(".leaflet-marker-icon")
|
|
121
123
|
expect(markers).to_have_count(5)
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
137
|
-
|
|
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
|
-
|
|
151
|
-
|
|
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
|
-
|
|
165
|
-
|
|
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
|
-
|
|
179
|
-
|
|
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
|
-
|
|
193
|
-
|
|
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
|
-
|
|
207
|
-
|
|
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
|
-
|
|
221
|
-
|
|
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
|
-
|
|
235
|
-
|
|
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
|
-
|
|
249
|
-
|
|
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,14 +291,18 @@ 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
|
-
|
|
267
|
-
|
|
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
|
-
|
|
270
|
-
|
|
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
|
-
def
|
|
305
|
+
def test_can_deactivate_rule_from_list(live_server, page, openmap):
|
|
274
306
|
openmap.settings["properties"]["rules"] = [
|
|
275
307
|
{"condition": "mytype=odd", "properties": {"color": "aliceblue"}}
|
|
276
308
|
]
|
|
@@ -280,20 +312,36 @@ def test_can_deactive_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
|
-
|
|
284
|
-
|
|
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
|
-
|
|
290
|
-
|
|
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
|
-
|
|
293
|
-
|
|
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
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
|
|
356
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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")
|
|
@@ -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()
|
|
@@ -434,8 +434,10 @@ def test_can_create_filter_from_new_field(live_server, page, openmap):
|
|
|
434
434
|
page.get_by_role("heading", name="Manage Fields").click()
|
|
435
435
|
page.get_by_role("button", name="Add a new field").click()
|
|
436
436
|
page.get_by_role("textbox", name="Field Name ✔").fill("foobar")
|
|
437
|
+
page.get_by_label("Field Type").select_option("Boolean")
|
|
437
438
|
page.get_by_role("button", name="Add filter for this field").click()
|
|
438
439
|
page.get_by_role("textbox", name="Human readable name of the").fill("Foo Bar")
|
|
440
|
+
expect(page.get_by_text("Yes/No")).to_be_checked()
|
|
439
441
|
page.wait_for_timeout(300) # Input throttling.
|
|
440
442
|
page.get_by_text("Edit this field").click()
|
|
441
443
|
expect(page.locator(".umap-filter span").filter(has_text="Foo Bar")).to_be_visible()
|
|
@@ -461,7 +463,7 @@ def test_can_create_filter_from_new_field(live_server, page, openmap):
|
|
|
461
463
|
},
|
|
462
464
|
{
|
|
463
465
|
"key": "foobar",
|
|
464
|
-
"type": "
|
|
466
|
+
"type": "Boolean",
|
|
465
467
|
},
|
|
466
468
|
]
|
|
467
469
|
|
|
@@ -469,7 +471,7 @@ def test_can_create_filter_from_new_field(live_server, page, openmap):
|
|
|
469
471
|
{
|
|
470
472
|
"fieldKey": "foobar",
|
|
471
473
|
"label": "Foo Bar",
|
|
472
|
-
"widget": "
|
|
474
|
+
"widget": "Switch",
|
|
473
475
|
},
|
|
474
476
|
]
|
|
475
477
|
|
|
@@ -485,8 +487,7 @@ def test_can_create_new_filter_on_map_from_panel(live_server, page, openmap):
|
|
|
485
487
|
DataLayerFactory(map=openmap, data=DATALAYER_DATA1)
|
|
486
488
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
|
|
487
489
|
page.get_by_role("button", name="Manage filters").click()
|
|
488
|
-
page.
|
|
489
|
-
page.get_by_role("button", name="Add filter").click()
|
|
490
|
+
page.get_by_role("button", name="Add filter").first.click()
|
|
490
491
|
page.get_by_label("Filter on").select_option("foobar")
|
|
491
492
|
page.get_by_role("textbox", name="Human readable name").fill("Foo Bar")
|
|
492
493
|
page.wait_for_timeout(300)
|
|
@@ -515,8 +516,7 @@ def test_can_create_new_filter_on_datalayer_from_panel(live_server, page, openma
|
|
|
515
516
|
f"{live_server.url}{openmap.get_absolute_url()}?edit&onLoadPanel=datafilters"
|
|
516
517
|
)
|
|
517
518
|
page.get_by_role("button", name="Manage filters").click()
|
|
518
|
-
page.
|
|
519
|
-
page.get_by_role("button", name="Add filter").click()
|
|
519
|
+
page.get_by_role("button", name="Add filter").nth(1).click()
|
|
520
520
|
expect(page.get_by_label("Apply filter to")).to_have_value(f"layer:{datalayer.pk}")
|
|
521
521
|
page.get_by_label("Filter on").select_option("mynumber")
|
|
522
522
|
page.get_by_role("textbox", name="Human readable name of the").fill("Foo Bar")
|
|
@@ -598,7 +598,6 @@ def test_filter_with_enum(live_server, openmap, page):
|
|
|
598
598
|
f"{live_server.url}{openmap.get_absolute_url()}?edit&onLoadPanel=datafilters#6/48.948/1.670"
|
|
599
599
|
)
|
|
600
600
|
page.get_by_role("button", name="Manage filters").click()
|
|
601
|
-
page.get_by_text("Calque 1 (single layer)").click()
|
|
602
601
|
page.get_by_role("button", name="Add filter").click()
|
|
603
602
|
page.get_by_label("Filter on").select_option("products")
|
|
604
603
|
page.get_by_role("button", name="OK").click()
|
|
@@ -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
|
|
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>
|
|
@@ -75,6 +75,7 @@ def test_umap_import_from_textarea(live_server, tilelayer, page, settings):
|
|
|
75
75
|
page.goto(f"{live_server.url}/map/new/")
|
|
76
76
|
page.get_by_role("button", name="Open browser").click()
|
|
77
77
|
page.get_by_title("Import data").click()
|
|
78
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
78
79
|
textarea = page.locator(".umap-import textarea")
|
|
79
80
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data.umap"
|
|
80
81
|
textarea.fill(path.read_text())
|
|
@@ -108,6 +109,7 @@ def test_import_geojson_from_textarea(tilelayer, live_server, page):
|
|
|
108
109
|
expect(paths).to_have_count(0)
|
|
109
110
|
expect(layers).to_have_count(0)
|
|
110
111
|
page.get_by_title("Import data").click()
|
|
112
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
111
113
|
textarea = page.locator(".umap-import textarea")
|
|
112
114
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data.json"
|
|
113
115
|
textarea.fill(path.read_text())
|
|
@@ -131,6 +133,7 @@ def test_import_invalid_data(tilelayer, live_server, page):
|
|
|
131
133
|
expect(paths).to_have_count(0)
|
|
132
134
|
expect(layers).to_have_count(0)
|
|
133
135
|
page.get_by_title("Import data").click()
|
|
136
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
134
137
|
textarea = page.locator(".umap-import textarea")
|
|
135
138
|
textarea.fill("invalid data")
|
|
136
139
|
for format in ["geojson", "csv", "gpx", "kml", "georss", "osm", "umap"]:
|
|
@@ -149,6 +152,7 @@ def test_import_kml_from_textarea(tilelayer, live_server, page):
|
|
|
149
152
|
expect(paths).to_have_count(0)
|
|
150
153
|
expect(layers).to_have_count(0)
|
|
151
154
|
page.get_by_title("Import data").click()
|
|
155
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
152
156
|
textarea = page.locator(".umap-import textarea")
|
|
153
157
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data.kml"
|
|
154
158
|
textarea.fill(path.read_text())
|
|
@@ -171,6 +175,7 @@ def test_import_gpx_from_textarea(tilelayer, live_server, page, settings):
|
|
|
171
175
|
expect(paths).to_have_count(0)
|
|
172
176
|
expect(layers).to_have_count(0)
|
|
173
177
|
page.get_by_title("Import data").click()
|
|
178
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
174
179
|
textarea = page.locator(".umap-import textarea")
|
|
175
180
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data.gpx"
|
|
176
181
|
textarea.fill(path.read_text())
|
|
@@ -226,6 +231,7 @@ def test_import_osm_from_textarea(tilelayer, live_server, page):
|
|
|
226
231
|
expect(markers).to_have_count(0)
|
|
227
232
|
expect(layers).to_have_count(0)
|
|
228
233
|
page.get_by_title("Import data").click()
|
|
234
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
229
235
|
textarea = page.locator(".umap-import textarea")
|
|
230
236
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data_osm.json"
|
|
231
237
|
textarea.fill(path.read_text())
|
|
@@ -244,6 +250,7 @@ def test_import_csv_from_textarea(tilelayer, live_server, page):
|
|
|
244
250
|
expect(markers).to_have_count(0)
|
|
245
251
|
expect(layers).to_have_count(0)
|
|
246
252
|
page.get_by_title("Import data").click()
|
|
253
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
247
254
|
textarea = page.locator(".umap-import textarea")
|
|
248
255
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
|
|
249
256
|
textarea.fill(path.read_text())
|
|
@@ -263,6 +270,7 @@ def test_can_import_in_existing_datalayer(live_server, datalayer, page, openmap)
|
|
|
263
270
|
expect(layers).to_have_count(1)
|
|
264
271
|
page.get_by_role("button", name="Edit").click()
|
|
265
272
|
page.get_by_title("Import data").click()
|
|
273
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
266
274
|
textarea = page.locator(".umap-import textarea")
|
|
267
275
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
|
|
268
276
|
textarea.fill(path.read_text())
|
|
@@ -284,6 +292,7 @@ def test_can_replace_datalayer_data(live_server, datalayer, page, openmap):
|
|
|
284
292
|
expect(layers).to_have_count(1)
|
|
285
293
|
page.get_by_role("button", name="Edit").click()
|
|
286
294
|
page.get_by_title("Import data").click()
|
|
295
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
287
296
|
textarea = page.locator(".umap-import textarea")
|
|
288
297
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
|
|
289
298
|
textarea.fill(path.read_text())
|
|
@@ -305,6 +314,7 @@ def test_can_import_in_new_datalayer(live_server, datalayer, page, openmap):
|
|
|
305
314
|
expect(layers).to_have_count(1)
|
|
306
315
|
page.get_by_role("button", name="Edit").click()
|
|
307
316
|
page.get_by_title("Import data").click()
|
|
317
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
308
318
|
textarea = page.locator(".umap-import textarea")
|
|
309
319
|
path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
|
|
310
320
|
textarea.fill(path.read_text())
|
|
@@ -351,6 +361,7 @@ def test_should_remove_dot_in_property_names(live_server, page, settings, tilela
|
|
|
351
361
|
}
|
|
352
362
|
page.goto(f"{live_server.url}/map/new/")
|
|
353
363
|
page.get_by_title("Import data").click()
|
|
364
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
354
365
|
textarea = page.locator(".umap-import textarea")
|
|
355
366
|
textarea.fill(json.dumps(data))
|
|
356
367
|
page.locator('select[name="format"]').select_option("geojson")
|
|
@@ -410,6 +421,7 @@ def test_import_geometry_collection(live_server, page, tilelayer):
|
|
|
410
421
|
expect(paths).to_have_count(0)
|
|
411
422
|
expect(layers).to_have_count(0)
|
|
412
423
|
page.get_by_title("Import data").click()
|
|
424
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
413
425
|
textarea = page.locator(".umap-import textarea")
|
|
414
426
|
textarea.fill(json.dumps(data))
|
|
415
427
|
page.locator('select[name="format"]').select_option("geojson")
|
|
@@ -463,6 +475,7 @@ def test_import_geometry_collection_in_feature(live_server, page, tilelayer):
|
|
|
463
475
|
expect(paths).to_have_count(0)
|
|
464
476
|
expect(layers).to_have_count(0)
|
|
465
477
|
page.get_by_title("Import data").click()
|
|
478
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
466
479
|
textarea = page.locator(".umap-import textarea")
|
|
467
480
|
textarea.fill(json.dumps(data))
|
|
468
481
|
page.locator('select[name="format"]').select_option("geojson")
|
|
@@ -497,6 +510,7 @@ def test_import_multipolygon(live_server, page, tilelayer):
|
|
|
497
510
|
expect(paths).to_have_count(0)
|
|
498
511
|
expect(layers).to_have_count(0)
|
|
499
512
|
page.get_by_title("Import data").click()
|
|
513
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
500
514
|
textarea = page.locator(".umap-import textarea")
|
|
501
515
|
textarea.fill(json.dumps(data))
|
|
502
516
|
page.locator('select[name="format"]').select_option("geojson")
|
|
@@ -527,6 +541,7 @@ def test_import_multipolyline(live_server, page, tilelayer):
|
|
|
527
541
|
expect(paths).to_have_count(0)
|
|
528
542
|
expect(layers).to_have_count(0)
|
|
529
543
|
page.get_by_title("Import data").click()
|
|
544
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
530
545
|
textarea = page.locator(".umap-import textarea")
|
|
531
546
|
textarea.fill(json.dumps(data))
|
|
532
547
|
page.locator('select[name="format"]').select_option("geojson")
|
|
@@ -557,6 +572,7 @@ def test_import_false_multipoint(live_server, page, tilelayer):
|
|
|
557
572
|
expect(markers).to_have_count(0)
|
|
558
573
|
expect(layers).to_have_count(0)
|
|
559
574
|
page.get_by_title("Import data").click()
|
|
575
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
560
576
|
textarea = page.locator(".umap-import textarea")
|
|
561
577
|
textarea.fill(json.dumps(data))
|
|
562
578
|
page.locator('select[name="format"]').select_option("geojson")
|
|
@@ -621,6 +637,7 @@ def test_should_not_import_empty_coordinates(live_server, page, tilelayer):
|
|
|
621
637
|
page.goto(f"{live_server.url}/map/new/")
|
|
622
638
|
page.get_by_title("Open browser").click()
|
|
623
639
|
page.get_by_title("Import data").click()
|
|
640
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
624
641
|
textarea = page.locator(".umap-import textarea")
|
|
625
642
|
textarea.fill(json.dumps(data))
|
|
626
643
|
page.locator('select[name="format"]').select_option("geojson")
|
|
@@ -636,6 +653,7 @@ def test_import_csv_without_valid_latlon_headers(tilelayer, live_server, page):
|
|
|
636
653
|
layers = page.locator(".umap-browser .datalayer")
|
|
637
654
|
markers = page.locator(".leaflet-marker-icon")
|
|
638
655
|
page.get_by_title("Import data").click()
|
|
656
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
639
657
|
textarea = page.locator(".umap-import textarea")
|
|
640
658
|
textarea.fill("a,b,c\n12.23,48.34,mypoint\n12.23,48.34,mypoint2")
|
|
641
659
|
page.locator('select[name="format"]').select_option("csv")
|
|
@@ -653,6 +671,7 @@ def test_import_csv_with_commas_in_latlon(tilelayer, live_server, page, settings
|
|
|
653
671
|
layers = page.locator(".umap-browser .datalayer")
|
|
654
672
|
markers = page.locator(".leaflet-marker-icon")
|
|
655
673
|
page.get_by_title("Import data").click()
|
|
674
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
656
675
|
textarea = page.locator(".umap-import textarea")
|
|
657
676
|
textarea.fill("lat;lon;foobar\n12,24;48,34;mypoint\n12,23;48,35;mypoint2")
|
|
658
677
|
page.locator('select[name="format"]').select_option("csv")
|
|
@@ -687,6 +706,7 @@ def test_import_csv_with_wkt_geom(tilelayer, live_server, page, settings):
|
|
|
687
706
|
markers = page.locator(".leaflet-marker-icon")
|
|
688
707
|
paths = page.locator("path")
|
|
689
708
|
page.get_by_title("Import data").click()
|
|
709
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
690
710
|
textarea = page.locator(".umap-import textarea")
|
|
691
711
|
textarea.fill(
|
|
692
712
|
"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 +760,7 @@ def test_import_csv_with_geojson_geom(tilelayer, live_server, page, settings):
|
|
|
740
760
|
markers = page.locator(".leaflet-marker-icon")
|
|
741
761
|
paths = page.locator("path")
|
|
742
762
|
page.get_by_title("Import data").click()
|
|
763
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
743
764
|
textarea = page.locator(".umap-import textarea")
|
|
744
765
|
textarea.fill(
|
|
745
766
|
"geojson;foobar\n"
|
|
@@ -1034,6 +1055,7 @@ def test_import_osm_relation(tilelayer, live_server, page):
|
|
|
1034
1055
|
expect(paths).to_have_count(0)
|
|
1035
1056
|
expect(layers).to_have_count(0)
|
|
1036
1057
|
page.get_by_title("Import data").click()
|
|
1058
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
1037
1059
|
textarea = page.locator(".umap-import textarea")
|
|
1038
1060
|
file_path = Path(__file__).parent.parent / "fixtures/test_import_osm_relation.json"
|
|
1039
1061
|
textarea.fill(file_path.read_text())
|
|
@@ -1052,6 +1074,7 @@ def test_import_georss_from_textarea(tilelayer, live_server, page):
|
|
|
1052
1074
|
expect(markers).to_have_count(0)
|
|
1053
1075
|
expect(layers).to_have_count(0)
|
|
1054
1076
|
page.get_by_title("Import data").click()
|
|
1077
|
+
page.wait_for_timeout(300) # Time for the panel animation to finish
|
|
1055
1078
|
textarea = page.locator(".umap-import textarea")
|
|
1056
1079
|
path = Path(__file__).parent.parent / "fixtures/test_upload_georss.xml"
|
|
1057
1080
|
textarea.fill(path.read_text())
|