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' => 60, 'plots_list_subset' => 60});
14 my $cache_dir = $solgs_data->site_cluster_shared_dir();
16 my $accessions_list = $solgs_data->load_accessions_list();
17 my $accessions_list_name = $accessions_list->{list_name};
18 my $accessions_list_id = 'list_' . $accessions_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 $accessions_dt = $solgs_data->load_accessions_dataset();
29 my $accessions_dt_name = $accessions_dt->{dataset_name};
30 my $accessions_dt_id = 'dataset_' . $accessions_dt->{dataset_id};
32 print STDERR "\ntrials dt: $trials_dt_name -- $trials_dt_id\n";
33 print STDERR "\naccessions dt: $accessions_dt_name -- $accessions_dt_id\n";
35 print STDERR "\ntrials list: $trials_list_name -- $trials_list_id\n";
36 print STDERR "\naccessions list: $accessions_list_name -- $accessions_list_id\n";
41 $d->while_logged_in_as("submitter", sub {
43 $d->get_ok('/kinship/analysis', 'kinship home page');
46 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -- accesions list')->click();
48 $d->find_element_ok('no_queue', 'id', 'no job queueing')->click();
51 my $sel = $d->find_element('//*[contains(text(), "Previous")]', 'xpath', 'scroll up');
52 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0, -50);", $sel);
54 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check plot output')->click();
56 $d->find_element_ok('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'check output download')->click();
59 $d->driver->refresh();
62 $d->find_element_ok('//tr[@id="' . $trials_list_id .'"]//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -- trials list')->click();
64 $d->find_element_ok('no_queue', 'id', 'no job queueing')->click();
66 my $sel = $d->find_element('//*[contains(text(), "Previous")]', 'xpath', 'scroll up');
67 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0, -50);", $sel);
69 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check plot output')->click();
71 $d->find_element_ok('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'check output download')->click();
74 $d->driver->refresh();
80 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -queue- accessions list')->click();
82 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
84 $d->find_element_ok('analysis_name', 'id', 'job queueing')->send_keys('kinship analysis');
86 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
88 $d->find_element_ok('submit_job', 'id', 'submit')->click();
90 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
93 $d->find_element_ok('//tr[@id="' . $accessions_list_id .'"]//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -check queued- accessions list')->click();
95 my $sel = $d->find_element('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'scroll up');
96 my $elem =$d->driver->execute_script("arguments[0].scrollIntoView(true);window.scrollBy(0, 200);", $sel);
98 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check output')->click();
100 $d->find_element_ok('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'check output')->click();
103 $d->driver->refresh();
106 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -- accessions dataset')->click();
108 $d->find_element_ok('no_queue', 'id', 'no job queueing')->click();
110 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check output')->click();
113 $d->driver->refresh();
116 $d->find_element_ok('//tr[@id="' . $trials_dt_id .'"]//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship --trials dataset')->click();
118 $d->find_element_ok('no_queue', 'id', 'no job queueing')->click();
120 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check output')->click();
123 $d->driver->refresh();
129 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -queue- accessions dataset')->click();
131 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
133 $d->find_element_ok('analysis_name', 'id', 'job queueing')->send_keys('kinship analysis');
135 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
137 $d->find_element_ok('submit_job', 'id', 'submit')->click();
139 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
142 $d->find_element_ok('//tr[@id="' . $accessions_dt_id .'"]//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -queued- accessions dataset')->click();
144 my $sel = $d->find_element('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'scroll up');
145 my $elem =$d->driver->execute_script("arguments[0].scrollIntoView(true);window.scrollBy(0, 200);", $sel);
147 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check output')->click();
149 $d->find_element_ok('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'check output')->click();
153 ######## trials page #######
154 $d->get_ok('/breeders/trial/139', 'trial detail home page');
156 my $analysis_tools = $d->find_element('Analysis Tools', 'partial_link_text', 'toogle analysis tools');
157 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);", $analysis_tools);
159 $d->find_element_ok('Analysis Tools', 'partial_link_text', 'toogle analysis tools')->click();
161 my $analysis_tools = $d->find_element('Kinship', 'partial_link_text', 'toogle analysis tools');
162 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-60);", $analysis_tools);
164 $d->find_element_ok('Kinship', 'partial_link_text', 'expand kinship')->click();
166 $d->find_element_ok('//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -- trial page')->click();
168 $d->find_element_ok('no_queue', 'id', 'no job queueing')->click();
170 my $sel = $d->find_element('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'scroll up');
171 my $elem =$d->driver->execute_script("arguments[0].scrollIntoView(true);window.scrollBy(0, -100);", $sel);
173 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check plot output')->click();
175 $d->find_element_ok('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'check output download')->click();
179 $d->get_ok('/solgs', 'solgs homepage');
182 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('Kasese solgs trial');
184 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
186 $d->find_element_ok('Kasese', 'partial_link_text', 'create training pop')->click();
188 $d->find_element_ok('queue_job', 'id', 'submit job tr pop')->click();
190 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('Test Kasese Tr pop');
192 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
194 $d->find_element_ok('submit_job', 'id', 'submit')->click();
196 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
199 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('Kasese solgs trial');
201 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
203 $d->find_element_ok('Kasese', 'partial_link_text', 'create training pop')->click();
206 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
207 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
208 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
210 $d->find_element_ok('queue_job', 'id', 'no job queueing')->click();
212 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('Test DMCP-FRW modeling Kasese');
214 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
216 $d->find_element_ok('submit_job', 'id', 'submit')->click();
218 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
221 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
223 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
225 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
228 my $analysis_tools = $d->find_element('Kinship', 'partial_link_text', 'toogle analysis tools');
229 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);", $analysis_tools);
231 $d->find_element_ok('//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship')->click();
233 $d->find_element_ok('no_queue', 'id', 'no job queueing')->click();
235 my $sel = $d->find_element('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'scroll up');
236 my $elem =$d->driver->execute_script("arguments[0].scrollIntoView(true);window.scrollBy(0, -100);", $sel);
238 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check output')->click();
240 $d->find_element_ok('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'check output')->click();
243 $d->driver->refresh();
246 my $clustering = $d->find_element('Models summary', 'partial_link_text', 'scroll up');
247 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $clustering);
249 $d->find_element_ok('//table[@id="model_summary"]//*[contains(text(), "FRW")]', 'xpath', 'click training pop')->click();
251 my $analysis_tools = $d->find_element('Kinship', 'partial_link_text', 'toogle analysis tools');
252 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);", $analysis_tools);
254 $d->find_element_ok('//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship')->click();
256 my $sel = $d->find_element('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'scroll up');
257 my $elem =$d->driver->execute_script("arguments[0].scrollIntoView(true);window.scrollBy(0, -100);", $sel);
259 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check output')->click();
261 $d->find_element_ok('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'check output')->click();
266 $d->get_ok('/solgs', 'solgs homepage');
269 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('Kasese solgs trial');
271 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
273 $d->find_element_ok('population_search_entry', 'id', 'population search form')->clear();
275 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('trial2 nacrri');
277 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
280 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
282 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
284 $d->find_element_ok('select_trials_btn', 'id', 'done selecting')->click();
286 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
288 $d->find_element_ok('queue_job', 'id', 'submit job tr pop')->click();
290 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('combo trials tr pop');
292 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
294 $d->find_element_ok('submit_job', 'id', 'submit')->click();
296 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
300 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('Kasese solgs trial');
302 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
304 $d->find_element_ok('population_search_entry', 'id', 'population search form')->clear();
306 $d->find_element_ok('population_search_entry', 'id', 'population search form')->send_keys('trial2 nacrri');
308 $d->find_element_ok('search_training_pop', 'id', 'search for training pop')->click();
311 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
313 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
315 $d->find_element_ok('select_trials_btn', 'id', 'done selecting')->click();
317 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
320 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
322 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
324 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
326 $d->find_element_ok('queue_job', 'id', 'no job queueing')->click();
328 $d->find_element_ok('analysis_name', 'id', 'no job queueing')->send_keys('Test DMCP-FRW modeling combo trials');
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->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
339 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
341 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
344 my $kin = $d->find_element('Kinship', 'partial_link_text', 'scroll up');
345 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-70);", $kin);
347 $d->find_element_ok('//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -- multi models page')->click();
349 $d->find_element_ok('no_queue', 'id', 'no job queueing')->click();
351 my $sel = $d->find_element('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'scroll up');
352 my $elem =$d->driver->execute_script("arguments[0].scrollIntoView(true);window.scrollBy(0, -100);", $sel);
354 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check output')->click();
356 $d->find_element_ok('//div[@id="kinship_div"]//*[contains(text(), "Download")]', 'xpath', 'check output')->click();
359 $d->driver->refresh();
362 $d->find_element_ok('//table[@id="model_summary"]//*[contains(text(), "FRW")]', 'xpath', 'click training pop')->click();
364 my $kin = $d->find_element('Kinship', 'partial_link_text', 'scroll up kinship section');
365 my $elem = $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-50);", $kin);
367 $d->find_element_ok('//*[starts-with(@id, "run_kinship")]', 'xpath', 'run kinship -- FRW model page')->click();
369 $d->find_element_ok('//*[contains(text(), "Diag")]', 'xpath', 'check output')->click();
372 foreach my $list_id ($trials_list_id, $accessions_list_id) {
373 $list_id =~ s/\w+_//g;
374 $solgs_data->delete_list($list_id);
377 foreach my $dataset_id ($trials_dt_id, $accessions_dt_id) {
378 $dataset_id =~ s/\w+_//g;
379 $solgs_data->delete_dataset($dataset_id);