'Scenario: A bookmark breadcrumb trail is updated after publishing the changed display name.
Given that I am a registered user
And I visit my courseware page
And I can see bookmarked unit
Then I visit unit page in studio
Then I change unit display_name
And I publish the changes
Then I visit my bookmarks page
When I see the bookmark
Then I can see the breadcrumb trail has the updated display_name.'

def test_bookmark_shows_updated_breadcrumb_after_publish(self):

    self.setup_test(num_chapters=1)
    self.bookmark_units(num_units=1)
    self.bookmarks_page.visit()
    self._verify_breadcrumbs(num_units=1)
    LogoutPage(self.browser).visit()
    AutoAuthPage(self.browser, username=self.USERNAME, email=self.EMAIL, course_id=self.course_id, staff=True).visit()
    modified_name = 'Updated    name'
    self.update_and_publish_block_display_name(modified_name)
    LogoutPage(self.browser).visit()
    AutoAuthPage(self.browser, username=self.USERNAME, email=self.EMAIL, course_id=self.course_id).visit()
    self.bookmarks_page.visit()
    self._verify_breadcrumbs(num_units=1, modified_name=modified_name)
