4 use SGN::Test::WWW::WebDriver;
5 use SGN::Test::Fixture;
6 use CXGN::BreederSearch;
8 my $f = SGN::Test::Fixture->new();
10 my $bs = CXGN::BreederSearch->new( { dbh=> $f->dbh() });
12 my $refresh = 'SELECT refresh_materialized_views()';
13 my $h = $f->dbh->prepare($refresh);
16 my $t = SGN::Test::WWW::WebDriver->new();
17 #$t->driver->set_implicit_wait_timeout(5);
19 $t->get_ok('/breeders/search');
21 $t->find_element_ok("c1_to_list_menu", "id", "check if login prompt appears for c1")->send_keys('breeding programs');
25 $t->while_logged_in_as("submitter", sub {
26 $t->get_ok('/breeders/search');
28 $t->find_element_ok("select1", "id", "retrieve traits")->send_keys('traits');
32 $t->find_element_ok("c1_data", "id", "select specific trait")->send_keys('dry matter content|CO:0000092');
36 $t->find_element_ok("c1_select_all", "id", "select all traits")->click();
40 $t->find_element_ok("select2", "id", "retrieve trials")->send_keys('trials');
44 $t->find_element_ok("c2_data", "id", "select specific trial")->send_keys('Kasese solgs trial');
48 $t->find_element_ok("c2_select_all", "id", "select all trials")->click();
52 $t->find_element_ok("select3", "id", "retrieve years")->send_keys('years');
56 $t->find_element_ok("c3_data", "id", "select specific year")->send_keys('2014');
60 $t->find_element_ok("c3_select_all", "id", "select all years")->click();
64 $t->find_element_ok("select4", "id", "retrieve accessions")->send_keys('accessions');
68 $t->find_element_ok("c4_data", "id", "select specific accession")->send_keys('UG120001');
72 $t->find_element_ok("c4_select_all", "id", "select all accessions")->click();
76 $t->find_element_ok("c1_data_new_list_name", "id", "new list")->send_keys('trait_list');
78 $t->find_element_ok("c1_data_add_to_new_list", "id", "create trait list")->click();
82 $t->driver->accept_alert();
84 $t->find_element_ok("c2_data_new_list_name", "id", "new list")->send_keys('trial_list');
86 $t->find_element_ok("c2_data_add_to_new_list", "id", "create trial list")->click();
90 $t->driver->accept_alert();
92 $t->find_element_ok("c3_data_new_list_name", "id", "new list")->send_keys('year_list');
94 $t->find_element_ok("c3_data_add_to_new_list", "id", "create year list")->click();
98 $t->driver->accept_alert();
100 $t->find_element_ok("c4_data_new_list_name", "id", "new list")->send_keys('acc_list');
102 $t->find_element_ok("c4_data_add_to_new_list", "id", "create accession list")->click();
106 $t->driver->accept_alert();
108 $t->find_element_ok("paste_list_select", "id", "paste test acc list")->send_keys('test_list');
112 $t->find_element_ok("c1_data", "id", "select pasted test accession")->send_keys('test_accession1');
114 $t->find_element_ok("c1_select_all", "id", "select all pasted accessions")->click();
116 ## add test for '0 results' error here?
118 $t->find_element_ok("c1_data_list_select", "id", "select acc_list")->send_keys('acc_list');
120 $t->find_element_ok("c1_data_button", "id", "add c1_data to acc_list")->click();
124 $t->driver->accept_alert();
126 $t->find_element_ok("refresh_lists", "id", " refresh lists")->click();
130 $t->find_element_ok("paste_list_select", "id", "paste test acc list")->send_keys('acc_list');
134 $t->find_element_ok("c1_data", "id", "select pasted test accession")->send_keys('test_accession1');
136 $t->find_element_ok("c1_data", "id", "select pasted list accession")->send_keys('UG120001');
140 $t->find_element_ok("select1", "id", "retrieve breeding programs")->send_keys('breeding_programs');
144 $t->find_element_ok("c1_data", "id", "select specific breeding_program")->send_keys('test');
146 $t->find_element_ok("c2_querytype_or", "id", "toggle c2_querytype to intersect")->click();
150 $t->find_element_ok("c1_select_all", "id", "select all breeding programs")->click();
152 $t->find_element_ok("select2", "id", "retrieve genotyping protocols")->send_keys('genotyping_protocols');
156 $t->find_element_ok("c2_data", "id", "select specific genotyping protocol")->send_keys('GBS ApeKI genotyping v4');
158 $t->find_element_ok("c3_querytype_or", "id", "toggle c3_querytype to intersect")->click();
160 $t->find_element_ok("c2_select_all", "id", "select all breeding programs")->click();
162 $t->find_element_ok("select3", "id", "retrieve locations")->send_keys('locations');
166 $t->find_element_ok("c3_data", "id", "select specific location")->send_keys('test_location');
168 $t->find_element_ok("c4_querytype_or", "id", "toggle c4_querytype to intersect")->click();
170 $t->find_element_ok("c3_select_all", "id", "select all locations")->click();
172 $t->find_element_ok("select4", "id", "retrieve plots")->send_keys('plots');
176 $t->find_element_ok("c4_data", "id", "select specific plot")->send_keys('KASESE_TP2013_1000');
178 $t->find_element_ok("c2_querytype_and", "id", "toggle c2_querytype to union")->click();
180 $t->find_element_ok("c3_querytype_and", "id", "toggle c3_querytype to union")->click();
182 $t->find_element_ok("c4_querytype_and", "id", "toggle c4_querytype to union")->click();