'Scenario: Visiting the browse topics page should fire a page viewed event.
Given I am enrolled in a course with a team configuration and a topic
When I visit the browse topics page
Then my browser should post a page viewed event'

def test_page_viewed_event(self):

    topic = {u'name': u'Example    Topic', u'id': u'example_topic', u'description': 'Description'}
    self.set_team_configuration({u'max_team_size': 1, u'topics': [topic]})
    events = [{'event_type': 'edx.team.page_viewed', 'event': {'page_name': 'browse', 'topic_id': None, 'team_id': None}}]
    with self.assert_events_match_during(self.only_team_events, expected_events=events):
        self.topics_page.visit()
