7 use SGN::Test::WWW::WebDriver;
8 use SGN::Test::Fixture;
9 use SGN::Test::solGSData;
11 my $d = SGN::Test::WWW::WebDriver->new();
12 my $f = SGN::Test::Fixture->new();
14 my $solgs_data = SGN::Test::solGSData->new({'fixture' => $f, 'accessions_list_subset' => 60, 'plots_list_subset' => 60});
15 my $cache_dir = $solgs_data->site_cluster_shared_dir();
17 my $accessions_list = $solgs_data->load_accessions_list();
18 my $accessions_list_name = $accessions_list->{list_name};
19 my $accessions_list_id = 'list_' . $accessions_list->{list_id};
21 my $plots_list = $solgs_data->load_plots_list();
22 my $plots_list_name = $plots_list->{list_name};
23 my $plots_list_id = 'list_' . $plots_list->{list_id};
25 my $trials_list = $solgs_data->load_trials_list();
26 my $trials_list_name = $trials_list->{list_name};
27 my $trials_list_id = 'list_' . $trials_list->{list_id};
29 my $trials_dt = $solgs_data->load_trials_dataset();
30 my $trials_dt_name = $trials_dt->{dataset_name};
31 my $trials_dt_id = 'dataset_' . $trials_dt->{dataset_id};
33 my $accessions_dt = $solgs_data->load_accessions_dataset();
34 my $accessions_dt_name = $accessions_dt->{dataset_name};
35 my $accessions_dt_id = 'dataset_' . $accessions_dt->{dataset_id};
37 my $plots_dt = $solgs_data->load_plots_dataset();
38 my $plots_dt_name = $plots_dt->{dataset_name};
39 my $plots_dt_id = 'dataset_' . $plots_dt->{dataset_id};
41 print STDERR "\ntrials dt: $trials_dt_name -- $trials_dt_id\n";
42 print STDERR "\naccessions dt: $accessions_dt_name -- $accessions_dt_id\n";
43 print STDERR "\nplots dt: $plots_dt_name -- $plots_dt_id\n";
45 print STDERR "\ntrials list: $trials_list_name -- $trials_list_id\n";
46 print STDERR "\naccessions list: $accessions_list_name -- $accessions_list_id\n";
47 print STDERR "\nplots list: $plots_list_name -- $plots_list_id\n";
53 $d->while_logged_in_as("submitter", sub {
54 $d->get_ok('/solgs', 'solgs home page');
56 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('Kasese solgs trial');
58 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
60 $d->find_element_ok('population_search_entry', 'id', 'population search form')->clear();
62 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('trial2 nacrri');
64 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
67 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
69 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
71 $d->find_element_ok('select_trials_btn', 'id', 'done selecting')->click();
73 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
75 $d->find_element_ok('queue_job', 'id', 'submit job tr pop')->click();
77 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('combined trials');
79 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
81 $d->find_element_ok('submit_job', 'id', 'submit')->click();
83 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
87 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('Kasese solgs trial');
89 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
91 $d->find_element_ok('population_search_entry', 'id', 'population search form')->clear();
93 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('trial2 nacrri');
95 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
98 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
100 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
102 $d->find_element_ok('select_trials_btn', 'id', 'done selecting')->click();
104 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
107 # $d->get('/solgs/populations/combined/2804608595/gp/1', 'combo trials tr pop page');
110 $d->find_element_ok('Genotype data', 'partial_link_text', 'download training pop genotype data');
112 $d->find_element_ok('Phenotype data', 'partial_link_text', 'download training pop phenotype data');
115 $d->find_element_ok('dry matter', 'partial_link_text', 'build model')->click();
117 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
119 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('Test DMCP model combo');
121 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
123 $d->find_element_ok('submit_job', 'id', 'submit')->click();
125 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
127 $d->find_element_ok('dry matter', 'partial_link_text', 'build model')->click();
130 ### combined trials training population: single trait prediction of trial type selection population
132 #$d->get('/solgs/model/combined/populations/2804608595/trait/70741/gp/1', 'combo trials tr pop page');
135 my $sel_pred = $d->find_element('Model accuracy statistics', 'partial_link_text', 'scroll to accuracy');
136 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $sel_pred);
138 $d->find_element_ok('Download model accuracy', 'partial_link_text', 'download accuracy');
141 my $sel_pred = $d->find_element('GEBVs vs observed', 'partial_link_text', 'scroll to GEBvs');
142 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $sel_pred);
144 $d->find_element_ok('download_gebvs_histo_plot', 'id', 'download gebvs');
147 my $sel_pred = $d->find_element('GEBVs vs observed', 'partial_link_text', 'scroll to GEBvs');
148 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $sel_pred);
150 $d->find_element_ok('save_gebvs', 'id', 'store gebvs')->click();
152 $d->find_element_ok('View stored GEBVs', 'partial_link_text', 'view store gebvs')->click();
155 $d->driver->go_back();
158 my $sel_pred = $d->find_element('Marker effects', 'partial_link_text', 'scroll to marker effects');
159 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $sel_pred);
161 $d->find_element_ok('Marker effects', 'partial_link_text', 'expand marker effects')->click();
163 $d->find_element_ok('Download marker', 'partial_link_text', ' download marker effects');
166 my $download = $d->find_element('Download data', 'partial_link_text', 'download model data section');
167 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $download);
169 $d->find_element_ok('Genotype data', 'partial_link_text', 'download model genotype data');
171 $d->find_element_ok('Phenotype data', 'partial_link_text', 'download model phenotype data');
174 my $sel_pred = $d->find_element('Predict', 'partial_link_text', 'scroll to selection pred');
175 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $sel_pred);
176 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('trial2 NaCRRI');
178 $d->find_element_ok('search_selection_pop', 'id', 'search for selection pop')->click();
180 $d->find_element_ok('//table[@id="selection_pops_table"]//*[contains(text(), "Predict")]', 'xpath', 'click training pop')->click();
182 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
184 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('Test DMCP selection pred combo trials model');
186 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
188 $d->find_element_ok('submit_job', 'id', 'submit')->click();
190 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
193 my $sel_pred = $d->find_element('Predict', 'partial_link_text', 'scroll to selection pred');
194 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $sel_pred);
196 $d->find_element_ok('DMCP', 'partial_link_text', 'go back')->click();
199 my $sel_pred = $d->find_element('Expected genetic gain', 'partial_link_text', 'scroll to GEBvs');
200 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $sel_pred);
202 $d->find_element_ok('save_gebvs', 'id', 'store gebvs')->click();
204 $d->find_element_ok('View stored GEBVs', 'partial_link_text', 'view store gebvs')->click();
206 $d->driver->go_back();
208 $d->driver->go_back();
210 my $sel_pred = $d->find_element('Predict', 'partial_link_text', 'scroll to selection pred');
211 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $sel_pred);
214 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[contains(text(), "Predict")]', 'xpath', 'click list sel pred')->click();
216 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
218 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('clones list sel pred');
220 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
222 $d->find_element_ok('submit_job', 'id', 'submit')->click();
225 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
228 my $sel_pred = $d->find_element('Predict', 'partial_link_text', 'scroll to selection pred');
229 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $sel_pred);
232 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[contains(text(), "Predict")]', 'xpath', 'click list sel pred')->click();
234 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[contains(text(), "DMCP")]', 'xpath', 'click list sel pred')->click();
237 my $sel_pred = $d->find_element('Expected genetic gain', 'partial_link_text', 'scroll to GEBvs');
238 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $sel_pred);
240 $d->find_element_ok('save_gebvs', 'id', 'store gebvs')->click();
242 $d->find_element_ok('View stored GEBVs', 'partial_link_text', 'view store gebvs')->click();
245 $d->driver->go_back();
247 $d->driver->go_back();
250 my $sel_pred = $d->find_element('Predict', 'partial_link_text', 'scroll to selection pred');
251 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $sel_pred);
253 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[contains(text(), "Predict")]', 'xpath', 'dataset accession sel pred')->click();
255 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
257 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('dataset clones sel pred');
259 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
261 $d->find_element_ok('submit_job', 'id', 'submit')->click();
263 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
266 my $sel_pred = $d->find_element('Predict', 'partial_link_text', 'scroll to selection pred');
267 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $sel_pred);
269 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[contains(text(), "Predict")]', 'xpath', 'dataset accessions sel pred')->click();
271 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[contains(text(), "DMCP")]', 'xpath', 'dataset accessions sel pred')->click();
274 #$d->get('/solgs/combined/model/2804608595/selection/dataset_5/trait/70741/gp/1', 'combo trials tr pop page');
276 my $sel_pred = $d->find_element('Expected genetic gain', 'partial_link_text', 'scroll to GEBvs');
277 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-200);", $sel_pred);
279 $d->find_element_ok('save_gebvs', 'id', 'store gebvs')->click();
281 $d->find_element_ok('View stored GEBVs', 'partial_link_text', 'view store gebvs')->click();
284 $d->driver->go_back();
286 # $d->driver->go_back();
288 # $d->driver->go_back();
290 $d->find_element_ok('Training population 280', 'partial_link_text', 'back to model page')->click();
292 $d->find_element_ok('Training population 280', 'partial_link_text', 'back to training pop page')->click();
295 #$d->get('/solgs/populations/combined/2804608595/gp/1', 'combo trials tr pop page');
297 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
299 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
301 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
303 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
305 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('Test DMCP-FRW modeling combo trials');
307 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
309 $d->find_element_ok('submit_job', 'id', 'submit')->click();
311 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
313 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
315 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
317 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
320 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('trial2 NaCRRI');
322 $d->find_element_ok('search_selection_pop', 'id', 'search for selection pop')->click();
324 $d->find_element_ok('//table[@id="selection_pops_table"]//*[contains(text(), "Predict")]', 'xpath', 'click training pop')->click();
326 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
328 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('Test DMCP-FRW selection pred naccri');
330 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
332 $d->find_element_ok('submit_job', 'id', 'submit')->click();
334 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
337 #$d->get_ok('/solgs/models/combined/trials/2804608595/traits/1971973596/gp/1');
340 $d->find_element_ok('//table[@id="selection_pops_table"]//*[contains(text(), "FRW")]', 'xpath', 'go back')->click();
342 $d->driver->go_back();
345 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[contains(text(), "Predict")]', 'xpath', 'click list sel pred')->click();
347 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
349 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('clones list dmc-frw sel pred');
351 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
353 $d->find_element_ok('submit_job', 'id', 'submit')->click();
356 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
359 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[contains(text(), "Predict")]', 'xpath', 'click list sel pred')->click();
361 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[contains(text(), "FRW")]', 'xpath', 'click list sel pred')->click();
364 $d->driver->go_back();
367 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[contains(text(), "Predict")]', 'xpath', 'click list sel pred')->click();
369 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
371 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('dataset clones sel pred2');
373 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
375 $d->find_element_ok('submit_job', 'id', 'submit')->click();
377 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
380 my $sel_pred = $d->find_element('Predict', 'partial_link_text', 'scroll to selection pred');
381 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $sel_pred);
383 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[contains(text(), "Predict")]', 'xpath', 'click list sel pred')->click();
385 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[contains(text(), "FRW")]', 'xpath', 'click list sel pred')->click();
390 $d->get_ok('/solgs', 'solgs home page');
393 my $tr_search= $d->find_element('search for a trait', 'partial_link_text', 'scroll trait search');
394 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $tr_search);
396 $d->find_element_ok('search for a trait', 'partial_link_text', 'trait search')->click();
398 $d->find_element_ok('search_trait_entry', 'id', 'trait search form')->send_keys('dry matter');
400 $d->find_element_ok('search_trait', 'id', 'search for gs trait')->click();
402 $d->find_element_ok('dry matter', 'partial_link_text', 'trait earch results')->click();
406 $d->find_element_ok('//table[@id="all_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
408 $d->find_element_ok('//table[@id="all_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
410 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
412 $d->find_element_ok('queue_job', 'id', 'submit job tr pop')->click();
414 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('combined trait trials');
416 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
418 $d->find_element_ok('submit_job', 'id', 'submit')->click();
420 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
424 $d->find_element_ok('//table[@id="all_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
426 $d->find_element_ok('//table[@id="all_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
428 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
431 foreach my $list_id ($trials_list_id, $accessions_list_id, $plots_list_id) {
432 $list_id =~ s/\w+_//g;
433 $solgs_data->delete_list($list_id);
436 foreach my $dataset_id ($trials_dt_id, $accessions_dt_id, $plots_dt_id) {
437 $dataset_id =~ s/\w+_//g;
438 $solgs_data->delete_dataset($dataset_id);