'Scenario: Expanding all sections when 1 or more sections are already expanded
Given I navigate to the outline page of a course with multiple sections
And I click the "Collapse All Sections" link
When I expand the first section
And I click the "Expand All Sections" link
Then I see the "Collapse All Sections" link
And all sections are expanded'

def test_expand_all_when_some_collapsed(self):

    self.course_outline_page.visit()
    disable_animations(self.course_outline_page)
    self.course_outline_page.toggle_expand_collapse()
    self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.EXPAND)
    self.verify_all_sections(collapsed=True)
    self.course_outline_page.section_at(0).expand_subsection()
    self.course_outline_page.toggle_expand_collapse()
    self.assertEquals(self.course_outline_page.expand_collapse_link_state, ExpandCollapseLinkState.COLLAPSE)
    self.verify_all_sections(collapsed=False)
