4 use Test::More 'tests'=>8;
6 use SGN::Test::WWW::WebDriver;
8 my $t = SGN::Test::WWW::WebDriver->new();
10 $t->while_logged_in_as("submitter", sub {
11 $t->get_ok('/breeders/locations');
13 my $add_location_link = $t->find_element_ok(
16 "find element add location link as submitter"
19 $add_location_link->click();
23 my $location_desc_input = $t->find_element_ok(
24 "location_description",
26 "find location input test");
27 $location_desc_input->send_keys("yet another test location");
28 my $longitude = $t->find_element_ok(
31 "find longitude input test");
32 $longitude->send_keys("100");
33 my $latitude = $t->find_element_ok(
36 "find latitude input test");
37 $latitude->send_keys("blabla");
38 my $submit_button = $t->find_element_ok(
39 "new_location_submit",
41 "find add_new_location_button test");
42 $submit_button->click();
44 ok($t->driver->get_alert_text() =~ m/must be numbers/i, "enter numbers in latitude test");
45 $t->driver->accept_alert();
48 $latitude->send_keys("200");
49 $submit_button->click();
51 ok($t->driver->get_alert_text() =~ m/new location was saved/i, 'new location was saved test');
53 $t->driver->accept_alert();