Merge branch 'master' into topic/create_plant_entries
[sgn.git] / t / selenium2 / breeders / 01_create_trial.t
blob69ac778bc6c6b583c82b9d6459349b892f1a73e6
2 use strict;
4 use lib 't/lib';
6 use Test::More;
8 use SGN::Test::WWW::WebDriver;
10 my $t = SGN::Test::WWW::WebDriver->new();
12 $t->while_logged_in_as(
13     "submitter", 
16     sub { 
17         $t->get_ok('/breeders/trials');
18     my $refresh_tree = $t->find_element_ok("refresh_jstree_html", "id", "refresh tree")->click();
19     sleep(3);
20         my $add_project_link = $t->find_element_ok('add_project_link', 'id', "find add trial link");
22         $add_project_link->click();
24         sleep(1);
26         $t->find_element_ok('new_trial_name', 'id', "find new trial name input box")->send_keys("Test trial 1");
28         $t->find_element_ok('add_project_year', 'id', "find trial year input box")->send_keys("2015");
30         $t->find_element_ok('add_project_location', 'id', "find project location input box")->send_keys("test_location");
32         $t->find_element_ok('add_project_description', 'id', "find project description input box")->send_keys("test test test");
34         $t->find_element_ok('select_design_method', 'id', "find field layout design method")->click('Completely Randomized');
36         $t->find_element_ok('select_list_list_select', 'id', "find list select select box")->click('test_stocks');
38         $t->find_element_ok('rep_count', 'id', "find replicate count input box")->send_keys("3");
40         $t->find_element_ok('new_trial_submit', 'id', "find Add button")->click();
41         sleep(15);
43         $t->find_element_ok('new_trial_confirm_submit', 'id', "find trial design confirm button")->click();
44         
45         sleep(10);
47         $t->find_element_ok('trial_saved_dialog_message_ok_button', 'id', "find trial saved dialog")->click();
49         sleep(1);
51     });
54 done_testing();