5 use Test::More 'tests' => 25;
6 use SGN::Test::WWW::WebDriver;
7 use SGN::Test::Fixture;
9 my $d = SGN::Test::WWW::WebDriver->new();
10 my $f = SGN::Test::Fixture->new();
12 $d->while_logged_in_as("submitter", sub {
15 $d->get_ok('/breeders/trial/137');
18 $d->find_element_ok("lists_link", "name", "find lists_link")->click();
20 $d->find_element_ok("add_list_input", "id", "find add list input");
22 my $add_list_input = $d->find_element_ok("add_list_input", "id", "find add list input test");
24 my $random_val = int(rand(1000));
25 my $list_name = sprintf("selenium_test_pheno_spreadsheet_%d", $random_val);
27 $add_list_input->send_keys($list_name);
30 $d->find_element_ok("add_list_button", "id", "find add list button test")->click();
33 $d->find_element_ok("view_list_$list_name", "id", "view list test")->click();
36 $d->find_element_ok("updateListDescField", "id", "find list type")->send_keys($list_name);
38 $d->find_element_ok("type_select", "id", "find list type")->click();
39 $d->find_element_ok('option[name="traits"]', "css", "select type 'traits' from a list")->click();
42 $d->find_element_ok("dialog_add_list_item", "id", "add test list")
43 ->send_keys("dry matter content|CO_334:0000092\nfresh root weight|CO_334:0000012\nfresh shoot weight|CO_334:0000016\nharvest index|CO_334:0000015\n");
46 $d->find_element_ok("dialog_add_list_item_button", "id", "find dialog_add_list_item_button test")->click();
48 $d->find_element_ok("close_list_item_dialog", "id", "find close_list_item_dialog button test")->click();
51 $d->find_element_ok("close_list_dialog_button", "id", "find close dialog button")->click();
53 $d->get_ok('/breeders/trial/137');
56 my $trail_files_onswitch = $d->find_element_ok(
57 "trial_upload_files_onswitch",
59 "find and open 'trial upload files onswitch' and click");
60 $trail_files_onswitch->click();
64 'button[name="create_spreadsheet_link"]',
66 "find create spreadsheet link")->click();
70 'trait_list_spreadsheet_list_select',
72 "find list select select box")->click();
76 "//select[\@id='trait_list_spreadsheet_list_select']//option[contains(text(),\"$list_name\")]",
78 "Select a new $list_name from list select")->click();
80 $d->find_element_ok('include_notes_column', 'id', "find include notes column checkbox and click")->click();
83 'create_spreadsheet_phenotype_file_format',
85 "find and open 'phenotype file format' select input")->click();
89 '//select[@id="create_spreadsheet_phenotype_file_format"]//option[@value="ExcelBasicSimple"]',
91 "Select 'value: ExcelBasicSimple (name: Simple)' as file format")->click();
95 'create_spreadsheet_data_level',
97 "find and open list of 'data levels' select input")->click();
101 '//select[@id="create_spreadsheet_data_level"]//option[@value="plots"]',
103 "Select plants as value for select data levels input")->click();
106 $d->find_element_ok('create_phenotyping_ok_button', 'id', "find create excel file button and click")->click();