33 skip_without_visualization_plugin ,
44)
55from .framework import (
6+ managed_history ,
67 selenium_test ,
78 SeleniumTestCase ,
89)
910
11+ IGV_DEFAULT_GENOME = "hg38"
12+ HG18_DBKEY_TEXT = "Human Mar. 2006 (NCBI36/hg18) (hg18)"
1013
11- class TestVisualizations (SeleniumTestCase ):
14+
15+ class TestVisualizationsAnonymous (SeleniumTestCase ):
1216
1317 @skip_without_datatype ("png" )
1418 @skip_without_visualization_plugin ("annotate_image" )
@@ -17,11 +21,10 @@ def test_charts_image_annotate(self):
1721 hid = 1
1822 self .perform_upload (self .get_filename ("454Score.png" ))
1923 self .history_panel_wait_for_hid_state (hid , state = "ok" )
20- self .show_dataset_visualizations (hid )
2124
22- self .components . visualization . matched_plugin ( id = "annotate_image" ). wait_for_visible ()
23- self . screenshot ( " visualization_plugins_png")
24- self . components . visualization . matched_plugin ( id = "annotate_image" ). wait_for_and_click ( )
25+ self .show_dataset_visualization (
26+ hid , visualization_id = "annotate_image" , screenshot_name = " visualization_plugins_png"
27+ )
2528
2629 with self .visualization_panel ():
2730 self .wait_for_selector ("#image-annotate" )
@@ -33,11 +36,9 @@ def test_charts_tabulator(self):
3336 hid = 1
3437 self .perform_upload (self .get_filename ("1.tabular" ))
3538 self .history_panel_wait_for_hid_state (hid , state = "ok" )
36- self .show_dataset_visualizations (hid )
37-
38- self .components .visualization .matched_plugin (id = "tabulator" ).wait_for_visible ()
39- self .screenshot ("visualization_plugins_tabulator" )
40- self .components .visualization .matched_plugin (id = "tabulator" ).wait_for_and_click ()
39+ self .show_dataset_visualization (
40+ hid , visualization_id = "tabulator" , screenshot_name = "visualization_plugins_tabulator"
41+ )
4142
4243 with self .visualization_panel ():
4344 self .wait_for_selector (".tabulator-table" )
@@ -49,13 +50,67 @@ def test_charts_h5web(self):
4950 hid = 1
5051 self .perform_upload (self .get_filename ("chopper.h5" ))
5152 self .history_panel_wait_for_hid_state (hid , state = "ok" )
52- self .show_dataset_visualizations (hid )
53-
54- self .components .visualization .matched_plugin (id = "h5web" ).wait_for_visible ()
55- self .screenshot ("visualization_plugins_h5" )
56- self .components .visualization .matched_plugin (id = "h5web" ).wait_for_and_click ()
53+ self .show_dataset_visualization (hid , visualization_id = "h5web" , screenshot_name = "visualization_plugins_h5" )
5754
5855 with self .visualization_panel ():
5956 # Look for the h5web-explorer-tree identifier to verify it loads.
6057 self .wait_for_selector ("#h5web-explorer-tree" )
6158 self .screenshot ("visualization_plugin_charts_h5web_landing" )
59+
60+
61+ class TestVisualizations (SeleniumTestCase ):
62+ ensure_registered = True
63+
64+ @selenium_test
65+ @managed_history
66+ @skip_without_visualization_plugin ("igv" )
67+ def test_igv_loads_correct_genome (self ):
68+ hid = 1
69+ self .perform_upload (self .get_filename ("1.bed" ))
70+ self .history_panel_wait_for_hid_state (hid , state = "ok" )
71+ self .show_dataset_visualization (hid , visualization_id = "igv" , screenshot_name = "visualization_plugins_igv" )
72+
73+ with self .visualization_panel ():
74+ self ._wait_for_igv_container ()
75+ self .screenshot ("visualization_plugin_igv_landing_default_genome" )
76+ current_genome_text = self ._igv_current_genome ()
77+ assert IGV_DEFAULT_GENOME in current_genome_text
78+
79+ dataset_component = self .history_panel_ensure_showing_item_details (hid )
80+ dataset_component .dbkey .wait_for_and_click ()
81+ self .edit_dataset_dbkey (HG18_DBKEY_TEXT )
82+
83+ self .show_dataset_visualization (hid , visualization_id = "igv" )
84+
85+ with self .visualization_panel ():
86+ self ._wait_for_igv_container ()
87+ current_genome_text = self ._igv_current_genome ()
88+ self .screenshot ("visualization_plugin_igv_landing_genome_from_dbkey_apimel3" )
89+ assert "hg18" in current_genome_text
90+
91+ igv = self .components .igv
92+ igv .save_button .assert_absent_or_hidden ()
93+ igv .settings_button .wait_for_and_click ()
94+ self .sleep_for (self .wait_types .UX_TRANSITION )
95+ igv .name_input .wait_for_and_clear_aggressive_and_send_keys ("igv with hg18" )
96+ igv .save_button .wait_for_and_click ()
97+ self .sleep_for (self .wait_types .UX_TRANSITION )
98+
99+ self .navigate_to_saved_visualizations ()
100+
101+ def _igv_current_genome (self ):
102+ igv = self .components .igv
103+ element = igv .shadow_host .wait_for_present ()
104+ shadow_root = element .shadow_root
105+ igv_current_genome = self .navigation .igv .selectors .current_genome
106+ current_genome_element = shadow_root .find_element (* igv_current_genome .component_locator )
107+ return current_genome_element .text
108+
109+ def _wait_for_igv_container (self ):
110+ igv = self .components .igv
111+ self .sleep_for (self .wait_types .UX_TRANSITION )
112+ element = igv .shadow_host .wait_for_present ()
113+ shadow_root = element .shadow_root
114+
115+ igv_root_container = self .navigation .igv .selectors ._
116+ shadow_root .find_element (* igv_root_container .component_locator )
0 commit comments