'Test clicking through the demand hints and verify the events sent.'

def verify_demand_hints(self, first_hint, second_hint, expected_events):

    self.courseware_page.visit()
    problem_page = ProblemPage(self.browser)
    self.assertFalse(problem_page.is_hint_notification_visible())
    self.assertEqual([None, None], problem_page.get_hint_button_disabled_attr())
    problem_page.click_hint()
    self.assertTrue(problem_page.is_hint_notification_visible())
    self.assertEqual(problem_page.hint_text, first_hint)
    self.assertEqual([None, None], problem_page.get_hint_button_disabled_attr())
    problem_page.click_hint()
    self.assertEqual(problem_page.hint_text, second_hint)
    self.assertEqual(['true', 'true'], problem_page.get_hint_button_disabled_attr())
    problem_page.click_review_in_notification(notification_type='hint')
    problem_page.wait_for_focus_on_problem_meta()
    actual_events = self.wait_for_events(event_filter={'event_type': 'edx.problem.hint.demandhint_displayed'}, number_of_matches=2)
    self.assert_events_match(expected_events, actual_events)
