Merge branch 'master' into topic/create_plant_entries
[sgn.git] / t / selenium2 / breeders / breeding_programs.t
blob68f1f750d9dc465a72abe338ac910fe4f877b865
3 use lib 't/lib';
5 use Test::More;
7 use SGN::Test::WWW::WebDriver;
10 my $t = SGN::Test::WWW::WebDriver->new();
12 $t->while_logged_in_as("curator", sub { 
13     $t->get_ok('/breeders/manage_programs');
14     
15     my $new_bp_link = $t->find_element_ok('new_breeding_program_link', 'id', 'new breeding program link');
17     $new_bp_link->click();
19     sleep(2);
21     my $breeding_program_name_input = $t->find_element_ok('new_breeding_program_name', 'id', 'find add breeding program name input');
23     $breeding_program_name_input->send_keys('WEBTEST');
25     my $breeding_program_desc_input = $t->find_element_ok('new_breeding_program_desc', 'id', 'find add breeding program description input');
27     $breeding_program_desc_input->send_keys('Test description.');
29     my $ok_button = $t->find_element_ok('new_breeding_program_submit', 'id', 'find add breeding program button');
32     $ok_button->click();
34     print STDERR "\n\nCLICKED OK... so far so good...\n\n";
36     $t->driver()->accept_alert();
38     sleep(2); # wait until page is re-loaded
40     $t->get_ok('/breeders/manage_programs');
41     sleep(2);
43     ok($t->driver->get_page_source() =~ m/WEBTEST/, "breeding program addition successful");
45 #    print STDERR $t->driver->get_page_source();
47     my $delete_link = $t->find_element_ok('delete_breeding_program_link_WEBTEST', 'id', 'find breeding program delete link');
49     sleep(2); 
51      $delete_link->click();
53     sleep(2);
54     
55     $t->driver()->accept_alert();
56     
57     $t->get_ok('/breeders/manage_programs');
58     
59     
60     print STDERR "Marker 4\n";
62 #    sleep(2);
64 #  ok($t->driver->get_page_source() !~ m/WEBTEST/, "breeding program deletion successful");
66     done_testing();
67                        
68                        });