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');
15 my $new_bp_link = $t->find_element_ok('new_breeding_program_link', 'id', 'new breeding program link');
17 $new_bp_link->click();
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');
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');
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');
51 $delete_link->click();
55 $t->driver()->accept_alert();
57 $t->get_ok('/breeders/manage_programs');
60 print STDERR "Marker 4\n";
64 # ok($t->driver->get_page_source() !~ m/WEBTEST/, "breeding program deletion successful");