modified comparison condition
[sgn.git] / t / selenium2 / breeders / upload_crosses_file.t
blob8a9d412e0ad105a243c36be26f054e9ca94de8a3
1 use lib 't/lib';
3 use Test::More;
5 use SGN::Test::WWW::WebDriver;
6 use SGN::Test::Fixture;
8 my $f = SGN::Test::Fixture->new();
9 my $t = SGN::Test::WWW::WebDriver->new();
11 $t->while_logged_in_as("submitter", sub { 
13     $t->get_ok('/breeders/crosses');
15     $t->find_element_ok("upload_crosses_link", "name", "click on upload_crosses_link ")->click();
17     sleep(2);
19     my $program_select = $t->find_element_ok("cross_upload_breeding_program", "id", "find breeding program select");
21     $program_select->send_keys('test');
23     my $location_select = $t->find_element_ok("cross_upload_location", "id", "find location select");
25     $location_select->send_keys('test_location');
27     my $upload_input = $t->find_element_ok("crosses_upload_file", "id", "find file input");
29     my $filename = $f->config->{basepath}."/t/data/cross/upload_cross.xls";
31     my $remote_filename = $t->driver()->upload_file($filename);
33     $upload_input->send_keys($filename);
35     sleep(1);
37     $t->find_element_ok("upload_crosses_submit", "id", "submit upload cross file ")->click();
39     sleep(4);
41     $t->find_element_ok("cross_upload_success_dismiss", "id", "dismiss success modal ")->click();
43     sleep(2);
44     
45     $t->get_ok('/breeders/crosses');
47     sleep(2);
49     $t->find_element_ok("test_upload_cross1", "partial_link_text", "find link for test_cross")->click();
51     sleep(2);
52     }
56 done_testing();