6 use SGN::Test::WWW::WebDriver;
7 use SGN::Test::Fixture;
8 use SGN::Test::solGSData;
10 my $d = SGN::Test::WWW::WebDriver->new();
11 my $f = SGN::Test::Fixture->new();
13 my $solgs_data = SGN::Test::solGSData->new({'fixture' => $f, 'accessions_list_subset' => 160, 'plots_list_subset' => 160});
14 my $cache_dir = $solgs_data->site_cluster_shared_dir();
16 my $plots_list = $solgs_data->load_plots_list();
17 my $plots_list_name = $plots_list->{list_name};
18 my $plots_list_id = 'list_' . $plots_list->{list_id};
20 my $trials_list = $solgs_data->load_trials_list();
21 my $trials_list_name = $trials_list->{list_name};
22 my $trials_list_id = 'list_' . $trials_list->{list_id};
24 my $trials_dt = $solgs_data->load_trials_dataset();
25 my $trials_dt_name = $trials_dt->{dataset_name};
26 my $trials_dt_id = 'dataset_' . $trials_dt->{dataset_id};
28 my $plots_dt = $solgs_data->load_plots_dataset();
29 my $plots_dt_name = $plots_dt->{dataset_name};
30 my $plots_dt_id = 'dataset_' . $plots_dt->{dataset_id};
36 $d->while_logged_in_as("submitter", sub {
39 $d->get_ok('/correlation/analysis', 'correlation home page');
42 $d->find_element_ok('//tr[@id="' . $plots_list_id .'"]//*[starts-with(@id, "run_correlation")]', 'xpath', 'run correlation')->click();
44 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot');
46 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
49 $d->driver->refresh();
52 $d->find_element_ok('//tr[@id="' . $trials_list_id .'"]//*[starts-with(@id, "run_correlation")]', 'xpath', 'run correlation')->click();
54 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot');
56 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
59 $d->driver->refresh();
62 $d->find_element_ok('//tr[@id="' . $plots_dt_id .'"]//*[starts-with(@id, "run_correlation")]', 'xpath', 'run correlation')->click();
64 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot');
66 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
69 $d->driver->refresh();
74 $d->find_element_ok('//tr[@id="' . $trials_dt_id .'"]//*[starts-with(@id, "run_correlation")]', 'xpath', 'run correlation')->click();
76 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot');
78 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
85 ########## trial detail page ##########
86 $d->get_ok('/breeders/trial/139', 'trial detail home page');
88 my $analysis_tools = $d->find_element('Analysis Tools', 'partial_link_text', 'toogle analysis tools');
89 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);", $analysis_tools);
91 $d->find_element_ok('Analysis Tools', 'partial_link_text', 'toogle analysis tools')->click();
93 $d->find_element_ok('Phenotypic correlation', 'partial_link_text', 'expand correlation')->click();
95 $d->find_element_ok('run_correlation', 'id', 'run correlation')->click();
97 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot -- trial detail page')->click();
99 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
104 ########## solGS ##########
105 $d->get('/solgs', 'solgs home page');
107 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('Kasese solgs trial');
109 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
111 $d->find_element_ok('Kasese', 'partial_link_text', 'create training pop')->click();
113 $d->find_element_ok('queue_job', 'id', 'submit job tr pop')->click();
115 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('Test Kasese Tr pop');
117 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
119 $d->find_element_ok('submit_job', 'id', 'submit')->click();
121 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
123 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('Kasese solgs trial');
125 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
127 $d->find_element_ok('Kasese', 'partial_link_text', 'create training pop')->click();
130 my $corr = $d->find_element('Phenotypic correlation', 'partial_link_text', 'scroll to correlation');
131 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-170);", $corr);
133 $d->find_element('ANOVA', 'partial_link_text', 'scroll to correlation')->click();
135 $d->find_element_ok('run_correlation', 'id', 'run correlation')->click();
137 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot');
139 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
142 $d->driver->refresh();
145 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
147 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
149 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
151 $d->find_element_ok('queue_job', 'id', 'no job queueing')->click();
153 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('Test DMCP-FRW modeling Kasese');
155 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
157 $d->find_element_ok('submit_job', 'id', 'submit')->click();
159 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
161 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
163 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
165 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
168 # # # ###############################################################
169 # $d->get_ok('solgs/traits/all/population/139/traits/1971973596/gp/1', 'models page');
171 # # ######################################################################
173 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('trial2 NaCRRI');
175 $d->find_element_ok('search_selection_pop', 'id', 'search for selection pop')->click();
177 $d->find_element_ok('//table[@id="selection_pops_table"]//*[contains(text(), "Predict")]', 'xpath', 'click training pop')->click();
179 $d->find_element_ok('queue_job', 'id', 'no job queueing')->click();
181 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('Test DMCP-FRW selection pred nacrri');
183 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
185 $d->find_element_ok('submit_job', 'id', 'submit')->click();
187 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
190 my $cor = $d->find_element('Genetic correlation', 'partial_link_text', 'scroll up');
191 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $cor);
193 $d->find_element_ok('corr_pops_select', 'id', 'select list sl pop')->click();
195 $d->find_element_ok('//select[@id="corr_pops_select"]/option[text()="Kasese solgs trial"]', 'xpath', 'select trial type tr pop')->click();
197 $d->find_element_ok('run_genetic_correlation', 'id', 'calc gen corr')->click();
199 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot')->click();
202 $d->driver->refresh();
204 my $cor = $d->find_element('Genetic correlation', 'partial_link_text', 'scroll up');
205 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $cor);
207 $d->find_element_ok('corr_pops_select', 'id', 'select list sl pop')->click();
209 $d->find_element_ok('//select[@id="corr_pops_select"]/option[text()="trial2 NaCRRI"]', 'xpath', 'select trial type tr pop')->click();
211 $d->find_element_ok('run_genetic_correlation', 'id', 'calc gen corr')->click();
213 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot')->click();
217 my $si = $d->find_element('Selection index', 'partial_link_text', 'scroll up');
218 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $si);
220 $d->find_element_ok('si_pops_select', 'id', 'select list sl pop')->click();
222 $d->find_element_ok('//select[@id="si_pops_select"]/option[contains(text(), "Kasese")]', 'xpath', 'select trial type tr pop')->click();
224 $d->find_element_ok('DMCP', 'id', 'rel wt 1st')->send_keys(3);
226 $d->find_element_ok('FRW', 'id', 'rel wt 2st')->send_keys(5);
228 $d->find_element_ok('calculate_si', 'id', 'calc selection index')->click();
230 my $si = $d->find_element('//div[@id="si_canvas"]//*[contains(text(), "Index Name")]', 'xpath', 'scroll up');
231 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $si);
233 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
241 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('Kasese solgs trial');
243 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
245 $d->find_element_ok('trial_search_box', 'id', 'population search form')->clear();
247 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('trial2 nacrri');
249 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
252 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
254 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
256 $d->find_element_ok('select_trials_btn', 'id', 'done selecting')->click();
258 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
260 $d->find_element_ok('queue_job', 'id', 'submit job tr pop')->click();
262 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('combined trials');
264 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
266 $d->find_element_ok('submit_job', 'id', 'submit')->click();
269 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
272 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('Kasese solgs trial');
274 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
276 $d->find_element_ok('trial_search_box', 'id', 'population search form')->clear();
278 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('trial2 nacrri');
280 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
283 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
285 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
287 $d->find_element_ok('select_trials_btn', 'id', 'done selecting')->click();
289 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
292 my $corr = $d->find_element('Phenotypic correlation', 'partial_link_text', 'scroll to correlation');
293 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-270);", $corr);
295 $d->find_element('Acronyms', 'partial_link_text', 'scroll to correlation')->click();
297 $d->find_element_ok('run_correlation', 'id', 'run correlation')->click();
299 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot');
301 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
304 $d->driver->refresh();
307 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
309 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
311 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
313 $d->find_element_ok('queue_job', 'id', 'no job queueing')->click();
315 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('Test DMCP-FRW modeling Kasese');
317 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
319 $d->find_element_ok('submit_job', 'id', 'submit')->click();
321 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
323 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
325 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
327 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
331 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('trial2 NaCRRI');
333 $d->find_element_ok('search_selection_pop', 'id', 'search for selection pop')->click();
335 $d->find_element_ok('//table[@id="selection_pops_table"]//*[contains(text(), "Predict")]', 'xpath', 'click training pop')->click();
337 $d->find_element_ok('queue_job', 'id', 'no job queueing')->click();
339 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('Test DMCP-FRW selection pred nacrri');
341 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
343 $d->find_element_ok('submit_job', 'id', 'submit')->click();
345 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
348 my $cor = $d->find_element('Genetic correlation', 'partial_link_text', 'scroll up');
349 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $cor);
351 $d->find_element_ok('corr_pops_select', 'id', 'select list sl pop')->click();
353 $d->find_element_ok('//select[@id="corr_pops_select"]/option[text()="Training population 2804608595"]', 'xpath', 'select trial type tr pop')->click();
355 $d->find_element_ok('run_genetic_correlation', 'id', 'calc gen corr')->click();
357 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot');
360 $d->driver->refresh();
363 my $cor = $d->find_element('Genetic correlation', 'partial_link_text', 'scroll up');
364 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $cor);
366 $d->find_element_ok('corr_pops_select', 'id', 'select list sl pop')->click();
368 $d->find_element_ok('//select[@id="corr_pops_select"]/option[text()="trial2 NaCRRI"]', 'xpath', 'select trial type tr pop')->click();
370 $d->find_element_ok('run_genetic_correlation', 'id', 'calc gen corr')->click();
372 $d->find_element_ok('//div[@id="corr_canvas"]//*[contains(text(), "DMCP")]', 'xpath', 'check corr plot');
375 my $si = $d->find_element('Selection index', 'partial_link_text', 'scroll up');
376 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $si);
378 $d->find_element_ok('si_pops_select', 'id', 'select list sl pop')->click();
380 $d->find_element_ok('//select[@id="si_pops_select"]/option[contains(text(), "Training population")]', 'xpath', 'select trial type tr pop')->click();
382 $d->find_element_ok('DMCP', 'id', 'rel wt 1st')->send_keys(3);
384 $d->find_element_ok('FRW', 'id', 'rel wt 2st')->send_keys(5);
386 $d->find_element_ok('calculate_si', 'id', 'calc selection index')->click();
388 my $si = $d->find_element('//div[@id="si_canvas"]//*[contains(text(), "Index Name")]', 'xpath', 'scroll up');
390 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $si);
392 $d->find_element_ok('coefficients', 'partial_link_text', 'download corr coef table');
396 foreach my $list_id ($trials_list_id, $plots_list_id) {
397 $list_id =~ s/\w+_//g;
398 $solgs_data->delete_list($list_id);
401 foreach my $dataset_id ($trials_dt_id, $plots_dt_id) {
402 $dataset_id =~ s/\w+_//g;
403 $solgs_data->delete_dataset($dataset_id);