start fixing test for multi cat phenotype upload.
[sgn.git] / t / selenium2 / breeders / breeding_programs.t
blobdbb06f80579cce4e0bb873ed99f091dd027b81c2
1 use lib 't/lib';
3 use Test::More 'tests' => 10;
5 use SGN::Test::WWW::WebDriver;
8 my $t = SGN::Test::WWW::WebDriver->new();
10 $t->while_logged_in_as("curator", sub {
11     sleep(2);
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();
19     sleep(5);
21     my $breeding_program_name_input = $t->find_element_ok('store_breeding_program_name', 'id', 'find store breeding program name input');
23     $breeding_program_name_input->send_keys('WEBTEST');
25     my $breeding_program_desc_input = $t->find_element_ok('store_breeding_program_desc', 'id', 'find store breeding program description input');
27     $breeding_program_desc_input->send_keys('Test description.');
29     my $ok_button = $t->find_element_ok('store_breeding_program_submit', 'id', 'find store breeding program button');
31     $ok_button->click();
33     sleep(2);
35     $t->driver->accept_alert();
37     sleep(2); # wait until page is re-loaded
39     $t->get_ok('/breeders/manage_programs');
41     sleep(2);
43     ok($t->driver->get_page_source() =~ m/WEBTEST/, "breeding program addition successful");
45     sleep(2);
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);
55     $t->driver->accept_alert();
57     sleep(2);
59     $t->get_ok('/breeders/manage_programs');
61     sleep(2);
63     ok($t->driver->get_page_source() !~ m/WEBTEST/, "breeding program deletion successful");
64 });
66 $t->driver()->close();
67 done_testing();