start fixing test for multi cat phenotype upload.
[sgn.git] / t / selenium2 / breeders / find_trials_by_accessions.t
blobe9cb88df7a5fe7f47c03af7c3e03cf532d40b3c6
1 use lib 't/lib';
3 use Test::More 'tests' => 17;
5 use SGN::Test::WWW::WebDriver;
7 my $t = SGN::Test::WWW::WebDriver->new();
9 $t->while_logged_in_as("submitter", sub {
10     sleep(1);
12     $t->get_ok('/breeders/accessions');
13     sleep(2);
15     # Add a test list
16     $t->find_element_ok("lists_link", "name", "find lists_link")->click();
18     $t->find_element_ok("add_list_input", "id", "find add list input");
20     $t->find_element_ok("add_list_input", "id", "find add list input test")->send_keys("find_trials_in_common");
22     $t->find_element_ok("add_list_button", "id", "find add list button test")->click();
24     $t->find_element_ok("view_list_find_trials_in_common", "id", "view list test")->click();
26     sleep(2);
28     $t->find_element_ok("dialog_add_list_item", "id", "add test list")->send_keys("UG120001\nUG120002\nUG120003\n");
30     sleep(1);
32     $t->find_element_ok("type_select", "id", "set type accessions test")->click();
33     $t->find_element_ok('option[name="accessions"]', "css", "select type 'accessions' from a list")->click();
35     $t->find_element_ok("dialog_add_list_item_button", "id", "find dialog_add_list_item_button test")->click();
36     sleep(1);
38     $t->find_element_ok("close_list_item_dialog", "id", "find close_list_item_dialog button test")->click();
39     sleep(1);
41     $t->find_element_ok("close_list_dialog_button", "id", "find close dialog button")->click();
43     #use test list to test find trials in common tool
44     $t->get_ok('/breeders/accessions');
45     sleep(4);
47     $t->find_element_ok("accession_list_list_select", "id", "select accession list test")->click();
48     $t->find_element_ok(
49         "//select[\@id='accession_list_list_select']/option[contains(text(),'find_trials_in_common')]",
50         'xpath',
51         "Select find_trials_in_common on list select")->click();
52     sleep(2);
54     $t->find_element_ok("find_trials", "id", "find trials test")->click();
55     sleep(4);
57     $t->find_element_ok("trial_summary_data", "id", "trial summary data test");
58   }
61 $t->driver->close();
62 done_testing();