'Scenario: User accomplishment banner should be present if logged in user is the one who is awarded
the certificate
Given there is a course with certificate configuration
And I have passed the course and certificate is generated
When I view the certificate web view page
Then I should see the accomplishment banner. banner should have linked-in and facebook share buttons
And When I click on `Add to Profile` button `edx.certificate.shared` event should be emitted'

def test_page_has_accomplishments_banner(self):

    self.cert_fixture.install()
    self.log_in_as_unique_user()
    self.certificate_page.visit()
    self.assertTrue(self.certificate_page.accomplishment_banner.visible)
    self.assertTrue(self.certificate_page.add_to_linkedin_profile_button.visible)
    self.assertTrue(self.certificate_page.add_to_facebook_profile_button.visible)
    self.certificate_page.add_to_linkedin_profile_button.click()
    actual_events = self.wait_for_events(event_filter={'event_type': 'edx.certificate.shared'}, number_of_matches=1)
    expected_events = [{'event': {'user_id': self.user_id, 'course_id': self.course_id}}]
    self.assert_events_match(expected_events, actual_events)
