'Scenario: Ensure that the link to the Unit works correctly.
Given I have a course with 5 notes
When I open Notes page
And I click on the first unit link
Then I see correct text on the unit page and a unit link event was fired
When go back to the Notes page
And I switch to "Location in Course" view
And I click on the second unit link
Then I see correct text on the unit page and a unit link event was fired
When go back to the Notes page
And I switch to "Tags" view
And I click on the first unit link
Then I see correct text on the unit page and a unit link event was fired
When go back to the Notes page
And I run the search with "Fifth" query
And I click on the first unit link
Then I see correct text on the unit page  and a unit link event was fired'

def test_easy_access_from_notes_page(self):

    def assert_page(note, usage_id, view):
        '    Verify    that    clicking    on    the    unit    link    works    properly.    '
        quote = note.quote
        note.go_to_unit()
        self.courseware_page.wait_for_page()
        self.assertIn(quote, self.courseware_page.xblock_component_html_content())
        self.assert_unit_link_event(usage_id, view)
        self.reset_event_tracking()
    self._add_default_notes()
    self.notes_page.visit()
    note = self.notes_page.notes[0]
    assert_page(note, self.raw_note_list[4]['usage_id'], 'Recent    Activity')
    self.notes_page.visit()
    self.notes_page.switch_to_tab('structure')
    note = self.notes_page.notes[1]
    assert_page(note, self.raw_note_list[2]['usage_id'], 'Location    in    Course')
    self.notes_page.visit()
    self.notes_page.switch_to_tab('tags')
    note = self.notes_page.notes[0]
    assert_page(note, self.raw_note_list[2]['usage_id'], 'Tags')
    self.notes_page.visit()
    self.notes_page.search('Fifth')
    self.notes_page.wait_for_ajax()
    note = self.notes_page.notes[0]
    assert_page(note, self.raw_note_list[4]['usage_id'], 'Search    Results')
