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 {
14 $t->get_ok('/breeders/trial/137');
17 my $heatmap_onswitch = $t->find_element_ok("pheno_heatmap_onswitch", "id", "click to open pheno heatmap panel");
19 $heatmap_onswitch->click();
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);
33 $t->find_element_ok("upload_trial_coords_ok_button", "id", "submit upload trial coords file ")->click();
36 $t->find_element_ok("trial_coord_upload_success_dialog_message_cancel", "id", "close success msg")->click();
39 $t->find_element_ok("upload_trial_coords_cancel_button", "id", "close upload modal")->click();
42 # RELOAD PAGE TO CHECK IF SUCCESS
43 $t->get_ok('/breeders/trial/137');
46 my $heatmap_onswitch = $t->find_element_ok("pheno_heatmap_onswitch", "id", "click to open pheno heatmap panel");
48 $heatmap_onswitch->click();
51 $t->find_element_ok("trial_fieldmap_download_layout_button", "id", "find a download button after upload coordinates");
54 $t->find_element_ok("delete_field_map_hm_link", "id", "find a delete coordinates after upload button and click")->click();
57 $t->find_element_ok("delete_field_coords_ok_button", "id", "find confirm deletion of coordinates after upload");
61 $t->driver()->close();