11from typing import Any , Literal
2+ import asyncio
3+ import sys
4+ import pathlib
25
36import dlt
47import pytest
2023
2124from dlt .helpers .dashboard import strings as app_strings
2225
26+ # NOTE: The line below is needed for playwright to work on windows
27+ if sys .platform .startswith ("win" ):
28+ asyncio .set_event_loop_policy (asyncio .WindowsProactorEventLoopPolicy ())
29+
2330
2431@pytest .fixture ()
2532def simple_incremental_pipeline () -> Any :
@@ -90,6 +97,11 @@ def broken_resource():
9097#
9198
9299
100+ def _normpath (path : str ) -> str :
101+ """normalize path to unix style and lowercase for windows tests"""
102+ return str (pathlib .Path (path )) if sys .platform .startswith ("win" ) else path
103+
104+
93105def _go_home (page : Page ) -> None :
94106 page .goto ("http://localhost:2718" )
95107
@@ -141,7 +153,7 @@ def test_exception_pipeline(page: Page, failed_pipeline: Any):
141153
142154 # overview page
143155 _open_section (page , "overview" )
144- expect (page .get_by_text ("_storage/.dlt/pipelines/failed_pipeline" )).to_be_visible ()
156+ expect (page .get_by_text (_normpath ( "_storage/.dlt/pipelines/failed_pipeline" ) )).to_be_visible ()
145157 expect (
146158 page .get_by_text ("Exception encountered during last pipeline run in step" ).nth (0 )
147159 ).to_be_visible ()
@@ -166,8 +178,8 @@ def test_exception_pipeline(page: Page, failed_pipeline: Any):
166178 _open_section (page , "loads" )
167179 expect (page .get_by_text (app_strings .loads_loading_failed_text [0 :20 ])).to_be_visible ()
168180
169- _open_section (page , "ibis" )
170- expect (page .get_by_text (app_strings .ibis_backend_error_text [0 :20 ])).to_be_visible ()
181+ # _open_section(page, "ibis")
182+ # expect(page.get_by_text(app_strings.ibis_backend_error_text[0:20])).to_be_visible()
171183
172184
173185def test_multi_schema_selection (page : Page , multi_schema_pipeline : Any ):
@@ -211,7 +223,7 @@ def test_simple_incremental_pipeline(page: Page, simple_incremental_pipeline: An
211223
212224 # overview page
213225 _open_section (page , "overview" )
214- expect (page .get_by_text ("_storage/.dlt/pipelines/one_two_three" )).to_be_visible ()
226+ expect (page .get_by_text (_normpath ( "_storage/.dlt/pipelines/one_two_three" ) )).to_be_visible ()
215227
216228 # check schema info (this is the yaml part)
217229 _open_section (page , "schema" )
@@ -261,8 +273,8 @@ def test_simple_incremental_pipeline(page: Page, simple_incremental_pipeline: An
261273 ).to_be_visible () # this is in the loads table
262274
263275 # ibis page
264- _open_section (page , "ibis" )
265- expect (page .get_by_text (app_strings .ibis_backend_connected_text )).to_be_visible ()
276+ # _open_section(page, "ibis")
277+ # expect(page.get_by_text(app_strings.ibis_backend_connected_text)).to_be_visible()
266278
267279
268280def test_fruit_pipeline (page : Page , fruit_pipeline : Any ):
@@ -272,7 +284,7 @@ def test_fruit_pipeline(page: Page, fruit_pipeline: Any):
272284
273285 # overview page
274286 _open_section (page , "overview" )
275- expect (page .get_by_text ("_storage/.dlt/pipelines/fruit_pipeline" )).to_be_visible ()
287+ expect (page .get_by_text (_normpath ( "_storage/.dlt/pipelines/fruit_pipeline" ) )).to_be_visible ()
276288
277289 # check schema info (this is the yaml part)
278290 _open_section (page , "schema" )
@@ -301,15 +313,17 @@ def test_fruit_pipeline(page: Page, fruit_pipeline: Any):
301313 ).to_be_visible () # this is in the loads table
302314
303315 # ibis page
304- _open_section (page , "ibis" )
305- expect (page .get_by_text (app_strings .ibis_backend_connected_text )).to_be_visible ()
316+ # _open_section(page, "ibis")
317+ # expect(page.get_by_text(app_strings.ibis_backend_connected_text)).to_be_visible()
306318
307319
308320def test_never_run_pipeline (page : Page , never_run_pipeline : Any ):
309321 _go_home (page )
310322 page .get_by_role ("link" , name = "never_run_pipeline" ).click ()
311323
312- expect (page .get_by_text ("_storage/.dlt/pipelines/never_run_pipeline" )).to_be_visible ()
324+ expect (
325+ page .get_by_text (_normpath ("_storage/.dlt/pipelines/never_run_pipeline" ))
326+ ).to_be_visible ()
313327
314328 # check schema info (this is the yaml part)
315329 _open_section (page , "schema" )
@@ -330,16 +344,18 @@ def test_never_run_pipeline(page: Page, never_run_pipeline: Any):
330344 _open_section (page , "loads" )
331345 expect (page .get_by_text (app_strings .loads_loading_failed_text [0 :20 ])).to_be_visible ()
332346
333- _open_section (page , "ibis" )
334- expect (page .get_by_text (app_strings .ibis_backend_error_text [0 :20 ])).to_be_visible ()
347+ # _open_section(page, "ibis")
348+ # expect(page.get_by_text(app_strings.ibis_backend_error_text[0:20])).to_be_visible()
335349
336350
337351def test_no_destination_pipeline (page : Page , no_destination_pipeline : Any ):
338352 # check no destination pipeline
339353 _go_home (page )
340354 page .get_by_role ("link" , name = "no_destination_pipeline" ).click ()
341355
342- expect (page .get_by_text ("_storage/.dlt/pipelines/no_destination_pipeline" )).to_be_visible ()
356+ expect (
357+ page .get_by_text (_normpath ("_storage/.dlt/pipelines/no_destination_pipeline" ))
358+ ).to_be_visible ()
343359
344360 # check schema info (this is the yaml part)
345361 _open_section (page , "schema" )
@@ -365,5 +381,5 @@ def test_no_destination_pipeline(page: Page, no_destination_pipeline: Any):
365381 page .get_by_text ("execution_context" ).nth (0 )
366382 ).to_be_visible () # this is only shown in trace yaml
367383
368- _open_section (page , "ibis" )
369- expect (page .get_by_text (app_strings .ibis_backend_error_text [0 :20 ])).to_be_visible ()
384+ # _open_section(page, "ibis")
385+ # expect(page.get_by_text(app_strings.ibis_backend_error_text[0:20])).to_be_visible()
0 commit comments