5 use SGN::Test::WWW::WebDriver;
7 my $t = SGN::Test::WWW::WebDriver->new();
9 $t->while_logged_in_as("submitter", sub {
11 $t->get_ok('/calendar/personal');
13 $t->find_element_ok("fc-day", "class", "find day")->click();
17 my $event_project_select = $t->find_element_ok("event_project_select", "id", "find event project select");
19 $event_project_select->send_keys('test');
21 my $event_type_select = $t->find_element_ok("event_type_select", "id", "find event type select");
23 $event_type_select->send_keys('Planning Event');
25 $t->find_element_ok("event_start", "id", "find event start")->click();
27 my $event_start_calendar = $t->find_element_ok(".day.active", "css", "find active day on calendar select");
29 $event_start_calendar->click();
33 my $event_desc = $t->find_element_ok("event_description", "id", "find event description input");
37 $event_desc->send_keys('test event description');
39 my $event_url = $t->find_element_ok("event_url", "id", "find event url input");
41 $event_url->send_keys('test.com');
43 $t->find_element_ok("add_event_submit", "id", "submit event")->click();
47 $t->driver->accept_alert();
51 my $cal_event = $t->find_element_ok("test", "partial_link_text", "find test event");
57 $t->find_element_ok("test", "partial_link_text", "find test in event details");
59 $t->find_element_ok("Planning Event", "partial_link_text", "find event type in event details");
61 $t->find_element_ok("http://www.test.com", "partial_link_text", "find event url in event details");
63 $t->find_element_ok("event_edit_display", "id", "find event details edit")->click();
65 my $edit_event_project_select = $t->find_element_ok("edit_event_project_select", "id", "find edit event project select");
67 $edit_event_project_select->send_keys('test_trial');
69 my $edit_event_type_select = $t->find_element_ok("edit_event_type_select", "id", "find edit event type select");
71 $edit_event_type_select->send_keys('harvest_date');
73 $t->find_element_ok("edit_event_start", "id", "find edit event start")->click();
75 my $edit_event_desc = $t->find_element_ok("edit_event_description", "id", "find edit event description input");
77 $edit_event_desc->send_keys('test edit event description');
79 my $edit_event_url = $t->find_element_ok("edit_event_url", "id", "find edit event url input");
81 $edit_event_url->clear();
83 $edit_event_url->send_keys('http://www.testedit.com');
85 $t->find_element_ok("edit_event_submit", "id", "submit edit event")->click();
89 $t->driver->accept_alert();
93 my $cal_editted_event = $t->find_element_ok("test_trial", "partial_link_text", "find test event");
95 $cal_editted_event->click();
99 $t->find_element_ok("test_trial", "partial_link_text", "find program in editted event details");
101 $t->find_element_ok("Harvest_date", "partial_link_text", "find event type in editted event details");
103 $t->find_element_ok("http://www.testedit.com", "partial_link_text", "find event url in editted event details");
105 $t->find_element_ok("event_dialog_dismiss", "id", "dismiss event dialog")->click();
109 my $cal_editted_event_location = $cal_editted_event->get_element_location();
111 $cal_editted_event->drag($cal_editted_event_location{'x'}+30, $cal_editted_event_location{'y'});
115 $t->find_element_ok("fc-next-button", "class", "click next month arrow")->click();
119 $t->find_element_ok("fc-nextYear-button", "class", "click next year arrow")->click();
123 $t->find_element_ok("fc-prev-button", "class", "click prev month arrow")->click();
127 $t->find_element_ok("fc-prevYear-button", "class", "click prev year arrow")->click();
131 $t->find_element_ok("fc-today-button", "class", "click today button")->click();
135 $t->find_element_ok("fc-day", "class", "find day")->click();
137 my $event_project_select = $t->find_element_ok("event_project_select", "id", "find event project select");
139 $event_project_select->send_keys('test_trial');
141 my $event_type_select = $t->find_element_ok("event_type_select", "id", "find event type select");
143 $event_type_select->send_keys('harvest_date');
145 $t->find_element_ok("event_start", "id", "find event start")->click();
147 my $event_start_calendar = $t->find_element_ok(".day.active", "css", "find active day on calendar select");
149 $event_start_calendar->click();
153 my $event_desc = $t->find_element_ok("event_description", "id", "find event description input");
155 $event_desc->click();
157 $event_desc->send_keys('test repeat event type description');
159 my $event_url = $t->find_element_ok("event_url", "id", "find event url input");
161 $event_url->send_keys('test.com');
163 $t->find_element_ok("add_event_submit", "id", "submit event")->click();
167 $t->driver->accept_alert();
171 $t->get_ok('/calendar/personal');
175 $t->find_element_ok("test", "partial_link_text", "find test event")->click();
179 $t->find_element_ok("delete_event_submit", "id", "delete event")->click();
183 $t->driver->accept_alert();