start fixing test for multi cat phenotype upload.
[sgn.git] / t / selenium2 / breeders / upload_trial_coords.t
blobd9b9cd215c46f97f94aeb2a1f0386a35dd05feef
1 use lib 't/lib';
3 use Test::More 'tests' => 12;
5 use SGN::Test::WWW::WebDriver;
6 use SGN::Test::Fixture;
8 my $f = SGN::Test::Fixture->new();
9 my $t = SGN::Test::WWW::WebDriver->new();
11 $t->while_logged_in_as("submitter", sub {
12     sleep(1);
14     $t->get_ok('/breeders/trial/137');
15     sleep(3);
17     my $heatmap_onswitch = $t->find_element_ok("pheno_heatmap_onswitch",  "id",  "click to open pheno heatmap panel");
19     $heatmap_onswitch->click();
20     sleep(3);
22     $t->find_element_ok("heatmap_upload_trial_coords_link", "id", "click on upload_trial_coords_link ")->click();
24     my $upload_input = $t->find_element_ok("trial_coordinates_uploaded_file", "id", "find file input");
26     my $filename = $f->config->{basepath}."/t/data/trial/upload_trial_coords_file.csv";
28     $t->driver()->upload_file($filename);
30     $upload_input->send_keys($filename);
31     sleep(1);
33     $t->find_element_ok("upload_trial_coords_ok_button", "id", "submit upload trial coords file ")->click();
34     sleep(15);
36     $t->find_element_ok("trial_coord_upload_success_dialog_message_cancel", "id", "close success msg")->click();
37     sleep(1);
39     $t->find_element_ok("upload_trial_coords_cancel_button", "id", "close upload modal")->click();
40     sleep(1);
42     # RELOAD PAGE TO CHECK IF SUCCESS
43     $t->get_ok('/breeders/trial/137');
44     sleep(3);
46     my $heatmap_onswitch = $t->find_element_ok("pheno_heatmap_onswitch",  "id",  "click to open pheno heatmap panel");
48     $heatmap_onswitch->click();
49     sleep(4);
51     $t->find_element_ok("trial_fieldmap_download_layout_button", "id", "find a download button after upload coordinates");
52     sleep(1);
53     
54     $t->find_element_ok("delete_field_map_hm_link", "id", "find a delete coordinates after upload button and click")->click();
55     sleep(1);
57     $t->find_element_ok("delete_field_coords_ok_button", "id", "find confirm deletion of coordinates after upload");
58     }
61 $t->driver()->close();
62 $f->clean_up_db();
63 done_testing();