start fixing test for multi cat phenotype upload.
[sgn.git] / t / selenium2 / breeders / calendar_personal.t
blob0d15f97082c2fe0770c3397d20d42d23929b1114
1 use lib 't/lib';
3 use Test::More 'tests' => 9;
5 use SGN::Test::WWW::WebDriver;
7 my $t = SGN::Test::WWW::WebDriver->new();
9 $t->while_logged_in_as("submitter", sub {
10     sleep(2);
12     # THIS FUNCTIONALITY DOES NOT EXIST IN THE OLD FORM, SIMPLE TEST FOR NEW ONE
13     $t->find_element_ok("navbar_personal_calendar", "id", "find calendar button and click")->click();
14     sleep(2);
16     $t->find_element_ok(
17         '(//div[@id = "calendar"]//table//tbody//div[contains(@class, "fc-day-grid-container")]//div[contains(@class, "fc-day-grid")]//div[contains(@class, "fc-row")])[2]//div[contains(@class, "fc-bg")]//table//tbody//td[contains(@class, "fc-day")][3]',
18         "xpath",
19         "find day in calendar and click")->click();
21     sleep(1);
23     $t->find_element_ok(
24         '//select[@id="event_project_select"]', "xpath", "find 'project select' and click")->click();
25     sleep(1);
26     $t->find_element_ok('//select[@id="event_project_select"]/option[contains(text(), "Kasese solgs trial")]',
27         "xpath",
28         "find 'project Kasese solgs trial' and click")->click();
30     $t->find_element_ok(
31         '//select[@id="event_type_select"]', "xpath", "find 'event type select' and click")->click();
32     sleep(1);
33     $t->find_element_ok('//select[@id="event_type_select"]/option[contains(text(), "project_planting_date")]',
34         "xpath",
35         "find 'event type project_planting_date' and click")->click();
37     $t->find_element_ok('event_description', "id", "find 'event description' and type name")->send_keys('Calendar event description');
39     $t->find_element_ok('event_url', "id", "find 'event url' and type url")->send_keys('example.com');
41     $t->find_element_ok('add_event_submit', "id", "find 'add event submit' and click")->click();
42     sleep(2);
44     $t->driver()->accept_alert();
46     # it can be extended
47     }
50 $t->driver()->close();
51 done_testing();