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();
16 print STDERR "\nsite_cluster_shared_dir-- $cache_dir\n";
19 my $accessions_list = $solgs_data->load_accessions_list();
20 # my $accessions_list = $solgs_data->get_list_details('accessions');
21 my $accessions_list_name = $accessions_list->{list_name};
22 my $accessions_list_id = 'list_' . $accessions_list->{list_id};
23 print STDERR "\naccessions list: $accessions_list_name -- $accessions_list_id\n";
24 my $plots_list = $solgs_data->load_plots_list();
25 # my $plots_list = $solgs_data->get_list_details('plots');
26 my $plots_list_name = $plots_list->{list_name};
27 my $plots_list_id = 'list_' . $plots_list->{list_id};
29 print STDERR "\nadding trials list '\n";
30 my $trials_list = $solgs_data->load_trials_list();
31 # my $trials_list = $solgs_data->get_list_details('trials');
32 my $trials_list_name = $trials_list->{list_name};
33 my $trials_list_id = 'list_' . $trials_list->{list_id};
34 print STDERR "\nadding trials dataset\n";
35 # my $trials_dt = $solgs_data->get_dataset_details('trials');
36 my $trials_dt = $solgs_data->load_trials_dataset();
37 my $trials_dt_name = $trials_dt->{dataset_name};
38 my $trials_dt_id = 'dataset_' . $trials_dt->{dataset_id};
39 print STDERR "\nadding accessions dataset\n";
40 # my $accessions_dt = $solgs_data->get_dataset_details('accessions');
41 my $accessions_dt = $solgs_data->load_accessions_dataset();
42 my $accessions_dt_name = $accessions_dt->{dataset_name};
43 my $accessions_dt_id = 'dataset_' . $accessions_dt->{dataset_id};
45 print STDERR "\nadding plots dataset\n";
46 # my $plots_dt = $solgs_data->get_dataset_details('plots');
47 my $plots_dt = $solgs_data->load_plots_dataset();
48 my $plots_dt_name = $plots_dt->{dataset_name};
49 my $plots_dt_id = 'dataset_' . $plots_dt->{dataset_id};
51 #$accessions_dt_name = '' . $accessions_dt_name . '';
52 print STDERR "\ntrials dt: $trials_dt_name -- $trials_dt_id\n";
53 print STDERR "\naccessions dt: $accessions_dt_name -- $accessions_dt_id\n";
54 print STDERR "\nplots dt: $plots_dt_name -- $plots_dt_id\n";
56 print STDERR "\ntrials list: $trials_list_name -- $trials_list_id\n";
57 print STDERR "\naccessions list: $accessions_list_name -- $accessions_list_id\n";
58 print STDERR "\nplots list: $plots_list_name -- $plots_list_id\n";
63 $d->while_logged_in_as("submitter", sub {
65 $d->get('/solgs', 'solgs home page');
67 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('Kasese solgs trial');
69 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
71 $d->find_element_ok('Kasese', 'partial_link_text', 'create training pop')->click();
73 $d->find_element_ok('queue_job', 'id', 'submit job tr pop')->click();
75 $d->find_element_ok('analysis_name', 'id', 'job queueing')->send_keys('Test Kasese Tr pop');
77 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
79 $d->find_element_ok('submit_job', 'id', 'submit')->click();
81 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
83 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('Kasese solgs trial');
85 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
87 $d->find_element_ok('Kasese', 'partial_link_text', 'create training pop')->click();
91 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
93 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
95 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
97 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
99 $d->find_element_ok('analysis_name', 'id', 'job queueing')->send_keys('Test DMCP-FRW modeling Kasese');
101 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
103 $d->find_element_ok('submit_job', 'id', 'submit')->click();
105 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
107 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
109 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
111 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
114 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('trial2 NaCRRI');
116 $d->find_element_ok('search_selection_pop', 'id', 'search for selection pop')->click();
118 $d->find_element_ok('//table[@id="selection_pops_table"]//*[contains(text(), "Predict")]', 'xpath', 'click training pop')->click();
120 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
122 $d->find_element_ok('analysis_name', 'id', 'job queueing')->send_keys('Test DMCP-FRW selection pred naccri');
124 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
126 $d->find_element_ok('submit_job', 'id', 'submit')->click();
128 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
132 my $si = $d->find_element('selection index', 'partial_link_text', 'scroll up');
133 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $si);
135 $d->find_element_ok('si_pops_select', 'id', 'select list sl pop')->click();
137 $d->find_element_ok('//select[@id="si_pops_select"]/option[text()="Kasese solgs trial"]', 'xpath', 'select trial type tr pop')->click();
139 $d->find_element_ok('DMCP', 'id', 'rel wt 1st')->send_keys(3);
141 $d->find_element_ok('FRW', 'id', 'rel wt 2st')->send_keys(5);
143 $d->find_element_ok('calculate_si', 'id', 'calc selection index')->click();
146 my $si = $d->find_element('selection index', 'partial_link_text', 'scroll up');
147 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-10);", $si);
149 $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Values")]', 'xpath', 'check caption')->click();
151 $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Index Name")]', 'xpath', 'check caption')->click();
153 # $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Indices")]', 'xpath', 'check caption')->click();
156 $d->driver->refresh();
159 my $cor = $d->find_element('selection index', 'partial_link_text', 'scroll up');
160 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $cor);
162 $d->find_element_ok('si_pops_select', 'id', 'select list sl pop')->click();
164 $d->find_element_ok('//select[@id="si_pops_select"]/option[text()="trial2 NaCRRI"]', 'xpath', 'select trial type tr pop')->click();
166 $d->find_element_ok('DMCP', 'id', 'rel wt 1st')->send_keys(2);
168 $d->find_element_ok('FRW', 'id', 'rel wt 2st')->send_keys(4);
170 $d->find_element_ok('calculate_si', 'id', 'calc selection index')->click();
173 my $si = $d->find_element('selection index', 'partial_link_text', 'scroll up');
174 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-10);", $si);
176 $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Values")]', 'xpath', 'check caption')->click();
178 $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Index Name")]', 'xpath', 'check caption')->click();
180 # $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Indices")]', 'xpath', 'check caption')->click();
188 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('Kasese solgs trial');
190 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
192 $d->find_element_ok('trial_search_box', 'id', 'population search form')->clear();
194 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('trial2 nacrri');
196 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
199 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
201 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
203 $d->find_element_ok('select_trials_btn', 'id', 'done selecting')->click();
205 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
207 $d->find_element_ok('queue_job', 'id', 'submit job tr pop')->click();
209 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('combined trials');
211 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
213 $d->find_element_ok('submit_job', 'id', 'submit')->click();
215 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
219 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('Kasese solgs trial');
221 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
223 $d->find_element_ok('trial_search_box', 'id', 'population search form')->clear();
225 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('trial2 nacrri');
227 $d->find_element_ok('search_trial', 'id', 'search for training pop')->click();
230 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="139"]', 'xpath', 'select trial kasese')->click();
232 $d->find_element_ok('//table[@id="searched_trials_table"]//input[@value="141"]', 'xpath', 'select trial nacrri')->click();
234 $d->find_element_ok('select_trials_btn', 'id', 'done selecting')->click();
236 $d->find_element_ok('combine_trait_trials', 'id', 'combine trials')->click();
239 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
241 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
243 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
245 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
247 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('Test DMCP-FRW modeling combo trials');
249 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
251 $d->find_element_ok('submit_job', 'id', 'submit')->click();
253 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
256 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[1]/td/input', 'xpath', 'select 1st trait')->click();
258 $d->find_element_ok('//table[@id="population_traits_list"]/tbody/tr[2]/td/input', 'xpath', 'select 2nd trait')->click();
260 $d->find_element_ok('runGS', 'id', 'build multi models')->click();
263 $d->find_element_ok('trial_search_box', 'id', 'population search form')->send_keys('trial2 NaCRRI');
265 $d->find_element_ok('search_selection_pop', 'id', 'search for selection pop')->click();
267 $d->find_element_ok('//table[@id="selection_pops_table"]//*[contains(text(), "Predict")]', 'xpath', 'click training pop')->click();
269 $d->find_element_ok('queue_job', 'id', 'job queueing')->click();
271 $d->find_element_ok('analysis_name', 'id', 'analysis name')->send_keys('Test DMCP-FRW selection pred naccri');
273 $d->find_element_ok('user_email', 'id', 'user email')->send_keys('email@email.com');
275 $d->find_element_ok('submit_job', 'id', 'submit')->click();
277 $d->find_element_ok('Go back', 'partial_link_text', 'go back')->click();
280 my $si = $d->find_element('selection index', 'partial_link_text', 'scroll up');
281 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $si);
283 $d->find_element_ok('si_pops_select', 'id', 'select list sl pop')->click();
285 $d->find_element_ok('//select[@id="si_pops_select"]/option[contains(text(), "Training population 280")]', 'xpath', 'select trial type tr pop')->click();
287 $d->find_element_ok('DMCP', 'id', 'rel wt 1st')->send_keys(3);
289 $d->find_element_ok('FRW', 'id', 'rel wt 2st')->send_keys(5);
291 $d->find_element_ok('calculate_si', 'id', 'calc selection index')->click();
294 my $si = $d->find_element('selection index', 'partial_link_text', 'scroll up');
295 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-10);", $si);
297 $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Values")]', 'xpath', 'check caption')->click();
299 $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Index Name")]', 'xpath', 'check caption')->click();
302 $d->driver->refresh();
305 my $cor = $d->find_element('selection index', 'partial_link_text', 'scroll up');
306 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-100);", $cor);
308 $d->find_element_ok('si_pops_select', 'id', 'select list sl pop')->click();
310 $d->find_element_ok('//select[@id="si_pops_select"]/option[text()="trial2 NaCRRI"]', 'xpath', 'select trial type tr pop')->click();
312 $d->find_element_ok('DMCP', 'id', 'rel wt 1st')->send_keys(2);
314 $d->find_element_ok('FRW', 'id', 'rel wt 2st')->send_keys(4);
316 $d->find_element_ok('calculate_si', 'id', 'calc selection index')->click();
319 my $si = $d->find_element('selection index', 'partial_link_text', 'scroll up');
320 $d->driver->execute_script( "arguments[0].scrollIntoView(true);window.scrollBy(0,-10);", $si);
322 $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Values")]', 'xpath', 'check caption')->click();
324 $d->find_element_ok('//div[@id="si_canvas"]//*[contains(text(), "Index Name")]', 'xpath', 'check caption')->click();
327 foreach my $list_id ($trials_list_id, $accessions_list_id, $plots_list_id) {
328 $list_id =~ s/\w+_//g;
329 $solgs_data->delete_list($list_id);
332 foreach my $dataset_id ($trials_dt_id, $accessions_dt_id, $plots_dt_id) {
333 $dataset_id =~ s/\w+_//g;
334 $solgs_data->delete_dataset($dataset_id);