def test_intersection_of_fields(self): """ Test event generation using multiple fields at a time. """ report_page = self.report_page report_page.live_server_url = self.live_server_url register_past_event_utility() register_past_job_utility() register_past_shift_utility() log_hours_utility() report_page.navigate_to_report_page() [select1, select2] = report_page.get_event_job_selectors() select1.select_by_visible_text('event') select2.select_by_visible_text('job') report_page.fill_report_form({ 'start': '2012-06-11', 'end': '2012-06-16'}) self.verify_shift_details('3.0') # Event, Job correct and date incorrect [select1, select2] = report_page.get_event_job_selectors() select1.select_by_visible_text('event') select2.select_by_visible_text('job') report_page.fill_report_form({ 'start': '2015-05-10', 'end': '2015-06-01' }) self.assertEqual(report_page.get_alert_box_text(), report_page.no_results_message)
def test_intersection_of_fields(self): """ Test event generation using multiple fields at a time. """ report_page = self.report_page report_page.live_server_url = self.live_server_url register_past_event_utility() register_past_job_utility() register_past_shift_utility() log_hours_utility() report_page.navigate_to_report_page() [select1, select2] = report_page.get_event_job_selectors() select1.select_by_visible_text('event') select2.select_by_visible_text('job') report_page.fill_report_form({ 'start': '2012-06-11', 'end': '2012-06-16' }) self.verify_shift_details('3.0') # Event, Job correct and date incorrect [select1, select2] = report_page.get_event_job_selectors() select1.select_by_visible_text('event') select2.select_by_visible_text('job') report_page.fill_report_form({ 'start': '2015-05-10', 'end': '2015-06-01' }) self.assertEqual(report_page.get_alert_box_text(), report_page.no_results_message)
def test_date_field(self): """ Test report generation using date field. """ report_page = self.report_page report_page.live_server_url = self.live_server_url register_past_event_utility() register_past_job_utility() register_past_shift_utility() log_hours_utility() report_page.navigate_to_report_page() report_page.fill_report_form({ 'start': '2012-06-11', 'end': '2012-06-16' }) self.verify_shift_details('3.0') # Incorrect date report_page.fill_report_form({ 'start': '2015-05-10', 'end': '2015-06-01' }) self.assertEqual(report_page.get_alert_box_text(), report_page.no_results_message)
def test_report_with_empty_fields(self): """ Test report generation with no fields filled in form. """ report_page = self.report_page report_page.live_server_url = self.live_server_url register_past_event_utility() register_past_job_utility() register_past_shift_utility() log_hours_utility() report_page.navigate_to_report_page() report_page.submit_form() self.verify_shift_details('3.0')
def test_job_field(self): """ Test event generation using job field. """ report_page = self.report_page report_page.live_server_url = self.live_server_url register_past_event_utility() register_past_job_utility() register_past_shift_utility() log_hours_utility() report_page.navigate_to_report_page() [select1, select2] = report_page.get_event_job_selectors() select2.select_by_visible_text('job') report_page.submit_form() self.verify_shift_details('3.0')
def test_shifts_appear_in_one_report(self): """ Test only shifts with logged hours is shown in report. """ report_page = self.report_page report_page.live_server_url = self.live_server_url register_past_event_utility() register_past_job_utility() register_past_shift_utility() log_hours_utility() report_page.navigate_to_report_page() report_page.submit_form() self.verify_shift_details('3.0') # try to create report again report_page.submit_form() self.assertEqual(report_page.get_alert_box_text(), report_page.no_results_message)