6 use Test::More 'tests' => 22;
7 use SGN::Test::WWW::WebDriver;
8 use SGN::Test::Fixture;
10 my $d = SGN::Test::WWW::WebDriver->new();
11 my $f = SGN::Test::Fixture->new();
14 $d->while_logged_in_as("submitter", sub {
17 $d->get_ok('/breeders/trial/137');
20 $d->find_element_ok("lists_link", "name", "find lists_link")->click();
22 $d->find_element_ok("add_list_input", "id", "find add list input");
24 my $add_list_input = $d->find_element_ok("add_list_input", "id", "find add list input test");
27 my $random_val = int(rand(1000));
28 my $list_name = sprintf("selenium_test_list_datacollector_%d", $random_val);
30 $add_list_input->send_keys($list_name);
33 $d->find_element_ok("add_list_button", "id", "find add list button test")->click();
36 $d->find_element_ok("view_list_$list_name", "id", "view list test")->click();
39 $d->find_element_ok("updateListDescField", "id", "find list type")->send_keys($list_name);
41 $d->find_element_ok("type_select", "id", "find list type")->click();
42 $d->find_element_ok('option[name="traits"]', "css", "select type 'traits' from a list")->click();
45 $d->find_element_ok("dialog_add_list_item", "id", "add test list")->send_keys("dry matter content percentage|CO_334:0000092\nfresh root weight|CO_334:0000012\nfresh shoot weight measurement in kg|CO_334:0000016\nharvest index variable|CO_334:0000015\n");
48 $d->find_element_ok("dialog_add_list_item_button", "id", "find dialog_add_list_item_button test")->click();
50 my $button = $d->find_element_ok("close_list_item_dialog", "id", "find close_list_item_dialog button test");
55 $d->find_element_ok("close_list_dialog_button", "id", "find close dialog button")->click();
57 $d->get_ok('/breeders/trial/137');
60 my $trail_files_onswitch = $d->find_element_ok("trial_upload_files_onswitch", "id", "find and open 'trial upload files onswitch' and click");
61 $trail_files_onswitch->click();
64 my $create_DataCollector_link = $d->find_element_ok('create_DataCollector_link', 'id', "find create data collector spreadsheet link");
65 $create_DataCollector_link->click();
68 $d->find_element_ok('trait_list_dc_list_select', 'id', "find and open list select input")->click();
71 $d->find_element_ok("//select[\@id='trait_list_dc_list_select']//option[contains(text(),\"$list_name\")]", 'xpath', "Select a new $list_name from list select")->click();
74 $d->find_element_ok('download_datacollector_data_level', 'id', "find and open list of 'data levels' select input")->click();
77 $d->find_element_ok('//select[@id="download_datacollector_data_level"]//option[@value="plots"]', 'xpath', "Select plants as value for select data levels input")->click();
80 $d->find_element_ok('create_DataCollector_submit_button', 'id', "find create excel file button and click")->click();