'Scenario: Can publish a section and see published content in LMS
Given I have a section with 2 subsections and 3 unpublished units
When I go to the course outline
Then I see publish button for the unit, subsection, section
When I publish the section
Then I see that publish buttons disappears
And I see the changed content in LMS'

def test_section_publishing(self):

    self._add_unpublished_content()
    self.course_outline_page.visit()
    (section, subsection, unit) = self._get_items()
    self.assertTrue(subsection.publish_action)
    self.assertTrue(section.publish_action)
    self.assertTrue(unit.publish_action)
    self.course_outline_page.section(SECTION_NAME).publish()
    self.assertFalse(subsection.publish_action)
    self.assertFalse(section.publish_action)
    self.assertFalse(unit.publish_action)
    self.courseware.visit()
    self.assertEqual(1, self.courseware.num_xblock_components)
    self.courseware.go_to_sequential_position(2)
    self.assertEqual(1, self.courseware.num_xblock_components)
    self.course_home_page.visit()
    self.course_home_page.outline.go_to_section(SECTION_NAME, 'Test    Subsection    2')
    self.assertEqual(1, self.courseware.num_xblock_components)
